Skip to content

Commit

Permalink
revert changes to ef test tester
Browse files Browse the repository at this point in the history
  • Loading branch information
realbigsean committed Jun 18, 2022
1 parent 3a0fea7 commit 76b5344
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion consensus/fork_choice/src/fork_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())?
Expand Down
15 changes: 11 additions & 4 deletions testing/ef_tests/src/cases/fork_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ impl<E: EthSpec> Case for ForkChoiceTest<E> {
// 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);
};
Expand Down Expand Up @@ -316,14 +317,20 @@ impl<E: EthSpec> Tester<E> {
}

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();
}

Expand Down

0 comments on commit 76b5344

Please sign in to comment.