Commit Graph

5292 Commits

Author SHA1 Message Date
Arya c30537d946 moves genesis hash check to Network.checkpoint_list() 2024-04-19 16:16:57 -04:00
Arya 97b43cb8ff Copies Regtest genesis block from zcashd 2024-04-19 15:46:03 -04:00
Arya a8b4e278b7 Adds genesis hash methods and fields to `testnet::Parameters` and its builder 2024-04-19 15:46:03 -04:00
Arya b38dbfd252 Adds `is_regtest()` methods 2024-04-19 15:43:51 -04:00
Arya 9b41cba5a3 Uses the correct constant in test 2024-04-19 15:43:51 -04:00
Arya 4671efe98c Checks that default Mainnet/Testnet/Regtest Sapling HRPs pass validation in `with_sapling_hrps()` 2024-04-19 15:43:51 -04:00
Arya d8715909e2 Adds `with_sapling_hrps()` method and uses it to set the Regtest HRPs in `new_regtest()`.
Adds a test for Sapling HRP validation
2024-04-19 15:43:51 -04:00
Arya 63623ae53f Restores `testnet_parameters` section of the latest stored config. 2024-04-19 15:43:51 -04:00
Arya 32e4fbbc51 Removes outdated TODO 2024-04-19 15:43:51 -04:00
Arya e816c6616c Refactors if-let & match statement into general match statement, removes constraint against including `testnet_parameters` field/section in the config when using `Mainnet` or `Regtest` 2024-04-19 15:43:51 -04:00
Arya 32d0758702 Updates `activates_network_upgrades_correctly` test to check Regtest activation heights (and default Mainnet/Testnet) 2024-04-19 15:43:51 -04:00
Arya 6e29727861 Adds a `new_regtest()` method on `Network` and `testnet::Parameters`, updates config deserialization to return an error if the initial_testnet_peers include any default initial peers AND contain configured activation heights 2024-04-19 15:43:51 -04:00
Arya c79e06f2b5 Merge remote-tracking branch 'origin/main' into params-network-name 2024-04-19 15:42:21 -04:00
dependabot[bot] f1334a8378
build(deps): bump the devops group with 2 updates (#8408)
Bumps the devops group with 2 updates: [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) and [baptiste0928/cargo-install](https://github.com/baptiste0928/cargo-install).


Updates `reviewdog/action-actionlint` from 1.43.0 to 1.44.0
- [Release notes](https://github.com/reviewdog/action-actionlint/releases)
- [Commits](https://github.com/reviewdog/action-actionlint/compare/v1.43.0...v1.44.0)

Updates `baptiste0928/cargo-install` from 3.0.1 to 3.1.0
- [Release notes](https://github.com/baptiste0928/cargo-install/releases)
- [Changelog](https://github.com/baptiste0928/cargo-install/blob/main/CHANGELOG.md)
- [Commits](https://github.com/baptiste0928/cargo-install/compare/v3.0.1...v3.1.0)

---
updated-dependencies:
- dependency-name: reviewdog/action-actionlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: devops
- dependency-name: baptiste0928/cargo-install
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: devops
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 09:25:56 +00:00
Arya f8c153991b
add(consensus): Add `activation_heights` field to `NetworkParameters` and implement `Parameters` for `Network` (#8383)
* minor cleanup and rename

* Adds an empty NetworkParameters struct to Network::Testnet variant, updates production code.

* Updates tests

* Adds `NetworkKind` and uses it instead of `Network` in `HistoryTreeParts` and `transparent::Address`

* Adds a [network.testnet_parameters] section to the config, uses `NetworkKind` as zebra_network::Config::network field type, and converts 'Network' to `NetworkKind` before serializing

* Applies some suggestions from code review

* Applies suggestions from code review

* returns b58 prefix constants directly to remove From<NetworkKind> impl for zcash_primitives::consensus::Network

* Applies more suggestions from code review.

* moves conversions to zcash_primitives::consensus::Network to where they're used.

* Apply suggestions from code review

Co-authored-by: Marek <mail@marek.onl>

* rename `network` variables and method names typed as NetworkKind to `network_kind`

* use only test block heights for the network associated with them

* Applies more suggestions from code review.

* Rename `NetworkParameters` to `Parameters` and move it a new `testnet` module

* adds activation heights field

* updates stored test config, adds a quicker test for checking that stored configs can be parsed, adds an intermediate representation of activation heights

* implement Parameters for Network

* Passes &Network directly instead of converting to zp_consensus::Network where there were conversions

* fixes a bad merge (removes a network conversion in zcash_note_encryption)

* Adds a test for the Parameters impl for zebra_chain::Network

* fixes doc links

* - Makes the `activation_heights` config field optional by adding a #[serde(default)]
- Panics if a non-zero activation height is provided for the `Genesis` network upgrade
- Always sets the `Genesis` and `BeforeOverwinter` network upgrade activation heights to 0 and 1, `BeforeOverwinter` could be overwritten by a later network upgrade
- Makes the `activation_heights` field on `Parameters` private, adds/uses an accessor method instead, and adds a builder struct and `build()` method

* small refactor of activation_heights() method

* check that activation heights are in the right order

* Updates `NetworkUpgrade::activation_height()` to return the height of the next NetworkUpgrade if it doesn't find the activation height of `&self`

* checks that the miner address is of TestnetKind on Regtest and update assertion message

* Adds a DNetworkUpgradeActivationHeights struct for better control over how activation heights can be configured

* moves all ordered network upgrades to a constant, adds a no_duplicates test, moves struct with activation heights outside deserialization impl and accepts it in `ParametersBuilder::activation_heights()` instead of a Vec

* panics if any network upgrades are configured to activate at Height(0) because it's reserved for Genesis

* Simplifies the `ParametersBuilder::activation_heights()` method and removes an unnecessary test.

* Adds Sapling HRPs as fields on testnet params. (#8398)

* Applies suggestions from code review.

* Update zebra-chain/src/parameters/network_upgrade.rs

Co-authored-by: Marek <mail@marek.onl>

---------

Co-authored-by: Marek <mail@marek.onl>
2024-04-19 01:20:34 +00:00
Arya a842c12d55 updates stored test configs and fixes `network_name()` docs 2024-04-18 14:06:22 -04:00
Arya 0e97b53937 Adds `MainnetKind`, `TestnetKind`, and `RegtestKind` to reserved network names 2024-04-18 14:06:22 -04:00
Arya 08f0838079 adds config field for setting network name, adds "with_" prefix to ParameterBuilder setter methods 2024-04-18 14:06:22 -04:00
Arya 1608472f5a adds constraints on valid network names and a test 2024-04-18 14:06:22 -04:00
Arya 1173faf894 Removes unnecessary `.filter()` 2024-04-18 14:06:22 -04:00
Arya a94dcabaca Adds `network_name` field and accessor method on `Parameters`, uses it in the `Display` impl for `Network` 2024-04-18 14:06:22 -04:00
Arya fea2162419
Update zebra-chain/src/parameters/network_upgrade.rs
Co-authored-by: Marek <mail@marek.onl>
2024-04-18 10:13:53 -04:00
Alfredo Garcia 887d4a2457
fix(beta-toolchain): Warnings (#8404)
* fix beta imports and other warnings

* clippy lints beta

* move attributes to after docs

Co-authored-by: Marek <mail@marek.onl>

* move some code to test module

* implement display instead of direct tostring for LongPollId

Co-authored-by: Arya <aryasolhi@gmail.com>

* fix typo

---------

Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: Arya <aryasolhi@gmail.com>
2024-04-18 01:45:22 +00:00
Arya fb2d13a706 Applies suggestions from code review. 2024-04-17 18:57:01 -04:00
Arya 0b835f1f05
Adds Sapling HRPs as fields on testnet params. (#8398) 2024-04-18 00:39:16 +02:00
Alfredo Garcia 2995ea087b
send ping to ES server before inserting data (#8409) 2024-04-17 19:09:16 +00:00
Arya 868535b54c Merge branch 'main' into activ-heights-param-impl 2024-04-17 11:13:54 -04:00
Arya 16a39f89d0
add(consensus/network): Add an empty `Parameters` struct in `Network::Testnet` (#8368)
* minor cleanup and rename

* Adds an empty NetworkParameters struct to Network::Testnet variant, updates production code.

* Updates tests

* Adds `NetworkKind` and uses it instead of `Network` in `HistoryTreeParts` and `transparent::Address`

* Adds a [network.testnet_parameters] section to the config, uses `NetworkKind` as zebra_network::Config::network field type, and converts 'Network' to `NetworkKind` before serializing

* Applies some suggestions from code review

* Applies suggestions from code review

* returns b58 prefix constants directly to remove From<NetworkKind> impl for zcash_primitives::consensus::Network

* Applies more suggestions from code review.

* moves conversions to zcash_primitives::consensus::Network to where they're used.

* Apply suggestions from code review

Co-authored-by: Marek <mail@marek.onl>

* rename `network` variables and method names typed as NetworkKind to `network_kind`

* use only test block heights for the network associated with them

* Applies more suggestions from code review.

* Rename `NetworkParameters` to `Parameters` and move it a new `testnet` module

---------

Co-authored-by: Marek <mail@marek.onl>
2024-04-17 02:20:34 +00:00
Marek 5fd15a022c
build(deps): bump the prod group with 21 updates (#8402)
* Bump `clap` from 4.5.3 to 4.5.4

* Bump `indexmap` from 2.2.5 to 2.2.6

* Bump `rayon` from 1.9.0 to 1.10.0

* Bump `tokio` from 1.36.0 to 1.37.0

* Bump `tokio-stream` from 0.1.14 to 0.1.15

* Bump `regex` from 1.10.3 to 1.10.4

* Bump `insta` from 1.36.1 to 1.38.0

* Bump `serde_json` from 1.0.113 to 1.0.115

* Bump `prost` from 0.12.2 and 0.12.3 to 0.12.4

* Bump `bitflags` from 2.4.2 to 2.5.0

* Bump `bs58` from 0.5.0 to 0.5.1

* Bump `incrementalmerkletree` from 0.5.0 to 0.5.1

* Bump `zcash_address` from 0.3.1 to 0.3.2

* Bump `bytes` from 1.5.0 to 1.6.0

* Bump `syn` from 2.0.53 to 2.0.58

* Bump `quote` from 1.0.35 to 1.0.36

* Bump `serde_yaml` from 0.9.33 to 0.9.34+deprecated

* Bump `primitive-types` + `zcash_history`

* Bump `jsonrpc` from 0.17.0 to 0.18.0
2024-04-17 02:20:28 +00:00
Arya 1498f8e24e
Release v1.6.1 (#8396)
* Updates crates versions

* Updates end of support height

* Updates README

* Updates CHANGELOG

* Updates Known Issues in README

* Updates Changelog

* updates release-crates-dry-run.sh

* updates install.md and docker.md

* Update CHANGELOG.md

Co-authored-by: Marek <mail@marek.onl>

---------

Co-authored-by: Marek <mail@marek.onl>
2024-04-15 23:24:40 +00:00
dependabot[bot] 153444234b
build(deps): bump the devops group with 2 updates (#8391)
Bumps the devops group with 2 updates: [codecov/codecov-action](https://github.com/codecov/codecov-action) and [tj-actions/changed-files](https://github.com/tj-actions/changed-files).


Updates `codecov/codecov-action` from 4.1.1 to 4.3.0
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.1.1...v4.3.0)

Updates `tj-actions/changed-files` from 44.0.0 to 44.0.1
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v44.0.0...v44.0.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: devops
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: devops
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 06:51:56 +00:00
Arya 1dfad530b1 Simplifies the `ParametersBuilder::activation_heights()` method and removes an unnecessary test. 2024-04-12 18:15:52 -04:00
Arya 0abe87312b panics if any network upgrades are configured to activate at Height(0) because it's reserved for Genesis 2024-04-12 17:36:07 -04:00
Arya a37510a67b moves all ordered network upgrades to a constant, adds a no_duplicates test, moves struct with activation heights outside deserialization impl and accepts it in `ParametersBuilder::activation_heights()` instead of a Vec 2024-04-12 17:19:34 -04:00
Arya f724c0188f Adds a DNetworkUpgradeActivationHeights struct for better control over how activation heights can be configured 2024-04-12 16:18:41 -04:00
Arya ad34585590
add(rpc): Add block times to verbose output of `getblock` RPC method (#8384)
* Returns block times from the getblock RPC when used with verbosity = 1 (it's already included with verbosity = 0 but this makes it easier to use).

* cleanup/refactor, adds MapServerError and OkOrServerError traits

* moves rpc error conversion traits to their own module

* Only returns block time for verbosity = 2, updates snapshots
2024-04-12 20:07:44 +00:00
Arya 325a6c6154 checks that the miner address is of TestnetKind on Regtest and update assertion message 2024-04-12 15:04:51 -04:00
Arya e697d36dee Updates `NetworkUpgrade::activation_height()` to return the height of the next NetworkUpgrade if it doesn't find the activation height of `&self` 2024-04-11 23:38:51 -04:00
Arya 3952caa022 check that activation heights are in the right order 2024-04-11 23:06:53 -04:00
Arya 0fd4158dad small refactor of activation_heights() method 2024-04-11 22:29:52 -04:00
Arya 93c7a58330 - Makes the `activation_heights` config field optional by adding a #[serde(default)]
- Panics if a non-zero activation height is provided for the `Genesis` network upgrade
- Always sets the `Genesis` and `BeforeOverwinter` network upgrade activation heights to 0 and 1, `BeforeOverwinter` could be overwritten by a later network upgrade
- Makes the `activation_heights` field on `Parameters` private, adds/uses an accessor method instead, and adds a builder struct and `build()` method
2024-04-11 22:07:20 -04:00
dependabot[bot] 4241e320b8
build(deps): bump h2 from 0.3.24 to 0.3.26 (#8386)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.26.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.24...v0.3.26)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-12 00:52:33 +00:00
Arya e9979b6403
Updates checkpoints (#8394) 2024-04-11 22:52:27 +00:00
Arya 997e265636 fixes doc links 2024-04-11 16:47:19 -04:00
Arya 2493e7ec76 Adds a test for the Parameters impl for zebra_chain::Network 2024-04-11 16:37:13 -04:00
Arya 080affd6d7 fixes a bad merge (removes a network conversion in zcash_note_encryption) 2024-04-11 15:52:20 -04:00
Arya 4347a80c24 Passes &Network directly instead of converting to zp_consensus::Network where there were conversions 2024-04-11 15:47:19 -04:00
Arya ad4e7dcf8a implement Parameters for Network 2024-04-11 15:47:19 -04:00
Arya b9bdf0527c updates stored test config, adds a quicker test for checking that stored configs can be parsed, adds an intermediate representation of activation heights 2024-04-11 15:47:19 -04:00
Arya 60248e3f1f adds activation heights field 2024-04-11 15:45:17 -04:00