-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZSA integration (step 2): Add Network Upgrade 7 (Nu7) support to Zebra #15
base: zsa-integration-zsadeps
Are you sure you want to change the base?
Changes from all commits
054e655
50190a3
2d3845d
2d23d6b
7d79143
53c65b6
d659628
c238847
2c13ae9
5a839c6
367a14b
f425747
831c847
ecaf98d
7d11159
6a0196e
faec84b
1526276
509d525
9e94dc5
0bcf59a
12ade98
ab1838d
0a8cfe0
bb1395c
1b8e9e9
d8964e7
e8abddd
23d9e77
e0adb4c
0daf0ce
24f5e85
d0ecf96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -15,7 +15,7 @@ use hex::{FromHex, ToHex}; | |||||
use proptest_derive::Arbitrary; | ||||||
|
||||||
/// A list of network upgrades in the order that they must be activated. | ||||||
pub const NETWORK_UPGRADES_IN_ORDER: [NetworkUpgrade; 9] = [ | ||||||
pub const NETWORK_UPGRADES_IN_ORDER: [NetworkUpgrade; 10] = [ | ||||||
Genesis, | ||||||
BeforeOverwinter, | ||||||
Overwinter, | ||||||
|
@@ -25,6 +25,7 @@ pub const NETWORK_UPGRADES_IN_ORDER: [NetworkUpgrade; 9] = [ | |||||
Canopy, | ||||||
Nu5, | ||||||
Nu6, | ||||||
Nu7, | ||||||
]; | ||||||
|
||||||
/// A Zcash network upgrade. | ||||||
|
@@ -61,6 +62,9 @@ pub enum NetworkUpgrade { | |||||
/// The Zcash protocol after the NU6 upgrade. | ||||||
#[serde(rename = "NU6")] | ||||||
Nu6, | ||||||
/// The Zcash protocol after the NU7 upgrade. | ||||||
#[serde(rename = "NU7")] | ||||||
Nu7, | ||||||
} | ||||||
|
||||||
impl fmt::Display for NetworkUpgrade { | ||||||
|
@@ -90,6 +94,8 @@ pub(super) const MAINNET_ACTIVATION_HEIGHTS: &[(block::Height, NetworkUpgrade)] | |||||
(block::Height(1_046_400), Canopy), | ||||||
(block::Height(1_687_104), Nu5), | ||||||
(block::Height(2_726_400), Nu6), | ||||||
// FIXME: TODO: Add NU7 with a correct value | ||||||
// (block::Height(2_726_401), Nu7), | ||||||
]; | ||||||
|
||||||
/// Fake mainnet network upgrade activation heights, used in tests. | ||||||
|
@@ -104,6 +110,7 @@ const FAKE_MAINNET_ACTIVATION_HEIGHTS: &[(block::Height, NetworkUpgrade)] = &[ | |||||
(block::Height(30), Canopy), | ||||||
(block::Height(35), Nu5), | ||||||
(block::Height(40), Nu6), | ||||||
(block::Height(45), Nu7), | ||||||
]; | ||||||
|
||||||
/// Testnet network upgrade activation heights. | ||||||
|
@@ -126,6 +133,8 @@ pub(super) const TESTNET_ACTIVATION_HEIGHTS: &[(block::Height, NetworkUpgrade)] | |||||
(block::Height(1_028_500), Canopy), | ||||||
(block::Height(1_842_420), Nu5), | ||||||
(block::Height(2_976_000), Nu6), | ||||||
// FIXME: TODO: Set a correct value for NU7 | ||||||
(block::Height(2_942_001), Nu7), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to defer setting this at all until the release PR for a version that deploys NU7 on Testnet and to set this in the configuration until then.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or consider putting this under the nu7 flag : There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Link to this comment copied to #37 |
||||||
]; | ||||||
|
||||||
/// Fake testnet network upgrade activation heights, used in tests. | ||||||
|
@@ -140,6 +149,7 @@ const FAKE_TESTNET_ACTIVATION_HEIGHTS: &[(block::Height, NetworkUpgrade)] = &[ | |||||
(block::Height(30), Canopy), | ||||||
(block::Height(35), Nu5), | ||||||
(block::Height(40), Nu6), | ||||||
(block::Height(45), Nu7), | ||||||
]; | ||||||
|
||||||
/// The Consensus Branch Id, used to bind transactions and blocks to a | ||||||
|
@@ -216,6 +226,8 @@ pub(crate) const CONSENSUS_BRANCH_IDS: &[(NetworkUpgrade, ConsensusBranchId)] = | |||||
(Canopy, ConsensusBranchId(0xe9ff75a6)), | ||||||
(Nu5, ConsensusBranchId(0xc2d6d0b4)), | ||||||
(Nu6, ConsensusBranchId(0xc8e71055)), | ||||||
// FIXME: use a proper value below | ||||||
(Nu7, ConsensusBranchId(0xc8e71056)), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zebra will panic if this doesn't match the one in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, let's add a random number and the flag There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opened a PR adding a draft NU7 deployment ZIP with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Link to this comment copied to #37 |
||||||
]; | ||||||
|
||||||
/// The target block spacing before Blossom. | ||||||
|
@@ -332,7 +344,8 @@ impl NetworkUpgrade { | |||||
Heartwood => Some(Canopy), | ||||||
Canopy => Some(Nu5), | ||||||
Nu5 => Some(Nu6), | ||||||
Nu6 => None, | ||||||
Nu6 => Some(Nu7), | ||||||
Nu7 => None, | ||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -409,7 +422,9 @@ impl NetworkUpgrade { | |||||
pub fn target_spacing(&self) -> Duration { | ||||||
let spacing_seconds = match self { | ||||||
Genesis | BeforeOverwinter | Overwinter | Sapling => PRE_BLOSSOM_POW_TARGET_SPACING, | ||||||
Blossom | Heartwood | Canopy | Nu5 | Nu6 => POST_BLOSSOM_POW_TARGET_SPACING.into(), | ||||||
Blossom | Heartwood | Canopy | Nu5 | Nu6 | Nu7 => { | ||||||
POST_BLOSSOM_POW_TARGET_SPACING.into() | ||||||
} | ||||||
}; | ||||||
|
||||||
Duration::seconds(spacing_seconds) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -106,6 +106,9 @@ impl Version { | |||||||||
(Mainnet, Nu5) => 170_100, | ||||||||||
(Testnet(params), Nu6) if params.is_default_testnet() => 170_110, | ||||||||||
(Mainnet, Nu6) => 170_120, | ||||||||||
// FIXME: use proper values for Nu7 | ||||||||||
(Testnet(params), Nu7) if params.is_default_testnet() => 170_111, | ||||||||||
(Mainnet, Nu7) => 170_121, | ||||||||||
Comment on lines
+110
to
+111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only requirement here is that there should be some versions between the prior min specified protocol versions and new ones in case something goes wrong with the prior NU deployment. This PR could also update the Update:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Link to this comment copied to #37 |
||||||||||
|
||||||||||
// It should be fine to reject peers with earlier network protocol versions on custom testnets for now. | ||||||||||
(Testnet(_), _) => CURRENT_NETWORK_PROTOCOL_VERSION.0, | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
source: zebra-rpc/src/methods/tests/snapshot.rs | ||
assertion_line: 562 | ||
expression: info | ||
--- | ||
{ | ||
|
@@ -69,6 +70,11 @@ expression: info | |
"name": "NU6", | ||
"activationheight": 2976000, | ||
"status": "pending" | ||
}, | ||
"c8e71056": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same for a new random string There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Link to this comment copied to #37 |
||
"name": "NU7", | ||
"activationheight": 2942001, | ||
"status": "pending" | ||
} | ||
}, | ||
"consensus": { | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -73,6 +73,8 @@ Heartwood = 903_800 | |||
Canopy = 1_028_500 | ||||
NU5 = 1_842_420 | ||||
NU6 = 2_000_000 | ||||
# FIXME: Use a proper value for NU7. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This value is already okay. These test configs are just meant to ensure that valid past configs can still be parsed whenever the config is changed and, secondarily, to provide examples.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Link to this comment copied to #37 |
||||
NU7 = 2_000_001 | ||||
|
||||
[network.testnet_parameters.pre_nu6_funding_streams.height_range] | ||||
start = 0 | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add an estimated value under the flag
#[cfg(zcash_unstable = "nu6" /* TODO nu7 */ )]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to this comment copied to #37