File tree 1 file changed +13
-0
lines changed
crates/bin/pd/src/migrate
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
//! Contains functions related to the migration script of Testnet78.
2
+ use anyhow:: Context ;
2
3
use cnidarium:: { Snapshot , StateDelta , Storage } ;
3
4
use futures:: TryStreamExt as _;
4
5
use jmt:: RootHash ;
5
6
use penumbra_app:: app:: StateReadExt as _;
6
7
use penumbra_governance:: StateReadExt as _;
8
+ use penumbra_governance:: StateWriteExt ;
7
9
use penumbra_proto:: { StateReadProto as _, StateWriteProto as _} ;
10
+ use penumbra_sct:: component:: clock:: EpochManager ;
8
11
use penumbra_sct:: component:: clock:: EpochRead as _;
9
12
use penumbra_stake:: validator:: Validator ;
10
13
use std:: path:: PathBuf ;
@@ -79,6 +82,16 @@ pub async fn migrate(
79
82
)
80
83
} ;
81
84
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" ) ?;
82
95
storage. release ( ) . await ;
83
96
84
97
// The migration is complete, now we need to generate a genesis file. To do this, we need
You can’t perform that action at this time.
0 commit comments