mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-16 03:12:41 +00:00
Replace INTERVALS_PER_SLOT with explicit slot component times (#7944)
https://github.com/ethereum/consensus-specs/pull/4476 Co-Authored-By: Barnabas Busa <barnabas.busa@ethereum.org> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -315,7 +315,7 @@ where
|
||||
let deneb_time = genesis_time
|
||||
+ (deneb_fork_epoch.as_u64()
|
||||
* E::slots_per_epoch()
|
||||
* spec.seconds_per_slot);
|
||||
* spec.get_slot_duration().as_secs());
|
||||
|
||||
// Shrink the blob availability window so users don't start
|
||||
// a sync right before blobs start to disappear from the P2P
|
||||
@@ -325,7 +325,7 @@ where
|
||||
.saturating_sub(BLOB_AVAILABILITY_REDUCTION_EPOCHS);
|
||||
let blob_availability_window = reduced_p2p_availability_epochs
|
||||
* E::slots_per_epoch()
|
||||
* spec.seconds_per_slot;
|
||||
* spec.get_slot_duration().as_secs();
|
||||
|
||||
if now > deneb_time + blob_availability_window {
|
||||
return Err(
|
||||
@@ -592,17 +592,17 @@ where
|
||||
.network_globals
|
||||
.clone()
|
||||
.ok_or("slot_notifier requires a libp2p network")?;
|
||||
let seconds_per_slot = self
|
||||
let slot_duration = self
|
||||
.chain_spec
|
||||
.as_ref()
|
||||
.ok_or("slot_notifier requires a chain spec")?
|
||||
.seconds_per_slot;
|
||||
.get_slot_duration();
|
||||
|
||||
spawn_notifier(
|
||||
context.executor,
|
||||
beacon_chain,
|
||||
network_globals,
|
||||
seconds_per_slot,
|
||||
slot_duration,
|
||||
)
|
||||
.map_err(|e| format!("Unable to start slot notifier: {}", e))?;
|
||||
|
||||
@@ -906,7 +906,7 @@ where
|
||||
let slot_clock = SystemTimeSlotClock::new(
|
||||
spec.genesis_slot,
|
||||
Duration::from_secs(genesis_time),
|
||||
Duration::from_secs(spec.seconds_per_slot),
|
||||
spec.get_slot_duration(),
|
||||
);
|
||||
|
||||
self.slot_clock = Some(slot_clock);
|
||||
|
||||
Reference in New Issue
Block a user