Skip to content

Commit d0e549d

Browse files
authored
feat(aggregation): score interval-2 jobs like the block builder (#526)
## What Rework `snapshot_aggregation_inputs` into a tiered greedy selector modeled on the block builder's `select_attestations`: an up-front store pass resolves each candidate's aggregation material once (raw-first + trim), then a loop scores candidates by (current-slot-first, Finalize > Justify > Build) against an optimistically-projected state, emitting at most `MAX_AGGREGATION_JOBS` jobs. ## Why The interval-2 session aggregated current-slot gossip groups in arbitrary order and ignored existing proofs, so it could not prioritize the groups whose aggregation most advances consensus. ## How - Candidates are filtered by the block builder's `entry_passes_filters` against a chain view covering `[0, head_slot]` (the head root is pushed onto the state's `historical_block_hashes`, which omits the head's own root), so prover time is spent only on aggregations a block could actually pack. - Reuses the shared `ProjectedState` (`from_head_state` + `advance`) and `Tier`/`EntryScore`/`entry_passes_filters` via a coverage-based `score_from_coverage` core, so proposer and aggregator can never drift on either the justify/finalize projection or the tiering. - Deletes `snapshot_current_slot_aggregation_inputs` and `build_raw_signature_job` (subsumed). ## Stacking Stacked on #525 (the block builder refactor). Review/merge that first; GitHub retargets this PR to `main` once it lands. ## Checks - `cargo fmt` clean - `cargo clippy --all-targets -- -D warnings` clean - `cargo test -p ethlambda-blockchain --lib` green (incl. resolve_job / pick_best_candidate / snapshot tests)
1 parent 1d4fcfb commit d0e549d

4 files changed

Lines changed: 878 additions & 130 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/blockchain/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ hex = { workspace = true }
4040
libssz.workspace = true
4141
libssz-types.workspace = true
4242
datatest-stable = "0.3.3"
43+
leansig.workspace = true
44+
rand.workspace = true
4345

4446
[[test]]
4547
name = "forkchoice_spectests"

0 commit comments

Comments
 (0)