Commit d0e549d
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
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
0 commit comments