mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +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:
@@ -44,10 +44,8 @@ pub fn spawn_notifier<T: BeaconChainTypes>(
|
||||
executor: task_executor::TaskExecutor,
|
||||
beacon_chain: Arc<BeaconChain<T>>,
|
||||
network: Arc<NetworkGlobals<T::EthSpec>>,
|
||||
seconds_per_slot: u64,
|
||||
slot_duration: Duration,
|
||||
) -> Result<(), String> {
|
||||
let slot_duration = Duration::from_secs(seconds_per_slot);
|
||||
|
||||
let speedo = Mutex::new(Speedo::default());
|
||||
|
||||
// Keep track of sync state and reset the speedo on specific sync state changes.
|
||||
@@ -568,8 +566,8 @@ fn find_next_fork_to_prepare<T: BeaconChainTypes>(
|
||||
// Find the first fork that is scheduled and close to happen
|
||||
if let Some(fork_epoch) = fork_epoch {
|
||||
let fork_slot = fork_epoch.start_slot(T::EthSpec::slots_per_epoch());
|
||||
let preparation_slots =
|
||||
FORK_READINESS_PREPARATION_SECONDS / beacon_chain.spec.seconds_per_slot;
|
||||
let preparation_slots = FORK_READINESS_PREPARATION_SECONDS
|
||||
/ beacon_chain.spec.get_slot_duration().as_secs();
|
||||
let in_fork_preparation_period = current_slot + preparation_slots > fork_slot;
|
||||
if in_fork_preparation_period {
|
||||
return Some(*fork);
|
||||
|
||||
Reference in New Issue
Block a user