Phase0 epoch processing is quadratic: get_base_reward rescans the registry for every validator
Maintainer antworten meist innerhalb von 6 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 67/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- backend, performance
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Rust
- Sterne
- 86
- Forks
- 34
- Ø Merge
- 9 T. 20 Std.
- Gemergte PRs (30 T.)
- 77
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus lambdaclass/ethlambda
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
lambdaclass/ethlambda#850 ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
lambdaclass/ethlambda#777 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Run all gossip validation testsEvtl. wieder frei @dicethedev hat das vor 9 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
lambdaclass/ethlambda#725 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Handle malformed DB dataEvtl. wieder frei @dicethedev hat das vor 115 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
lambdaclass/ethlambda#529 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Document architectural choicesEvtl. wieder frei @dicethedev hat das vor 115 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
lambdaclass/ethlambda#521 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 6 Tagen
Alle Issues in lambdaclass/ethlambda
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
antithesishq/bombadil#473 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bench/api.sh exec test fails with curl exit 52, and --ignore-failure still records the timingsOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
libracoder/kiri#669 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 5 Tagen
-
autofixer: follow-up
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
tursodatabase/turso#12217 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Declare the CMS schema library in the optional recipients extraEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenarea:python in-progress
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
yhay81/pyropdf#1005 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag