@@ -10,6 +10,7 @@ mod testnet72;
10
10
mod testnet74;
11
11
mod testnet76;
12
12
mod testnet77;
13
+ mod testnet78;
13
14
14
15
use anyhow:: { ensure, Context } ;
15
16
use penumbra_governance:: StateReadExt ;
@@ -47,6 +48,9 @@ pub enum Migration {
47
48
/// Testnet-77 migration:
48
49
/// - Reset the halt bit
49
50
Testnet77 ,
51
+ /// Testnet-78 migration:
52
+ /// - Truncate various user-supplied `String` fields to a maximum length.
53
+ Testnet78 ,
50
54
}
51
55
52
56
impl Migration {
@@ -72,30 +76,22 @@ impl Migration {
72
76
) ;
73
77
tracing:: info!( "started migration" ) ;
74
78
79
+ // If this is `ReadyToStart`, we need to reset the halt bit and return early.
80
+ if let Migration :: ReadyToStart = self {
81
+ reset_halt_bit:: migrate ( storage, pd_home, genesis_start) . await ?;
82
+ return Ok ( ( ) ) ;
83
+ }
84
+
75
85
match self {
76
- Migration :: ReadyToStart => {
77
- reset_halt_bit:: migrate ( storage, pd_home, genesis_start) . await ?;
78
- return Ok ( ( ) ) ;
79
- }
80
86
Migration :: SimpleMigration => {
81
87
simple:: migrate ( storage, pd_home. clone ( ) , genesis_start) . await ?
82
88
}
83
89
84
- Migration :: Testnet72 => {
85
- testnet72:: migrate ( storage, pd_home. clone ( ) , genesis_start) . await ?
86
- }
87
-
88
- Migration :: Testnet74 => {
89
- testnet74:: migrate ( storage, pd_home. clone ( ) , genesis_start) . await ?
90
+ Migration :: Testnet78 => {
91
+ testnet78:: migrate ( storage, pd_home. clone ( ) , genesis_start) . await ?
90
92
}
91
-
92
- Migration :: Testnet76 => {
93
- testnet76:: migrate ( storage, pd_home. clone ( ) , genesis_start) . await ?
94
- }
95
- Migration :: Testnet77 => {
96
- testnet77:: migrate ( storage, pd_home. clone ( ) , genesis_start) . await ?
97
- }
98
- } ;
93
+ _ => unreachable ! ( ) ,
94
+ }
99
95
100
96
if let Some ( comet_home) = comet_home {
101
97
// TODO avoid this when refactoring to clean up migrations
0 commit comments