refactor(blockchain): remove log_tree param from accept_new_attestations#536
Merged
MegaRedHand merged 1 commit intoJul 23, 2026
Merged
Conversation
Contributor
Greptile SummaryThis PR moves fork-choice tree logging out of the head update functions. The main changes are:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| crates/blockchain/src/store.rs | Moves tree logging to end-of-slot processing and returns the existing fork-choice computation through HeadUpdate. |
| crates/blockchain/src/spec_test_runner.rs | Updates the test runner for the simplified update_head signature. |
Reviews (1): Last reviewed commit: "refactor(blockchain): remove log_tree pa..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description / Motivation
log_treeboolean parameter fromaccept_new_attestations(andupdate_head), which threaded a UI concern through the fork-choice code path.crates/blockchain/src/store.rsis meant to mirror the spec's architecture, and thelog_treeflag was inconsistent with that goal — logging is a caller-side concern, not part of the fork-choice update.on_tick, end-of-slot) so the update functions stay purely about fork-choice computation.What Changed
crates/blockchain/src/store.rslog_tree: boolparameter fromaccept_new_attestationsandupdate_head.log_fork_choice_tree(store, &HeadUpdate)helper that renders the ASCII tree; called fromon_tickatSlotInterval::EndOfSlot.update_headnow returns aHeadUpdate { blocks, weights, head }so the tree renders from already-computed data instead of recomputing LMD GHOST.update_headdoc comment.crates/blockchain/src/spec_test_runner.rsupdate_headcall to the new no-bool signature.Correctness / Behavior Guarantees
log_fork_choice_treestill readslatest_justified/latest_finalizedafter the checkpoint update — so the rendered tree is byte-for-byte equivalent to before.update_head, once for the tree). It now computes once and reuses the result viaHeadUpdate, eliminating a redundantget_live_chain()+compute_lmd_ghost_head()per slot.BlockPublication,on_block_core,get_proposal_head) simply drop thefalseargument — no functional difference.Tests Added / Run
cargo clippy -p ethlambda-blockchain --all-targets -- -D warnings— cleancargo fmt --all --check— cleancargo test -p ethlambda-blockchain --test forkchoice_spectests— compiled and ran; requiresmake leanSpec/fixtureslocally to execute assertions.Related Issues / PRs
log_treeparameter onaccept_new_attestations#520✅ Verification Checklist
make fmt— cleanmake lint(clippy with-D warnings) — cleancargo test --workspace --release