Tweak migrations

This commit is contained in:
Michael Sproul
2022-07-18 18:21:42 +10:00
parent f0fa5a1618
commit 14e62928c4
2 changed files with 6 additions and 4 deletions

View File

@@ -131,8 +131,10 @@ pub fn migrate_schema<T: BeaconChainTypes>(
migration_schema_v9::downgrade_from_v9::<T>(db.clone(), log)?;
db.store_schema_version(to)
}
// Upgrade from v9 to v11 to store richer metadata in the attestation op pool.
(SchemaVersion(9), SchemaVersion(11)) => {
// FIXME(sproul): stub for Sean's v10 migration
(SchemaVersion(9), SchemaVersion(10)) => db.store_schema_version(to),
// Upgrade from v10 to v11 to store richer metadata in the attestation op pool.
(SchemaVersion(10), SchemaVersion(11)) => {
let ops = migration_schema_v11::upgrade_to_v11::<T>(db.clone(), log)?;
db.store_schema_version_atomically(to, ops)
}

View File

@@ -1,6 +1,6 @@
use crate::beacon_chain::{BeaconChainTypes, OP_POOL_DB_KEY};
use operation_pool::{PersistedOperationPool, PersistedOperationPoolV11, PersistedOperationPoolV5};
use slog::{debug, Logger};
use slog::{debug, info, Logger};
use std::sync::Arc;
use store::{Error, HotColdDB, KeyValueStoreOp, StoreItem};
@@ -47,7 +47,7 @@ pub fn downgrade_from_v11<T: BeaconChainTypes>(
return Ok(vec![]);
};
debug!(
info!(
log,
"Dropping attestations from pool";
"count" => v11.attestations.len(),