From 089905aefbbb6d4b215ce9611ae5aecb3672f737 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 24 Sep 2024 16:15:04 +0000 Subject: [PATCH] zcash_protocol: Set the public mainnet activation height for NU6 --- components/zcash_protocol/CHANGELOG.md | 1 + components/zcash_protocol/src/consensus.rs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/zcash_protocol/CHANGELOG.md b/components/zcash_protocol/CHANGELOG.md index e2e99084f..207db86e8 100644 --- a/components/zcash_protocol/CHANGELOG.md +++ b/components/zcash_protocol/CHANGELOG.md @@ -14,6 +14,7 @@ and this library adheres to Rust's notion of height from another yields the delta between them. ### Changed +- Mainnet activation height has been set for `consensus::BranchId::Nu6`. - Adding a delta to a `BlockHeight` now uses saturating addition. - Subtracting a delta to a `BlockHeight` now uses saturating subtraction. diff --git a/components/zcash_protocol/src/consensus.rs b/components/zcash_protocol/src/consensus.rs index 43a1b6f86..66de608b7 100644 --- a/components/zcash_protocol/src/consensus.rs +++ b/components/zcash_protocol/src/consensus.rs @@ -342,7 +342,7 @@ impl Parameters for MainNetwork { NetworkUpgrade::Heartwood => Some(BlockHeight(903_000)), NetworkUpgrade::Canopy => Some(BlockHeight(1_046_400)), NetworkUpgrade::Nu5 => Some(BlockHeight(1_687_104)), - NetworkUpgrade::Nu6 => None, + NetworkUpgrade::Nu6 => Some(BlockHeight(2_726_400)), #[cfg(zcash_unstable = "zfuture")] NetworkUpgrade::ZFuture => None, } @@ -769,8 +769,16 @@ mod tests { BranchId::Nu5, ); assert_eq!( - BranchId::for_height(&MAIN_NETWORK, BlockHeight(5_000_000)), + BranchId::for_height(&MAIN_NETWORK, BlockHeight(2_726_399)), BranchId::Nu5, ); + assert_eq!( + BranchId::for_height(&MAIN_NETWORK, BlockHeight(2_726_400)), + BranchId::Nu6, + ); + assert_eq!( + BranchId::for_height(&MAIN_NETWORK, BlockHeight(5_000_000)), + BranchId::Nu6, + ); } }