From 76b5344471326ef360b200ce327489b6a490695c Mon Sep 17 00:00:00 2001 From: sean Date: Sat, 18 Jun 2022 12:16:08 +0000 Subject: [PATCH] revert changes to ef test tester --- consensus/fork_choice/src/fork_choice.rs | 3 ++- testing/ef_tests/src/cases/fork_choice.rs | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/consensus/fork_choice/src/fork_choice.rs b/consensus/fork_choice/src/fork_choice.rs index 0f00e15d95e..218dc2c63a8 100644 --- a/consensus/fork_choice/src/fork_choice.rs +++ b/consensus/fork_choice/src/fork_choice.rs @@ -954,7 +954,8 @@ where // Note: we are relying upon `on_tick` to update `fc_store.time` to ensure we don't // get stuck in a loop. //TODO(sean) fix chain spec - if (previous_slot + 1) % MainnetEthSpec::slots_per_epoch() == 0 { + dbg!(&previous_slot); + if (previous_slot) % MainnetEthSpec::slots_per_epoch() == 0 { dbg!("hitting epoch boundary"); } self.on_tick(previous_slot + 1, &ChainSpec::mainnet())? diff --git a/testing/ef_tests/src/cases/fork_choice.rs b/testing/ef_tests/src/cases/fork_choice.rs index c0d53dca612..e0b4ca3589f 100644 --- a/testing/ef_tests/src/cases/fork_choice.rs +++ b/testing/ef_tests/src/cases/fork_choice.rs @@ -159,7 +159,8 @@ impl Case for ForkChoiceTest { // TODO(merge): re-enable this test before production. // This test is skipped until we can do retrospective confirmations of the terminal // block after an optimistic sync. - if self.description == "block_lookup_failed" || self.description == "discard_equivocations" + if self.description == "block_lookup_failed" + || !(self.description == "proposer_boost_root_same_slot_untimely_block") { return Err(Error::SkippedKnownFailure); }; @@ -316,14 +317,20 @@ impl Tester { } pub fn set_tick(&self, tick: u64) { - let new_slot = tick.checked_div(self.spec.seconds_per_slot).unwrap(); + self.harness + .chain + .slot_clock + .set_current_time(Duration::from_secs(tick)); + + // Compute the slot time manually to ensure the slot clock is correct. + let slot = self.tick_to_slot(tick).unwrap(); + assert_eq!(slot, self.harness.chain.slot().unwrap()); - self.harness.chain.slot_clock.set_slot(new_slot); self.harness .chain .fork_choice .write() - .update_time(Slot::new(new_slot)) + .update_time(slot) .unwrap(); }