@@ -93,10 +93,7 @@ impl NetworkUpgrade {
9393 testnet_activation_height : 3536500 ,
9494 } ,
9595 // NU6.2: emergency hard fork re-enabling Orchard with the corrected circuit
96- // after GHSA-ghc3-g8w4-whf9. Values match ZcashFoundation/zebra
97- // `network_upgrade.rs` (CONSENSUS_BRANCH_IDS) / `constants::activation_heights`.
98- // Not yet in the pinned zebra-chain 7.0 dependency, so the parity tests below
99- // skip Nu6_2 and it is guarded by `test_nu6_2_constants` until the dep is bumped (T1-3519).
96+ // after GHSA-ghc3-g8w4-whf9.
10097 NetworkUpgrade :: Nu6_2 => UpgradeParams {
10198 branch_id : 0x5437f330 ,
10299 mainnet_activation_height : 3364600 ,
@@ -168,22 +165,6 @@ mod tests {
168165 }
169166 }
170167
171- /// NU6.2 is not yet in the pinned zebra-chain dependency (see T1-3519), so it is
172- /// excluded from the parity tests below. Guard its hardcoded constants here instead.
173- /// Source: ZcashFoundation/zebra network_upgrade.rs + constants::activation_heights.
174- #[ test]
175- fn test_nu6_2_constants ( ) {
176- assert_eq ! ( NetworkUpgrade :: Nu6_2 . branch_id( ) , 0x5437f330 ) ;
177- assert_eq ! ( NetworkUpgrade :: Nu6_2 . mainnet_activation_height( ) , 3_364_600 ) ;
178- assert_eq ! ( NetworkUpgrade :: Nu6_2 . testnet_activation_height( ) , 4_052_000 ) ;
179- // Heights at/after activation resolve to NU6.2; the block before stays NU6.1.
180- assert_eq ! ( branch_id_for_height( 3_364_600 , true ) , Some ( 0x5437f330 ) ) ;
181- assert_eq ! (
182- branch_id_for_height( 3_364_599 , true ) ,
183- Some ( NetworkUpgrade :: Nu6_1 . branch_id( ) )
184- ) ;
185- }
186-
187168 /// Tests that verify our constants match zebra-chain crate.
188169 /// These tests are exhaustive - they verify ALL upgrades in zebra-chain
189170 /// and will fail if we're missing any.
@@ -195,11 +176,9 @@ mod tests {
195176 } ;
196177
197178 /// Map our NetworkUpgrade to zebra-chain's NetworkUpgrade.
198- /// Returns `None` for upgrades not yet present in the pinned zebra-chain
199- /// dependency (currently NU6.2 — see T1-3519). The match is otherwise exhaustive,
200- /// so a new upgrade added here without a mapping will fail to compile.
201- fn to_zebra_upgrade ( upgrade : NetworkUpgrade ) -> Option < ZebraNetworkUpgrade > {
202- Some ( match upgrade {
179+ /// This match is exhaustive — a new upgrade added here without a mapping will fail to compile.
180+ fn to_zebra_upgrade ( upgrade : NetworkUpgrade ) -> ZebraNetworkUpgrade {
181+ match upgrade {
203182 NetworkUpgrade :: Overwinter => ZebraNetworkUpgrade :: Overwinter ,
204183 NetworkUpgrade :: Sapling => ZebraNetworkUpgrade :: Sapling ,
205184 NetworkUpgrade :: Blossom => ZebraNetworkUpgrade :: Blossom ,
@@ -208,9 +187,8 @@ mod tests {
208187 NetworkUpgrade :: Nu5 => ZebraNetworkUpgrade :: Nu5 ,
209188 NetworkUpgrade :: Nu6 => ZebraNetworkUpgrade :: Nu6 ,
210189 NetworkUpgrade :: Nu6_1 => ZebraNetworkUpgrade :: Nu6_1 ,
211- // NU6.2 is not in pinned zebra-chain 7.0; validated by test_nu6_2_constants.
212- NetworkUpgrade :: Nu6_2 => return None ,
213- } )
190+ NetworkUpgrade :: Nu6_2 => ZebraNetworkUpgrade :: Nu6_2 ,
191+ }
214192 }
215193
216194 /// Map zebra-chain's NetworkUpgrade to ours.
@@ -227,6 +205,7 @@ mod tests {
227205 ZebraNetworkUpgrade :: Nu5 => Some ( NetworkUpgrade :: Nu5 ) ,
228206 ZebraNetworkUpgrade :: Nu6 => Some ( NetworkUpgrade :: Nu6 ) ,
229207 ZebraNetworkUpgrade :: Nu6_1 => Some ( NetworkUpgrade :: Nu6_1 ) ,
208+ ZebraNetworkUpgrade :: Nu6_2 => Some ( NetworkUpgrade :: Nu6_2 ) ,
230209 #[ cfg( any( test, feature = "zebra-test" ) ) ]
231210 ZebraNetworkUpgrade :: Nu7 => None ,
232211 #[ cfg( zcash_unstable = "zfuture" ) ]
@@ -263,18 +242,15 @@ mod tests {
263242 // Verify round-trip (zebra-known upgrades always map back to Some)
264243 assert_eq ! (
265244 to_zebra_upgrade( our_upgrade) ,
266- Some ( zebra_upgrade) ,
245+ zebra_upgrade,
267246 "Round-trip failed for {:?}" ,
268247 zebra_upgrade
269248 ) ;
270249 }
271250
272251 // Verify every upgrade in our ALL list maps to zebra.
273- // NU6.2 is not yet in the pinned zebra-chain (T1-3519), so it is skipped here.
274252 for & our_upgrade in NetworkUpgrade :: ALL {
275- let Some ( zebra_upgrade) = to_zebra_upgrade ( our_upgrade) else {
276- continue ;
277- } ;
253+ let zebra_upgrade = to_zebra_upgrade ( our_upgrade) ;
278254 assert ! (
279255 zebra_upgrade. branch_id( ) . is_some( ) ,
280256 "{:?} should have a branch ID" ,
@@ -286,9 +262,7 @@ mod tests {
286262 #[ test]
287263 fn test_branch_ids_match_zebra ( ) {
288264 for & upgrade in NetworkUpgrade :: ALL {
289- let Some ( zebra_upgrade) = to_zebra_upgrade ( upgrade) else {
290- continue ; // NU6.2 not in pinned zebra-chain (T1-3519)
291- } ;
265+ let zebra_upgrade = to_zebra_upgrade ( upgrade) ;
292266 let expected = zebra_upgrade
293267 . branch_id ( )
294268 . map ( u32:: from)
@@ -309,9 +283,7 @@ mod tests {
309283 fn test_mainnet_heights_match_zebra ( ) {
310284 let network = ZebraNetwork :: Mainnet ;
311285 for & upgrade in NetworkUpgrade :: ALL {
312- let Some ( zebra_upgrade) = to_zebra_upgrade ( upgrade) else {
313- continue ; // NU6.2 not in pinned zebra-chain (T1-3519)
314- } ;
286+ let zebra_upgrade = to_zebra_upgrade ( upgrade) ;
315287 let expected = zebra_upgrade
316288 . activation_height ( & network)
317289 . map ( |h| h. 0 )
@@ -332,9 +304,7 @@ mod tests {
332304 fn test_testnet_heights_match_zebra ( ) {
333305 let network = ZebraNetwork :: new_default_testnet ( ) ;
334306 for & upgrade in NetworkUpgrade :: ALL {
335- let Some ( zebra_upgrade) = to_zebra_upgrade ( upgrade) else {
336- continue ; // NU6.2 not in pinned zebra-chain (T1-3519)
337- } ;
307+ let zebra_upgrade = to_zebra_upgrade ( upgrade) ;
338308 let expected = zebra_upgrade
339309 . activation_height ( & network)
340310 . map ( |h| h. 0 )
0 commit comments