mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 13:28:33 +00:00
Remove support for database migrations prior to schema version v22 (#7332)
Remove deprecated database migrations prior to v22 along with v22 migration specific code.
This commit is contained in:
@@ -3023,7 +3023,6 @@ async fn schema_downgrade_to_min_version() {
|
||||
.await;
|
||||
|
||||
let min_version = SchemaVersion(22);
|
||||
let genesis_state_root = Some(harness.chain.genesis_state_root);
|
||||
|
||||
// Save the slot clock so that the new harness doesn't revert in time.
|
||||
let slot_clock = harness.chain.slot_clock.clone();
|
||||
@@ -3036,22 +3035,12 @@ async fn schema_downgrade_to_min_version() {
|
||||
let store = get_store(&db_path);
|
||||
|
||||
// Downgrade.
|
||||
migrate_schema::<DiskHarnessType<E>>(
|
||||
store.clone(),
|
||||
genesis_state_root,
|
||||
CURRENT_SCHEMA_VERSION,
|
||||
min_version,
|
||||
)
|
||||
.expect("schema downgrade to minimum version should work");
|
||||
migrate_schema::<DiskHarnessType<E>>(store.clone(), CURRENT_SCHEMA_VERSION, min_version)
|
||||
.expect("schema downgrade to minimum version should work");
|
||||
|
||||
// Upgrade back.
|
||||
migrate_schema::<DiskHarnessType<E>>(
|
||||
store.clone(),
|
||||
genesis_state_root,
|
||||
min_version,
|
||||
CURRENT_SCHEMA_VERSION,
|
||||
)
|
||||
.expect("schema upgrade from minimum version should work");
|
||||
migrate_schema::<DiskHarnessType<E>>(store.clone(), min_version, CURRENT_SCHEMA_VERSION)
|
||||
.expect("schema upgrade from minimum version should work");
|
||||
|
||||
// Recreate the harness.
|
||||
let harness = BeaconChainHarness::builder(MinimalEthSpec)
|
||||
@@ -3069,13 +3058,8 @@ async fn schema_downgrade_to_min_version() {
|
||||
|
||||
// Check that downgrading beyond the minimum version fails (bound is *tight*).
|
||||
let min_version_sub_1 = SchemaVersion(min_version.as_u64().checked_sub(1).unwrap());
|
||||
migrate_schema::<DiskHarnessType<E>>(
|
||||
store.clone(),
|
||||
genesis_state_root,
|
||||
CURRENT_SCHEMA_VERSION,
|
||||
min_version_sub_1,
|
||||
)
|
||||
.expect_err("should not downgrade below minimum version");
|
||||
migrate_schema::<DiskHarnessType<E>>(store.clone(), CURRENT_SCHEMA_VERSION, min_version_sub_1)
|
||||
.expect_err("should not downgrade below minimum version");
|
||||
}
|
||||
|
||||
/// Check that blob pruning prunes blobs older than the data availability boundary.
|
||||
|
||||
Reference in New Issue
Block a user