Skip to content

Commit

Permalink
moving to zcash_unstable nu7
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-arte committed Jul 17, 2024
1 parent 396bd74 commit 1d17ea0
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 137 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- NOT_A_PUZZLE
- Orchard
- NU6
- NU7

include:
- target: Linux
Expand All @@ -36,6 +37,8 @@ jobs:
extra_flags: orchard
- state: NU6
rustflags: '--cfg zcash_unstable="nu6"'
- state: NU7
rustflags: '--cfg zcash_unstable="nu7"'

exclude:
- target: macOS
Expand Down
24 changes: 12 additions & 12 deletions components/zcash_protocol/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ impl Parameters for MainNetwork {
NetworkUpgrade::Nu5 => Some(BlockHeight(1_687_104)),
#[cfg(zcash_unstable = "nu6")]
NetworkUpgrade::Nu6 => Some(BlockHeight(1_687_106)),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ NetworkUpgrade::Nu7 => {
#[cfg(zcash_unstable = "nu7")] NetworkUpgrade::Nu7 => {
Some(BlockHeight(1_687_107))
}
#[cfg(zcash_unstable = "zfuture")]
Expand Down Expand Up @@ -389,7 +389,7 @@ impl Parameters for TestNetwork {
NetworkUpgrade::Nu5 => Some(BlockHeight(1_842_420)),
#[cfg(zcash_unstable = "nu6")]
NetworkUpgrade::Nu6 => None,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ NetworkUpgrade::Nu7 => {
#[cfg(zcash_unstable = "nu7")] NetworkUpgrade::Nu7 => {
Some(BlockHeight(1_842_421))
}
#[cfg(zcash_unstable = "zfuture")]
Expand Down Expand Up @@ -463,7 +463,7 @@ pub enum NetworkUpgrade {
/// The [Nu7] network upgrade.
///
/// [Nu7]: https://z.cash/upgrade/nu7/
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
Nu7,
/// The ZFUTURE network upgrade.
///
Expand All @@ -487,7 +487,7 @@ impl fmt::Display for NetworkUpgrade {
NetworkUpgrade::Nu5 => write!(f, "Nu5"),
#[cfg(zcash_unstable = "nu6")]
NetworkUpgrade::Nu6 => write!(f, "Nu6"),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ NetworkUpgrade::Nu7 => write!(f, "Nu7"),
#[cfg(zcash_unstable = "nu7")] NetworkUpgrade::Nu7 => write!(f, "Nu7"),
#[cfg(zcash_unstable = "zfuture")]
NetworkUpgrade::ZFuture => write!(f, "ZFUTURE"),
}
Expand All @@ -505,7 +505,7 @@ impl NetworkUpgrade {
NetworkUpgrade::Nu5 => BranchId::Nu5,
#[cfg(zcash_unstable = "nu6")]
NetworkUpgrade::Nu6 => BranchId::Nu6,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ NetworkUpgrade::Nu7 => BranchId::Nu7,
#[cfg(zcash_unstable = "nu7")] NetworkUpgrade::Nu7 => BranchId::Nu7,
#[cfg(zcash_unstable = "zfuture")]
NetworkUpgrade::ZFuture => BranchId::ZFuture,
}
Expand All @@ -525,7 +525,7 @@ const UPGRADES_IN_ORDER: &[NetworkUpgrade] = &[
NetworkUpgrade::Nu5,
#[cfg(zcash_unstable = "nu6")]
NetworkUpgrade::Nu6,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ NetworkUpgrade::Nu7,
#[cfg(zcash_unstable = "nu7")] NetworkUpgrade::Nu7,
];

/// The "grace period" defined in [ZIP 212].
Expand Down Expand Up @@ -566,7 +566,7 @@ pub enum BranchId {
#[cfg(zcash_unstable = "nu6")]
Nu6,
/// The consensus rules deployed by [`NetworkUpgrade::Nu7`].
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
Nu7,
/// Candidates for future consensus rules; this branch will never
/// activate on mainnet.
Expand All @@ -590,7 +590,7 @@ impl TryFrom<u32> for BranchId {
0xc2d6_d0b4 => Ok(BranchId::Nu5),
#[cfg(zcash_unstable = "nu6")]
0xc8e7_1055 => Ok(BranchId::Nu6),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ 0x7777_7777 => Ok(BranchId::Nu7),
#[cfg(zcash_unstable = "nu7")] 0x7777_7777 => Ok(BranchId::Nu7),
#[cfg(zcash_unstable = "zfuture")]
0xffff_ffff => Ok(BranchId::ZFuture),
_ => Err("Unknown consensus branch ID"),
Expand All @@ -610,7 +610,7 @@ impl From<BranchId> for u32 {
BranchId::Nu5 => 0xc2d6_d0b4,
#[cfg(zcash_unstable = "nu6")]
BranchId::Nu6 => 0xc8e7_1055,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ BranchId::Nu7 => 0x7777_7777,
#[cfg(zcash_unstable = "nu7")] BranchId::Nu7 => 0x7777_7777,
#[cfg(zcash_unstable = "zfuture")]
BranchId::ZFuture => 0xffff_ffff,
}
Expand Down Expand Up @@ -691,7 +691,7 @@ impl BranchId {
let upper = None;
(lower, upper)
}),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ BranchId::Nu7 => {
#[cfg(zcash_unstable = "nu7")] BranchId::Nu7 => {
params.activation_height(NetworkUpgrade::Nu7).map(|lower| {
#[cfg(zcash_unstable = "zfuture")]
let upper = params.activation_height(NetworkUpgrade::ZFuture);
Expand Down Expand Up @@ -730,7 +730,7 @@ pub mod testing {
BranchId::Nu5,
#[cfg(zcash_unstable = "nu6")]
BranchId::Nu6,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ BranchId::Nu7,
#[cfg(zcash_unstable = "nu7")] BranchId::Nu7,
#[cfg(zcash_unstable = "zfuture")]
BranchId::ZFuture,
])
Expand Down Expand Up @@ -824,7 +824,7 @@ mod tests {
BranchId::for_height(&MAIN_NETWORK, BlockHeight(1_687_104)),
BranchId::Nu5,
);
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
assert_eq!(
BranchId::for_height(&MAIN_NETWORK, BlockHeight(1_842_421)),
BranchId::Nu7,
Expand Down
20 changes: 10 additions & 10 deletions components/zcash_protocol/src/local_consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct LocalNetwork {
pub nu5: Option<BlockHeight>,
#[cfg(zcash_unstable = "nu6")]
pub nu6: Option<BlockHeight>,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ pub nu7: Option<BlockHeight>,
#[cfg(zcash_unstable = "nu7")] pub nu7: Option<BlockHeight>,
#[cfg(zcash_unstable = "zfuture")]
pub z_future: Option<BlockHeight>,
}
Expand All @@ -60,7 +60,7 @@ impl Parameters for LocalNetwork {
NetworkUpgrade::Nu5 => self.nu5,
#[cfg(zcash_unstable = "nu6")]
NetworkUpgrade::Nu6 => self.nu6,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ NetworkUpgrade::Nu7 => self.nu7,
#[cfg(zcash_unstable = "nu7")] NetworkUpgrade::Nu7 => self.nu7,
#[cfg(zcash_unstable = "zfuture")]
NetworkUpgrade::ZFuture => self.z_future,
}
Expand All @@ -85,7 +85,7 @@ mod tests {
let expected_nu5 = BlockHeight::from_u32(6);
#[cfg(zcash_unstable = "nu6")]
let expected_nu6 = BlockHeight::from_u32(7);
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ let expected_nu7 = BlockHeight::from_u32(8);
#[cfg(zcash_unstable = "nu7")] let expected_nu7 = BlockHeight::from_u32(8);
#[cfg(zcash_unstable = "zfuture")]
let expected_z_future = BlockHeight::from_u32(7);

Expand All @@ -98,7 +98,7 @@ mod tests {
nu5: Some(expected_nu5),
#[cfg(zcash_unstable = "nu6")]
nu6: Some(expected_nu6),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
nu7: Some(expected_nu7),
#[cfg(zcash_unstable = "zfuture")]
z_future: Some(expected_z_future),
Expand All @@ -112,7 +112,7 @@ mod tests {
assert!(regtest.is_nu_active(NetworkUpgrade::Nu5, expected_nu5));
#[cfg(zcash_unstable = "nu6")]
assert!(regtest.is_nu_active(NetworkUpgrade::Nu6, expected_nu6));
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
assert!(regtest.is_nu_active(NetworkUpgrade::Nu7, expected_nu7));
#[cfg(zcash_unstable = "zfuture")]
assert!(!regtest.is_nu_active(NetworkUpgrade::ZFuture, expected_nu5));
Expand All @@ -128,7 +128,7 @@ mod tests {
let expected_nu5 = BlockHeight::from_u32(6);
#[cfg(zcash_unstable = "nu6")]
let expected_nu6 = BlockHeight::from_u32(7);
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ let expected_nu7 = BlockHeight::from_u32(8);
#[cfg(zcash_unstable = "nu7")] let expected_nu7 = BlockHeight::from_u32(8);
#[cfg(zcash_unstable = "zfuture")]
let expected_z_future = BlockHeight::from_u32(7);

Expand All @@ -141,7 +141,7 @@ mod tests {
nu5: Some(expected_nu5),
#[cfg(zcash_unstable = "nu6")]
nu6: Some(expected_nu6),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
nu7: Some(expected_nu7),
#[cfg(zcash_unstable = "zfuture")]
z_future: Some(expected_z_future),
Expand Down Expand Up @@ -176,7 +176,7 @@ mod tests {
regtest.activation_height(NetworkUpgrade::Nu6),
Some(expected_nu6)
);
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
assert_eq!(
regtest.activation_height(NetworkUpgrade::Nu7),
Some(expected_nu7)
Expand All @@ -198,7 +198,7 @@ mod tests {
let expected_nu5 = BlockHeight::from_u32(6);
#[cfg(zcash_unstable = "nu6")]
let expected_nu6 = BlockHeight::from_u32(7);
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */ let expected_nu7 = BlockHeight::from_u32(8);
#[cfg(zcash_unstable = "nu7")] let expected_nu7 = BlockHeight::from_u32(8);
#[cfg(zcash_unstable = "zfuture")]
let expected_z_future = BlockHeight::from_u32(7);

Expand All @@ -211,7 +211,7 @@ mod tests {
nu5: Some(expected_nu5),
#[cfg(zcash_unstable = "nu6")]
nu6: Some(expected_nu6),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
nu7: Some(expected_nu7),
#[cfg(zcash_unstable = "zfuture")]
z_future: Some(expected_z_future),
Expand Down
2 changes: 1 addition & 1 deletion zcash_client_sqlite/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl TestBuilder<()> {
nu5: Some(BlockHeight::from_u32(100_000)),
#[cfg(zcash_unstable = "nu6")]
nu6: None,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
nu7: Some(BlockHeight::from_u32(100_000)),
#[cfg(zcash_unstable = "zfuture")]
z_future: None,
Expand Down
4 changes: 2 additions & 2 deletions zcash_client_sqlite/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1490,9 +1490,9 @@ pub(crate) fn get_transaction<P: Parameters>(
tx_data.sprout_bundle().cloned(),
tx_data.sapling_bundle().cloned(),
tx_data.orchard_bundle().cloned(),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
tx_data.orchard_zsa_bundle().cloned(),
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
tx_data.issue_bundle().cloned(),
)
.freeze()
Expand Down
4 changes: 2 additions & 2 deletions zcash_client_sqlite/src/wallet/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,9 +1275,9 @@ mod tests {
None,
None,
None,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
None,
#[cfg(zcash_unstable = "nu6")] /* TODO nu7 */
#[cfg(zcash_unstable = "nu7")]
None,
)
.freeze()
Expand Down
Loading

0 comments on commit 1d17ea0

Please sign in to comment.