fork_choice: the filtered block tree costs leaves × depth through get_checkpoint_block
Maintainer antworten meist innerhalb von 6 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 58/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/fork_choice.rs at is_viable_leaf and read the get_checkpoint_block calls alongside the path stack added by #758. Compare the proposed ancestor and partition_point lookup with filter_block_tree_by_scan; the issue identifies a randomized differential test as coverage. Done means checkpoint lookup no longer walks each leaf's ancestry and the differential test passes.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
is_viable_leaf (crates/blockchain/state_transition/src/beacon/fork_choice.rs:1989) calls get_checkpoint_block(index, block_root, finalized_checkpoint.epoch) once per leaf of the justified subtree. Each call walks that leaf back to the finalized epoch's start slot. Every head computation therefore costs leaves × depth.
The #746 measurements (https://github.com/lambdaclass/ethlambda/pull/746#issuecomment-6533272351) put that at 74 ms with 14,851 blocks and 451 leaves. During a finality stall the depth grows by a block every slot. Until lambdaclass/ethlambda#758, a stack overflow capped that depth; now nothing does.
This is out of scope for lambdaclass/ethlambda#758, which only replaces the recursion with an explicit stack and keeps the per-leaf check unchanged.
A fix (Pablo's sketch in the #758 review), using the path stack that #758 adds:
- If the justified block's slot is at or above the finalized epoch's start slot, every leaf has the same checkpoint block. One
get_ancestorfrom the justified root answers all of them. - Otherwise the checkpoint block lies on
path, between the justified root and the leaf. Apartition_pointby slot over the frames finds it without walking the index.
The randomized differential test against filter_block_tree_by_scan would cover the change.
- 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