Skip to content

Commit f8d1b9a

Browse files
committed
fix: reset halt bit in testnet78 migration
1 parent 175b38f commit f8d1b9a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/bin/pd/src/migrate/testnet78.rs

+13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
//! Contains functions related to the migration script of Testnet78.
2+
use anyhow::Context;
23
use cnidarium::{Snapshot, StateDelta, Storage};
34
use futures::TryStreamExt as _;
45
use jmt::RootHash;
56
use penumbra_app::app::StateReadExt as _;
67
use penumbra_governance::StateReadExt as _;
8+
use penumbra_governance::StateWriteExt;
79
use penumbra_proto::{StateReadProto as _, StateWriteProto as _};
10+
use penumbra_sct::component::clock::EpochManager;
811
use penumbra_sct::component::clock::EpochRead as _;
912
use penumbra_stake::validator::Validator;
1013
use std::path::PathBuf;
@@ -79,6 +82,16 @@ pub async fn migrate(
7982
)
8083
};
8184
tracing::info!("completed migration steps");
85+
86+
// Set halt bit to 0, so chain can start again.
87+
let migrated_state = storage.latest_snapshot();
88+
let mut delta = StateDelta::new(migrated_state);
89+
delta.ready_to_start();
90+
delta.put_block_height(0u64);
91+
let _ = storage
92+
.commit_in_place(delta)
93+
.await
94+
.context("failed to reset halt bit")?;
8295
storage.release().await;
8396

8497
// The migration is complete, now we need to generate a genesis file. To do this, we need

0 commit comments

Comments
 (0)