Update proposer boost calculation (#9215)

Closes:

- https://github.com/sigp/lighthouse/issues/8689


  - Calculate the proposer index on the canonical chain (from canonical head) at `slot` and plumb it through to fork choice so it can be used to determine whether or not to apply the proposer boost. We use the proposer cache to handle state advances and avoid duplicate work.
- Update our FC tests to use `block.message().proposer_index()` (always pass), we are not attempting to test this feature in those tests. The EF tests use the correct canonical proposer idnex via `on_block`, except for invalid blocks which just auto-pass this check (these blocks get rejected by other checks in `on_block` anyway).


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Michael Sproul
2026-04-29 22:19:44 +10:00
committed by GitHub
parent 0e427ab77b
commit f406e9c3fb
6 changed files with 79 additions and 33 deletions

View File

@@ -1093,6 +1093,7 @@ async fn invalid_parent() {
Duration::from_secs(0),
&state,
PayloadVerificationStatus::Optimistic,
block.message().proposer_index(),
&rig.harness.chain.spec,
),
Err(ForkChoiceError::ProtoArrayStringError(message))