Phase0 epoch processing is quadratic: get_base_reward rescans the registry for every validator
Maintainer thường phản hồi trong vòng 6 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 67/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
Start in crates/blockchain/state_transition/src/beacon/stf/epoch/rewards.rs, reading get_base_reward and the phase0 delta loops that call it. Compare how RewardContext in #632 passes precomputed balance for Altair and later; then run the phase0 fixtures and the era replay for mainnet era 290. Done means the epoch path avoids rescanning the registry per validator and those checks complete successfully.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found by the era replay battery (#680): mainnet phase0 era 290 did not get through a single epoch boundary in 30 minutes, so phase0 eras are excluded from its matrix.
Cause (crates/blockchain/state_transition/src/beacon/stf/epoch/rewards.rs)
get_base_reward(line 71) callsget_total_active_balance(state)— a full registry scan — on every call.- It is called per validator from the phase0 delta loops (lines 118, 121, 125, 212, 246, and through
get_proposer_rewardat 82), so a phase0 epoch transition does O(validators) scans of O(validators) each: quadratic in the registry size. With the registry now a persistent tree (state.validator(i)is a descent), each scan is also more expensive than an array walk.
Fix
- Compute the total active balance (or the base reward per increment) once per epoch transition and pass it in, the way #632's
RewardContextalready does for altair and later, and #648 proposes for deneb/electra'sget_base_reward_per_increment. - The spec-literal
get_base_rewardcan stay as the reference the fixtures call, with the epoch path using the precomputed total.
Impact
- No live chain is in phase0, so this doesn't affect following mainnet today; it blocks replaying phase0 history in #680 and makes phase0 fixtures slower than they need to be.
- Once fixed, phase0 eras (e.g. mainnet 290) can be added back to the era replay matrix.
- Ngôn ngữ chính
- Rust
- Star
- 86
- Fork
- 34
- Merge trung bình
- 9 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 77
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của lambdaclass/ethlambda
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
lambdaclass/ethlambda#850 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lambdaclass/ethlambda#777 · 1 reaction ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Run all gossip validation testsCó thể làm lại được @dicethedev đã nhận 9 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
lambdaclass/ethlambda#725 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Handle malformed DB dataCó thể làm lại được @dicethedev đã nhận 115 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
lambdaclass/ethlambda#529 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Document architectural choicesCó thể làm lại được @dicethedev đã nhận 115 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lambdaclass/ethlambda#521 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
Tất cả issue của lambdaclass/ethlambda
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
antithesishq/bombadil#473 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bench/api.sh exec test fails with curl exit 52, and --ignore-failure still records the timingsĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
libracoder/kiri#669 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 5 ngày
-
autofixer: follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
tursodatabase/turso#12217 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Declare the CMS schema library in the optional recipients extraCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:python in-progress
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
yhay81/pyropdf#1005 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày