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:
Eitan Seri-Levi
2026-02-01 21:58:42 -08:00
committed by GitHub
parent cd8049a696
commit 3ecf964385
56 changed files with 579 additions and 184 deletions

View File

@@ -174,7 +174,7 @@ async fn base_altair_bellatrix_with_terminal_block_after_fork() {
.unwrap();
// Add a slot duration to get to the next slot
let timestamp = harness.get_timestamp_at_slot() + harness.spec.seconds_per_slot;
let timestamp = harness.get_timestamp_at_slot() + harness.spec.get_slot_duration().as_secs();
harness
.execution_block_generator()

View File

@@ -103,7 +103,7 @@ async fn base_altair_bellatrix_capella() {
.unwrap();
// Add a slot duration to get to the next slot
let timestamp = harness.get_timestamp_at_slot() + harness.spec.seconds_per_slot;
let timestamp = harness.get_timestamp_at_slot() + harness.spec.get_slot_duration().as_secs();
harness
.execution_block_generator()
.modify_last_block(|block| {

View File

@@ -3011,7 +3011,6 @@ async fn weak_subjectivity_sync_test(
let temp2 = tempdir().unwrap();
let store = get_store(&temp2);
let spec = test_spec::<E>();
let seconds_per_slot = spec.seconds_per_slot;
let kzg = get_kzg(&spec);
@@ -3025,7 +3024,7 @@ async fn weak_subjectivity_sync_test(
let slot_clock = TestingSlotClock::new(
Slot::new(0),
Duration::from_secs(harness.chain.genesis_time),
Duration::from_secs(seconds_per_slot),
spec.get_slot_duration(),
);
slot_clock.set_slot(harness.get_current_slot().as_u64());
@@ -3940,8 +3939,6 @@ async fn revert_minority_fork_on_resume() {
let mut spec2 = MinimalEthSpec::default_spec();
spec2.altair_fork_epoch = Some(fork_epoch);
let seconds_per_slot = spec1.seconds_per_slot;
let all_validators = (0..validator_count).collect::<Vec<usize>>();
// Chain with no fork epoch configured.
@@ -4061,7 +4058,7 @@ async fn revert_minority_fork_on_resume() {
builder = builder
.resume_from_db()
.unwrap()
.testing_slot_clock(Duration::from_secs(seconds_per_slot))
.testing_slot_clock(spec2.get_slot_duration())
.unwrap();
builder
.get_slot_clock()