mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-16 11:22:56 +00:00
Fix proposer shuffling decision slot at boundary (#8128)
Follow-up to the bug fixed in: - https://github.com/sigp/lighthouse/pull/8121 This fixes the root cause of that bug, which was introduced by me in: - https://github.com/sigp/lighthouse/pull/8101 Lion identified the issue here: - https://github.com/sigp/lighthouse/pull/8101#discussion_r2382710356 In the methods that compute the proposer shuffling decision root, ensure we don't use lookahead for the Fulu fork epoch itself. This is accomplished by checking if Fulu is enabled at `epoch - 1`, i.e. if `epoch > fulu_fork_epoch`. I haven't updated the methods that _compute_ shufflings to use these new corrected bounds (e.g. `BeaconState::compute_proposer_indices`), although we could make this change in future. The `get_beacon_proposer_indices` method already gracefully handles the Fulu boundary case by using the `proposer_lookahead` field (if initialised). Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -172,7 +172,13 @@ impl Block {
|
||||
) -> Hash256 {
|
||||
let block_epoch = self.current_epoch_shuffling_id.shuffling_epoch;
|
||||
|
||||
if !spec.fork_name_at_epoch(child_block_epoch).fulu_enabled() {
|
||||
// For child blocks in the Fulu fork epoch itself, we want to use the old logic. There is no
|
||||
// lookahead in the first Fulu epoch. So we check whether Fulu is enabled at
|
||||
// `child_block_epoch - 1`, i.e. whether `child_block_epoch > fulu_fork_epoch`.
|
||||
if !spec
|
||||
.fork_name_at_epoch(child_block_epoch.saturating_sub(1_u64))
|
||||
.fulu_enabled()
|
||||
{
|
||||
// Prior to Fulu the proposer shuffling decision root for the current epoch is the same
|
||||
// as the attestation shuffling for the *next* epoch, i.e. it is determined at the start
|
||||
// of the current epoch.
|
||||
|
||||
Reference in New Issue
Block a user