Clean up some FIXMEs

This commit is contained in:
Michael Sproul
2019-11-19 12:19:13 +11:00
parent 70e0528587
commit d05774d229
5 changed files with 9 additions and 14 deletions

View File

@@ -337,8 +337,6 @@ fn discard_votes_before_justified_slot() {
let (genesis_root, genesis_slot) = *harness.honest_roots.last().unwrap(); let (genesis_root, genesis_slot) = *harness.honest_roots.last().unwrap();
dbg!(&harness.honest_roots);
// Add attestations from all validators for all honest blocks. // Add attestations from all validators for all honest blocks.
for (root, slot) in harness.honest_roots.iter().rev() { for (root, slot) in harness.honest_roots.iter().rev() {
for i in 0..VALIDATOR_COUNT { for i in 0..VALIDATOR_COUNT {
@@ -353,6 +351,10 @@ fn discard_votes_before_justified_slot() {
"Honest head should be selected" "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!( assert_eq!(
lmd.find_head( lmd.find_head(
genesis_slot + 1, genesis_slot + 1,
@@ -362,13 +364,6 @@ fn discard_votes_before_justified_slot() {
Ok(genesis_root) 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`. /// Ensures that the finalized root can be set to all values in `roots`.

View File

@@ -856,7 +856,7 @@ fn invalid_attestation_bad_target_epoch() {
); );
} }
/* FIXME(sproul) /* FIXME: needs updating for v0.9
#[test] #[test]
fn invalid_attestation_bad_shard() { fn invalid_attestation_bad_shard() {
let spec = MainnetEthSpec::default_spec(); let spec = MainnetEthSpec::default_spec();

View File

@@ -108,7 +108,7 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq {
/// ///
/// Spec v0.9.1 /// Spec v0.9.1
fn slots_per_eth1_voting_period() -> usize { fn slots_per_eth1_voting_period() -> usize {
Self::EpochsPerHistoricalVector::to_usize() Self::SlotsPerEth1VotingPeriod::to_usize()
} }
} }

View File

@@ -48,8 +48,8 @@ impl TestingAttestationDataBuilder {
let beacon_block_root = *state.get_block_root(slot).unwrap(); let beacon_block_root = *state.get_block_root(slot).unwrap();
match test_task { match test_task {
// FIXME(sproul) // FIXME: re-enable the shard-like tests
AttestationTestTask::NoCommiteeForShard => index += 2, // AttestationTestTask::NoCommiteeForShard => index += 2,
// AttestationTestTask::BadShard => index = T::ShardCount::to_u64(), // AttestationTestTask::BadShard => index = T::ShardCount::to_u64(),
AttestationTestTask::IncludedTooEarly => { AttestationTestTask::IncludedTooEarly => {
slot = state.slot - spec.min_attestation_inclusion_delay + 1 slot = state.slot - spec.min_attestation_inclusion_delay + 1

View File

@@ -13,7 +13,7 @@ impl<T: EthSpec> TestingPendingAttestationBuilder<T> {
/// ///
/// The `inclusion_delay` will be set to `MIN_ATTESTATION_INCLUSION_DELAY`. /// 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`. /// `Self::add_committee_participation`.
pub fn new( pub fn new(
test_task: AttestationTestTask, test_task: AttestationTestTask,