Fix failing tests (#4423)

* Get tests passing

* Get benchmarks compiling

* Fix EF withdrawals test

* Remove unused deps

* Fix tree_hash panic in tests

* Fix slasher compilation

* Fix ssz_generic test

* Get more tests passing

* Fix EF tests for real

* Fix local testnet scripts
This commit is contained in:
Michael Sproul
2023-06-27 15:04:39 +10:00
committed by GitHub
parent ca412ab3f0
commit 88e30b6dcf
26 changed files with 404 additions and 500 deletions

View File

@@ -2,7 +2,6 @@
use beacon_chain::attestation_verification::Error as AttnError;
use beacon_chain::builder::BeaconChainBuilder;
use beacon_chain::schema_change::migrate_schema;
use beacon_chain::test_utils::{
test_spec, AttestationStrategy, BeaconChainHarness, BlockStrategy, DiskHarnessType,
};
@@ -22,7 +21,6 @@ use std::collections::HashSet;
use std::convert::TryInto;
use std::sync::Arc;
use std::time::Duration;
use store::metadata::{SchemaVersion, CURRENT_SCHEMA_VERSION};
use store::{
iter::{BlockRootsIterator, StateRootsIterator},
HotColdDB, LevelDB, StoreConfig,
@@ -398,10 +396,9 @@ async fn forwards_iter_block_and_state_roots_until() {
check_finalization(&harness, num_blocks_produced);
check_split_slot(&harness, store.clone());
// The last restore point slot is the point at which the hybrid forwards iterator behaviour
// changes.
let last_restore_point_slot = store.get_latest_restore_point_slot();
assert!(last_restore_point_slot > 0);
// The split slot is the point at which the hybrid forwards iterator behaviour changes.
let split_slot = store.get_split_slot();
assert!(split_slot > 0);
let chain = &harness.chain;
let head_state = harness.get_current_state();
@@ -425,15 +422,12 @@ async fn forwards_iter_block_and_state_roots_until() {
}
};
let split_slot = store.get_split_slot();
assert!(split_slot > last_restore_point_slot);
test_range(Slot::new(0), last_restore_point_slot);
test_range(last_restore_point_slot, last_restore_point_slot);
test_range(last_restore_point_slot - 1, last_restore_point_slot);
test_range(Slot::new(0), last_restore_point_slot - 1);
test_range(Slot::new(0), split_slot);
test_range(last_restore_point_slot - 1, split_slot);
test_range(split_slot, split_slot);
test_range(split_slot - 1, split_slot);
test_range(Slot::new(0), split_slot - 1);
test_range(Slot::new(0), split_slot);
test_range(split_slot - 1, split_slot);
test_range(Slot::new(0), head_state.slot());
}
@@ -2496,6 +2490,9 @@ async fn revert_minority_fork_on_resume() {
// version is correct. This is the easiest schema test to write without historic versions of
// Lighthouse on-hand, but has the disadvantage that the min version needs to be adjusted manually
// as old downgrades are deprecated.
/* FIXME(sproul): broken until DB migration is implemented
use beacon_chain::schema_change::migrate_schema;
use store::metadata::{SchemaVersion, CURRENT_SCHEMA_VERSION};
#[tokio::test]
async fn schema_downgrade_to_min_version() {
let num_blocks_produced = E::slots_per_epoch() * 4;
@@ -2576,6 +2573,7 @@ async fn schema_downgrade_to_min_version() {
)
.expect_err("should not downgrade below minimum version");
}
*/
/// Checks that two chains are the same, for the purpose of these tests.
///

View File

@@ -10,9 +10,7 @@ use beacon_chain::{
};
use lazy_static::lazy_static;
use operation_pool::PersistedOperationPool;
use state_processing::{
per_slot_processing, per_slot_processing::Error as SlotProcessingError, EpochProcessingError,
};
use state_processing::{per_slot_processing, per_slot_processing::Error as SlotProcessingError};
use types::{
BeaconState, BeaconStateError, EthSpec, Hash256, Keypair, MinimalEthSpec, RelativeEpoch, Slot,
};
@@ -55,9 +53,7 @@ fn massive_skips() {
assert!(state.slot() > 1, "the state should skip at least one slot");
assert_eq!(
error,
SlotProcessingError::EpochProcessingError(EpochProcessingError::BeaconStateError(
BeaconStateError::InsufficientValidators
)),
SlotProcessingError::BeaconStateError(BeaconStateError::InsufficientValidators),
"should return error indicating that validators have been slashed out"
)
}