diff --git a/crates/blockchain/src/lib.rs b/crates/blockchain/src/lib.rs index 7faa1163..dc4f1268 100644 --- a/crates/blockchain/src/lib.rs +++ b/crates/blockchain/src/lib.rs @@ -68,13 +68,13 @@ pub struct BlockChainConfig { pub proposer_config: ProposerConfig, } -/// Milliseconds per interval (800ms ticks). -pub const MILLISECONDS_PER_INTERVAL: u64 = 800; -/// Number of intervals per slot (5 intervals of 800ms = 4 seconds). -pub const INTERVALS_PER_SLOT: u64 = 5; -/// Milliseconds in a slot (derived from interval duration and count). -pub const MILLISECONDS_PER_SLOT: u64 = MILLISECONDS_PER_INTERVAL * INTERVALS_PER_SLOT; +// The interval grid lives in `ethlambda-types` because `ethlambda-storage` also +// derives slots from `store.time()` and must not carry a second copy of a +// consensus-critical constant. pub use ethlambda_types::block::MAX_ATTESTATIONS_DATA; +pub use ethlambda_types::constants::{ + INTERVALS_PER_SLOT, MILLISECONDS_PER_INTERVAL, MILLISECONDS_PER_SLOT, +}; pub use sync_status::SyncStatusController; /// Future-slot tolerance for gossip attestations, expressed in intervals. /// diff --git a/crates/common/types/src/constants.rs b/crates/common/types/src/constants.rs index 3066b344..c3434d9a 100644 --- a/crates/common/types/src/constants.rs +++ b/crates/common/types/src/constants.rs @@ -8,3 +8,10 @@ /// eventually be derived from the fork version and genesis validators root. // TODO: derive dynamically once the spec defines fork identification. pub const FORK_DIGEST: &str = "12345678"; + +/// Milliseconds per interval (800ms ticks). +pub const MILLISECONDS_PER_INTERVAL: u64 = 800; +/// Number of intervals per slot (5 intervals of 800ms = 4 seconds). +pub const INTERVALS_PER_SLOT: u64 = 5; +/// Milliseconds in a slot (derived from interval duration and count). +pub const MILLISECONDS_PER_SLOT: u64 = MILLISECONDS_PER_INTERVAL * INTERVALS_PER_SLOT;