Skip to content

Commit edcfee6

Browse files
authored
Fix bug in fork calculation at fork boundaries (#8121)
N/A In #8101 , when we modified the logic to get the proposer index post fulu, we seem to have missed advancing the state at the fork boundaries to get the right `Fork` for signature verification. This led to lighthouse failing all gossip verification right after transitioning to fulu that was observed on the holesky shadow fork ``` Sep 26 14:24:00.088 DEBUG Rejected gossip block error: "InvalidSignature(ProposerSignature)", graffiti: "grandine-geth-super-1", slot: 640 Sep 26 14:24:00.099 WARN Could not verify block for gossip. Rejecting the block error: InvalidSignature(ProposerSignature) ``` I'm not completely sure this is the correct fix, but this fixes the issue with `InvalidProposerSignature` on the holesky shadow fork. Thanks to @eserilev for helping debug this Co-Authored-By: Pawan Dhananjay <[email protected]>
1 parent c754234 commit edcfee6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

beacon_node/beacon_chain/src/beacon_proposer_cache.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,14 @@ pub fn ensure_state_can_determine_proposers_for_epoch<E: EthSpec>(
234234
if state.current_epoch() > maximum_epoch {
235235
Err(BeaconStateError::SlotOutOfBounds.into())
236236
} else if state.current_epoch() >= minimum_epoch {
237-
// Fulu allows us to access shufflings in multiple epochs (thanks to lookahead).
238-
// Pre-Fulu we expect `minimum_epoch == maximum_epoch`, and this branch covers that case.
237+
if target_epoch > state.current_epoch() {
238+
let target_slot = target_epoch.start_slot(E::slots_per_epoch());
239+
240+
// Advance the state into the same epoch as the block. Use the "partial" method since state
241+
// roots are not important for proposer/attester shuffling.
242+
partial_state_advance(state, Some(state_root), target_slot, spec)
243+
.map_err(BeaconChainError::from)?;
244+
}
239245
Ok(())
240246
} else {
241247
// State's current epoch is less than the minimum epoch.

0 commit comments

Comments
 (0)