From d05774d2298c0076d48c6b1ea68eb87dd1e3e5d5 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Tue, 19 Nov 2019 12:19:13 +1100 Subject: [PATCH] Clean up some FIXMEs --- eth2/lmd_ghost/tests/test.rs | 13 ++++--------- .../src/per_block_processing/tests.rs | 2 +- eth2/types/src/eth_spec.rs | 2 +- .../builders/testing_attestation_data_builder.rs | 4 ++-- .../builders/testing_pending_attestation_builder.rs | 2 +- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/eth2/lmd_ghost/tests/test.rs b/eth2/lmd_ghost/tests/test.rs index 631110d1dd..631f3e406e 100644 --- a/eth2/lmd_ghost/tests/test.rs +++ b/eth2/lmd_ghost/tests/test.rs @@ -337,8 +337,6 @@ fn discard_votes_before_justified_slot() { let (genesis_root, genesis_slot) = *harness.honest_roots.last().unwrap(); - dbg!(&harness.honest_roots); - // Add attestations from all validators for all honest blocks. for (root, slot) in harness.honest_roots.iter().rev() { for i in 0..VALIDATOR_COUNT { @@ -353,6 +351,10 @@ fn discard_votes_before_justified_slot() { "Honest head should be selected" ); + // Head from one slot after genesis should still be genesis, because the successor + // block of the genesis block has slot `genesis_slot + 1` which isn't greater than + // the slot we're starting from. This is a very artifical test, but one that's easy to + // describe. assert_eq!( lmd.find_head( genesis_slot + 1, @@ -362,13 +364,6 @@ fn discard_votes_before_justified_slot() { Ok(genesis_root) ); } - - let head = harness.harness.chain.head(); - - dbg!(&harness.honest_roots); - dbg!(head.beacon_state.current_justified_checkpoint); - - // assert!(false); } /// Ensures that the finalized root can be set to all values in `roots`. diff --git a/eth2/state_processing/src/per_block_processing/tests.rs b/eth2/state_processing/src/per_block_processing/tests.rs index 8dc4a1ad12..32c460d856 100644 --- a/eth2/state_processing/src/per_block_processing/tests.rs +++ b/eth2/state_processing/src/per_block_processing/tests.rs @@ -856,7 +856,7 @@ fn invalid_attestation_bad_target_epoch() { ); } -/* FIXME(sproul) +/* FIXME: needs updating for v0.9 #[test] fn invalid_attestation_bad_shard() { let spec = MainnetEthSpec::default_spec(); diff --git a/eth2/types/src/eth_spec.rs b/eth2/types/src/eth_spec.rs index 7c7c70b181..5377254afd 100644 --- a/eth2/types/src/eth_spec.rs +++ b/eth2/types/src/eth_spec.rs @@ -108,7 +108,7 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq { /// /// Spec v0.9.1 fn slots_per_eth1_voting_period() -> usize { - Self::EpochsPerHistoricalVector::to_usize() + Self::SlotsPerEth1VotingPeriod::to_usize() } } diff --git a/eth2/types/src/test_utils/builders/testing_attestation_data_builder.rs b/eth2/types/src/test_utils/builders/testing_attestation_data_builder.rs index 4e2346e718..f5abb46150 100644 --- a/eth2/types/src/test_utils/builders/testing_attestation_data_builder.rs +++ b/eth2/types/src/test_utils/builders/testing_attestation_data_builder.rs @@ -48,8 +48,8 @@ impl TestingAttestationDataBuilder { let beacon_block_root = *state.get_block_root(slot).unwrap(); match test_task { - // FIXME(sproul) - AttestationTestTask::NoCommiteeForShard => index += 2, + // FIXME: re-enable the shard-like tests + // AttestationTestTask::NoCommiteeForShard => index += 2, // AttestationTestTask::BadShard => index = T::ShardCount::to_u64(), AttestationTestTask::IncludedTooEarly => { slot = state.slot - spec.min_attestation_inclusion_delay + 1 diff --git a/eth2/types/src/test_utils/builders/testing_pending_attestation_builder.rs b/eth2/types/src/test_utils/builders/testing_pending_attestation_builder.rs index 100bda374e..c56deb647d 100644 --- a/eth2/types/src/test_utils/builders/testing_pending_attestation_builder.rs +++ b/eth2/types/src/test_utils/builders/testing_pending_attestation_builder.rs @@ -13,7 +13,7 @@ impl TestingPendingAttestationBuilder { /// /// The `inclusion_delay` will be set to `MIN_ATTESTATION_INCLUSION_DELAY`. /// - /// * The aggregation and custody bitfields will all be empty, they need to be set with + /// * The aggregation bitfield will be empty, it needs to be set with /// `Self::add_committee_participation`. pub fn new( test_task: AttestationTestTask,