diff --git a/crates/bin/pd/src/migrate.rs b/crates/bin/pd/src/migrate.rs index 47d4d87720..c38b57e328 100644 --- a/crates/bin/pd/src/migrate.rs +++ b/crates/bin/pd/src/migrate.rs @@ -8,6 +8,7 @@ mod reset_halt_bit; mod simple; mod testnet72; mod testnet74; +mod testnet76; use anyhow::{ensure, Context}; use penumbra_governance::StateReadExt; @@ -38,6 +39,9 @@ pub enum Migration { /// - Update arb executions to include the amount of filled input in the output /// - Add `AuctionParameters` to the consensus state Testnet74, + /// Testnet-76 migration: + /// - Heal the auction component's VCB tally. + Testnet76, } impl Migration { @@ -87,6 +91,9 @@ impl Migration { Migration::Testnet74 => { testnet74::migrate(storage, pd_home.clone(), genesis_start).await? } + Migration::Testnet76 => { + testnet76::migrate(storage, pd_home.clone(), genesis_start).await? + } }; if let Some(comet_home) = comet_home { diff --git a/crates/bin/pd/src/migrate/testnet76.rs b/crates/bin/pd/src/migrate/testnet76.rs index c8ed3188c3..643757c90f 100644 --- a/crates/bin/pd/src/migrate/testnet76.rs +++ b/crates/bin/pd/src/migrate/testnet76.rs @@ -66,12 +66,11 @@ async fn heal_auction_vcb(delta: &mut StateDelta) -> anyhow::Result<() /// - Reconstruct a correct VCB balance for the auction component. #[instrument(skip_all)] pub async fn migrate( + storage: Storage, path_to_export: PathBuf, genesis_start: Option, ) -> anyhow::Result<()> { // Setup: - let rocksdb_dir = path_to_export.join("rocksdb"); - let storage = Storage::load(rocksdb_dir.clone(), SUBSTORE_PREFIXES.to_vec()).await?; let export_state = storage.latest_snapshot(); let root_hash = export_state.root_hash().await.expect("can get root hash"); let pre_upgrade_root_hash: RootHash = root_hash.into(); @@ -101,8 +100,9 @@ pub async fn migrate( }; tracing::info!(?post_upgrade_root_hash, "post-upgrade root hash"); - storage.release().await; + + let rocksdb_dir = path_to_export.join("rocksdb"); let storage = Storage::load(rocksdb_dir, SUBSTORE_PREFIXES.to_vec()).await?; let migrated_state = storage.latest_snapshot();