diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 2cb33d7da..4d37926dd 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -131,7 +131,11 @@ const PREPARE_PROPOSER_HISTORIC_EPOCHS: u64 = 4; /// run the per-slot tasks (primarily fork choice). /// /// This prevents unnecessary work during sync. -const MAX_PER_SLOT_FORK_CHOICE_DISTANCE: u64 = 4; +/// +/// The value is set to 256 since this would be just over one slot (12.8s) when syncing at +/// 20 slots/second. Having a single fork-choice run interrupt syncing would have very little +/// impact whilst having 8 epochs without a block is a comfortable grace period. +const MAX_PER_SLOT_FORK_CHOICE_DISTANCE: u64 = 256; /// Reported to the user when the justified block has an invalid execution payload. pub const INVALID_JUSTIFIED_PAYLOAD_SHUTDOWN_REASON: &str = diff --git a/beacon_node/beacon_chain/src/state_advance_timer.rs b/beacon_node/beacon_chain/src/state_advance_timer.rs index 48c0f2f8a..4359b6f1e 100644 --- a/beacon_node/beacon_chain/src/state_advance_timer.rs +++ b/beacon_node/beacon_chain/src/state_advance_timer.rs @@ -38,7 +38,11 @@ use types::{AttestationShufflingId, EthSpec, Hash256, RelativeEpoch, Slot}; const MAX_ADVANCE_DISTANCE: u64 = 4; /// Similarly for fork choice: avoid the fork choice lookahead during sync. -const MAX_FORK_CHOICE_DISTANCE: u64 = 4; +/// +/// The value is set to 256 since this would be just over one slot (12.8s) when syncing at +/// 20 slots/second. Having a single fork-choice run interrupt syncing would have very little +/// impact whilst having 8 epochs without a block is a comfortable grace period. +const MAX_FORK_CHOICE_DISTANCE: u64 = 256; #[derive(Debug)] enum Error {