Skip to content

Commit 353fdcb

Browse files
committed
Use min_seed_lookahead in ChainSpec::proposer_shuffling_decision_slot
1 parent 4ceccd2 commit 353fdcb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

consensus/types/src/chain_spec.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -871,16 +871,19 @@ impl ChainSpec {
871871
pub fn proposer_shuffling_decision_slot<E: EthSpec>(&self, epoch: Epoch) -> Slot {
872872
if self.fork_name_at_epoch(epoch).fulu_enabled() {
873873
// Post-Fulu the proposer shuffling decision slot for epoch N is the slot at the end
874-
// of epoch N - 2.
875-
// FIXME(sproul): rewrite this in terms of min_seed_lookahead?
874+
// of epoch N - 2 (note: min_seed_lookahead=1 in all current configs).
876875
epoch
877-
.saturating_sub(Epoch::new(1))
876+
.saturating_sub(self.min_seed_lookahead)
878877
.start_slot(E::slots_per_epoch())
879878
.saturating_sub(1_u64)
880879
} else {
881-
// Pre-Fulu the proposer shuffling decision slot for epcoch N is the slot at the end of
882-
// epoch N - 1.
883-
epoch.start_slot(E::slots_per_epoch()).saturating_sub(1_u64)
880+
// Pre-Fulu the proposer shuffling decision slot for epoch N is the slot at the end of
881+
// epoch N - 1 (note: +1 -1 for min_seed_lookahead=1 in all current configs).
882+
epoch
883+
.saturating_add(Epoch::new(1))
884+
.saturating_sub(self.min_seed_lookahead)
885+
.start_slot(E::slots_per_epoch())
886+
.saturating_sub(1_u64)
884887
}
885888
}
886889

0 commit comments

Comments
 (0)