Skip to content
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

add(consensus): Adds disable_pow and genesis_hash fields, converts equihash::Solution to an enum #8421

Merged
merged 69 commits into from
Apr 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
9db4762
minor cleanup and rename
arya2 Mar 20, 2024
4b86bd6
Adds an empty NetworkParameters struct to Network::Testnet variant, u…
arya2 Mar 20, 2024
7533e2f
Updates tests
arya2 Mar 20, 2024
06cf947
Adds `NetworkKind` and uses it instead of `Network` in `HistoryTreePa…
arya2 Mar 22, 2024
4900a20
Adds a [network.testnet_parameters] section to the config, uses `Netw…
arya2 Mar 22, 2024
cb8726b
Applies some suggestions from code review
arya2 Apr 1, 2024
d5a807a
Applies suggestions from code review
arya2 Apr 2, 2024
d108ec6
returns b58 prefix constants directly to remove From<NetworkKind> imp…
arya2 Apr 2, 2024
574b1f9
Applies more suggestions from code review.
arya2 Apr 2, 2024
05e41a2
moves conversions to zcash_primitives::consensus::Network to where th…
arya2 Apr 2, 2024
fd3d505
Apply suggestions from code review
arya2 Apr 11, 2024
f04b94b
rename `network` variables and method names typed as NetworkKind to `…
arya2 Apr 11, 2024
ea2d001
use only test block heights for the network associated with them
arya2 Apr 11, 2024
86cd919
Applies more suggestions from code review.
arya2 Apr 11, 2024
365b58e
Rename `NetworkParameters` to `Parameters` and move it a new `testnet…
arya2 Apr 11, 2024
eca7f6b
Merge branch 'main' into network-params
arya2 Apr 11, 2024
60248e3
adds activation heights field
arya2 Apr 2, 2024
b9bdf05
updates stored test config, adds a quicker test for checking that sto…
arya2 Apr 3, 2024
ad4e7dc
implement Parameters for Network
arya2 Apr 3, 2024
4347a80
Passes &Network directly instead of converting to zp_consensus::Netwo…
arya2 Apr 3, 2024
080affd
fixes a bad merge (removes a network conversion in zcash_note_encrypt…
arya2 Apr 11, 2024
2493e7e
Adds a test for the Parameters impl for zebra_chain::Network
arya2 Apr 11, 2024
997e265
fixes doc links
arya2 Apr 11, 2024
93c7a58
- Makes the `activation_heights` config field optional by adding a #[…
arya2 Apr 12, 2024
0fd4158
small refactor of activation_heights() method
arya2 Apr 12, 2024
3952caa
check that activation heights are in the right order
arya2 Apr 12, 2024
e697d36
Updates `NetworkUpgrade::activation_height()` to return the height of…
arya2 Apr 12, 2024
325a6c6
checks that the miner address is of TestnetKind on Regtest and update…
arya2 Apr 12, 2024
f724c01
Adds a DNetworkUpgradeActivationHeights struct for better control ove…
arya2 Apr 12, 2024
a37510a
moves all ordered network upgrades to a constant, adds a no_duplicate…
arya2 Apr 12, 2024
0abe873
panics if any network upgrades are configured to activate at Height(0…
arya2 Apr 12, 2024
1dfad53
Simplifies the `ParametersBuilder::activation_heights()` method and r…
arya2 Apr 12, 2024
868535b
Merge branch 'main' into activ-heights-param-impl
arya2 Apr 17, 2024
0b835f1
Adds Sapling HRPs as fields on testnet params. (#8398)
arya2 Apr 17, 2024
fb2d13a
Applies suggestions from code review.
arya2 Apr 17, 2024
fea2162
Update zebra-chain/src/parameters/network_upgrade.rs
arya2 Apr 18, 2024
a94dcab
Adds `network_name` field and accessor method on `Parameters`, uses i…
arya2 Apr 18, 2024
1173faf
Removes unnecessary `.filter()`
arya2 Apr 18, 2024
1608472
adds constraints on valid network names and a test
arya2 Apr 18, 2024
08f0838
adds config field for setting network name, adds "with_" prefix to Pa…
arya2 Apr 18, 2024
0e97b53
Adds `MainnetKind`, `TestnetKind`, and `RegtestKind` to reserved netw…
arya2 Apr 18, 2024
a842c12
updates stored test configs and fixes `network_name()` docs
arya2 Apr 18, 2024
c79e06f
Merge remote-tracking branch 'origin/main' into params-network-name
arya2 Apr 19, 2024
6e29727
Adds a `new_regtest()` method on `Network` and `testnet::Parameters`,…
arya2 Apr 18, 2024
32d0758
Updates `activates_network_upgrades_correctly` test to check Regtest …
arya2 Apr 18, 2024
e816c66
Refactors if-let & match statement into general match statement, remo…
arya2 Apr 18, 2024
32e4fbb
Removes outdated TODO
arya2 Apr 18, 2024
63623ae
Restores `testnet_parameters` section of the latest stored config.
arya2 Apr 18, 2024
d871590
Adds `with_sapling_hrps()` method and uses it to set the Regtest HRPs…
arya2 Apr 18, 2024
4671efe
Checks that default Mainnet/Testnet/Regtest Sapling HRPs pass validat…
arya2 Apr 18, 2024
9b41cba
Uses the correct constant in test
arya2 Apr 18, 2024
b38dbfd
Adds `is_regtest()` methods
arya2 Apr 19, 2024
a8b4e27
Adds genesis hash methods and fields to `testnet::Parameters` and its…
arya2 Apr 19, 2024
97b43cb
Copies Regtest genesis block from zcashd
arya2 Apr 19, 2024
c30537d
moves genesis hash check to Network.checkpoint_list()
arya2 Apr 19, 2024
5690d4e
Checks the first line in the checkpoint list instead of the first ite…
arya2 Apr 19, 2024
336c827
Checks that there is _some_ genesis block in the checkpoints list in …
arya2 Apr 19, 2024
bcc127b
Adds a doc comment to `ParametersBuilder::default()`
arya2 Apr 19, 2024
69d5d75
Adds a `disable_pow` field and skips checking proof of work if it's true
arya2 Apr 20, 2024
6633622
Makes `equihash::Solution` an enum to support Regtest solutions, adds…
arya2 Apr 20, 2024
d4f6a0e
use genesis_hash as first checkpoint when checkpoints are missing for…
arya2 Apr 22, 2024
0f91dd0
Applies suggestions from code review.
arya2 Apr 23, 2024
479b0b2
Reverts changes to `activation_height()` method
arya2 Apr 23, 2024
b3db5b0
Avoids panic in test
arya2 Apr 23, 2024
b7957e9
Merge remote-tracking branch 'origin/main' into params-new-regtest
arya2 Apr 24, 2024
13d59ad
Updates test docs
arya2 Apr 24, 2024
3b5a7f5
drop custom panic hooks after expected panics
arya2 Apr 24, 2024
c91f60d
Merge branch 'params-new-regtest' into params-genesis-hash
arya2 Apr 24, 2024
3b94175
Merge branch 'main' into params-genesis-hash
arya2 Apr 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions zebra-chain/src/history_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,15 @@ impl HistoryTree {
sapling_root: &sapling::tree::Root,
orchard_root: &orchard::tree::Root,
) -> Result<(), HistoryTreeError> {
let heartwood_height = NetworkUpgrade::Heartwood
.activation_height(network)
.expect("Heartwood height is known");
let Some(heartwood_height) = NetworkUpgrade::Heartwood.activation_height(network) else {
assert!(
self.0.is_none(),
"history tree must not exist pre-Heartwood"
);

return Ok(());
};
upbqdn marked this conversation as resolved.
Show resolved Hide resolved

match block
.coinbase_height()
.expect("must have height")
Expand Down
Loading