Commit Graph

5292 Commits

Author SHA1 Message Date
Conrado Gouvea 3650442ad8
zebra_script: update to new zcash_script callback API (#8566)
* zebra_script: change to use new zcash_script callback API

* add precomputation

* cleanups

* use released zcash_script

* fix clippy error

* Apply suggestions from code review

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

* improve docs

* use tuple instead of two Option params

---------

Co-authored-by: Marek <mail@marek.onl>
2024-06-19 12:48:12 +00:00
Marek c6f575319d
fix: Stop using `displaydoc` (#8614)
* Stop using `displaydoc`

* Fix comment alignment

This commit is unrelated to the solution in this branch. There's a new
lint that produces a warning when lists in comments are not aligned well.
2024-06-17 15:10:41 +00:00
Marek 8f27d972fa
chore: Update the PR template (#8591)
* Fix TOC in `CONTRIBUTING.md`

* Refactor PR template

* Edit the PR reviewer's checklist

* Unrelated: fix spelling

* Simplify the checklists
2024-06-15 14:28:14 +00:00
Alfredo Garcia 791e863029
fix(openapi): Remove trailing characters in descriptions (#8597)
* remove trailing characters in descriptions

* add changelog entry
2024-06-15 12:38:32 +00:00
Alfredo Garcia 0e6eee373e
fix typos (#8612) 2024-06-14 18:29:21 +00:00
Alfredo Garcia f2bc02726c
use constant (#8611) 2024-06-14 16:21:44 +00:00
Marek 736f5f5415
change(scan): Remove support for starting the scanner at `zebrad` startup (#8594)
* Remove code that starts the scanner

* Update CHANGELOG

* Disable tests of the scanner

* Disable scanning tests in CI

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-06-12 18:39:00 +00:00
Arya 1b5f9426f9
change(state): Add an init function for a standalone `ReadStateService` (#8595)
* Adds an init_read_only() fn in zebra-state

* moves elasticsearch initialization to `FinalizedState::new_with_debug()`

* Updates callers of `FinalizedState::{new, new_with_debug}` to pass a bool to try enabling elasticsearch

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-06-12 13:35:13 +00:00
Gustavo Valverde 139e1c3ed7
feat(build): use Docker Build Cloud for image build (#8374)
* feat(build): use Docker Build Cloud for image build

* fix(build): secrets, runner and conditional login

* ref(build): avoid using an external cache with Docker Build Cloud

* fix(build): `buildx` setup must be after registry login

* fix: merge

* fix(login): always login to Docker

* fix(build): remove extra build steps
2024-06-12 12:18:18 +00:00
Marek 158d6879fc
fix: General conditional compilation attributes (#8602)
* Remove general conditional compilation flags

See https://blog.rust-lang.org/2024/05/06/check-cfg.html

The conditional compilation flags for tor were superfluous as we can
make do fine with using only features.

* Update changelog

* Add `tokio_unstable` to to `unexpected_cfgs`

* Update changelog

* Fix `tokio_unstable` in `zebrad`
2024-06-12 01:04:30 +00:00
Gustavo Valverde 55c69929c5
ref(ci): Use a single CI workflow for tests (#8575)
* ref(ci): Use a single CI workflow for tests

This is an initial implementation to solve the re-building of our Docker image, which is being built multiple times by our Github Actions.

This is meant to fix -> devops: Build CI Docker runs twice for every PR #7816

* fix(patch): use correct name reference

* chore: reduce diff with correct sentence

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* fix(rules): revert job names, to avoid creating an extra rule

* Update .github/workflows/ci-tests.patch.yml

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

---------

Co-authored-by: Marek <mail@marek.onl>
2024-06-10 22:51:33 +00:00
dependabot[bot] 8437fdbdfa
build(deps): bump the devops group with 2 updates (#8590)
Bumps the devops group with 2 updates: [tj-actions/changed-files](https://github.com/tj-actions/changed-files) and [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint).


Updates `tj-actions/changed-files` from 44.5.1 to 44.5.2
- [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.5.1...v44.5.2)

Updates `reviewdog/action-actionlint` from 1.47.0 to 1.48.0
- [Release notes](https://github.com/reviewdog/action-actionlint/releases)
- [Commits](https://github.com/reviewdog/action-actionlint/compare/v1.47.0...v1.48.0)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: devops
- dependency-name: reviewdog/action-actionlint
  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-06-05 19:58:40 +00:00
dependabot[bot] 64d1a5e342
build(deps): bump the devops group across 1 directory with 5 updates (#8574)
Bumps the devops group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [docker/login-action](https://github.com/docker/login-action) | `3.1.0` | `3.2.0` |
| [codecov/codecov-action](https://github.com/codecov/codecov-action) | `4.4.0` | `4.4.1` |
| [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `44.4.0` | `44.5.1` |
| [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) | `1.46.0` | `1.47.0` |
| [FirebaseExtended/action-hosting-deploy](https://github.com/firebaseextended/action-hosting-deploy) | `0.7.1` | `0.9.0` |



Updates `docker/login-action` from 3.1.0 to 3.2.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.1.0...v3.2.0)

Updates `codecov/codecov-action` from 4.4.0 to 4.4.1
- [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.4.0...v4.4.1)

Updates `tj-actions/changed-files` from 44.4.0 to 44.5.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.4.0...v44.5.1)

Updates `reviewdog/action-actionlint` from 1.46.0 to 1.47.0
- [Release notes](https://github.com/reviewdog/action-actionlint/releases)
- [Commits](https://github.com/reviewdog/action-actionlint/compare/v1.46.0...v1.47.0)

Updates `FirebaseExtended/action-hosting-deploy` from 0.7.1 to 0.9.0
- [Release notes](https://github.com/firebaseextended/action-hosting-deploy/releases)
- [Commits](https://github.com/firebaseextended/action-hosting-deploy/compare/v0.7.1...v0.9.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: devops
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: devops
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: devops
- dependency-name: reviewdog/action-actionlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: devops
- dependency-name: FirebaseExtended/action-hosting-deploy
  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-06-04 22:41:40 +00:00
Alfredo Garcia dbff3b49bc
build(ecc):Upgrade remaining ECC dependencies (#8568)
* upgrade zcash_client_backend for zebra-scan

* leave zebra-utils untouched

* remove unused

* upgrade zcash_primitives and orchard only for zebra-chain crate

* update and use TryFrom for amounts

* fix imports in serialize

* leave doc as it was

* leave doc as it was 2

* use `try_into` for amount

* use `zip_212_enforcement`

* updgrades primitives in zebra-rpc

* upgrade ecc dependencies for cargo-utils

* fix threading issue

* remove non needed Arc

* update deny.toml

* update primitives for zebra-grpc

* fix doc

* remove non needed single thread code in test

* cleanup some tests

* improve a bit the `ready_scan_block_keys` function

* clippy

* add spawn back in `scan_height_and_store_results`

* remove todo

* add note comment

* use a more explicit import of sapling stuff in serialize

* change(scan): Refactor scanning keys (#8577)

* Refactor converting dfvks to scanning keys

* Simplify handling of scanning keys

* Remove `test-dependencies` from the scanner reader

* Add comments

---------

Co-authored-by: Marek <mail@marek.onl>
2024-06-04 21:04:40 +00:00
Gustavo Valverde f2ab3271e9
fix(ci): Add missing patch jobs (#8578) 2024-06-04 16:06:13 +00:00
dependabot[bot] e4e54e4b30
build(deps): bump the prod group with 2 updates (#8571)
Bumps the prod group with 2 updates: [serde](https://github.com/serde-rs/serde) and [syn](https://github.com/dtolnay/syn).


Updates `serde` from 1.0.202 to 1.0.203
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.202...v1.0.203)

Updates `syn` from 2.0.65 to 2.0.66
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.65...2.0.66)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 14:09:29 +00:00
Arya 3147d20f18
add(book): Adds a section on Regtest usage to the Zebra book (#8526)
* Always set mempool.debug_enable_at_height to 0 on Regtest

* Adds a Regtest with Zebra page to the book

* Deduplicates calls to is_regtest() in start fn

* upgrade min rust version in zebrad

* Display full network name in logs except for Mainnet and default Testnet

* Add example logs/code to regtest section of the book

* apply some extra information

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

* Apply suggestions from code review

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

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-05-22 15:14:22 +00:00
Marek eade2a85a8
fix(rpc): Refactor the serialization of note commitment trees (#8533)
* Remove `orchard::tree::SerializedTree`

* Move `GetTreestate` to the `trees` module

* Update comments

* Remove `sapling::tree::SerializedTree`

* Make the serialization compatible with `zcashd`

* Simplify error handling

* Derive `Default` for `GetTreestate`

* Remove old TODOs

* Simplify the `z_get_treestate` method

* Add & refactor tests

* Avoid a concurrency issue

* Fix docs

* Impl `Default` for `GetTreestate`

* Update zebra-rpc/src/methods.rs

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

* Update docs

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

* Rename `rsp` to `tree_state`

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

* Describe the serialization format of treestates

* Refactor error handling

* Refactor imports

* Apply suggestions from code review

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

* Use `treestate` in snapshots

* Use `ok_or_server_error`

* Bump  `zcash_primitives` from 0.13.0 to 0.14.0

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>

* Remove an outdated TODO

* Add a TODO on negative heights for treestates

* Revert "Bump `zcash_primitives` from 0.13.0 to 0.14.0"

This reverts commit 0799cb2389.

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-05-22 13:31:52 +00:00
Alfredo Garcia b06a1221cb
deps(zcash_proofs): Update zcash_proofs from 0.13.0-rc.1 to 0.14.0 (#8527)
* update zcash_proofs to 0.14 using custom sapling

* remove OnceLock

* Copies `parse_parameters()` function and other private functions it depends on from `zcash_proofs` (#8548)

* add links to copied code

* use upstream proofs and sapling

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-05-21 18:24:29 +00:00
dependabot[bot] 0cceb6abda
build(deps): bump the prod group with 7 updates (#8557)
Bumps the prod group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [serde](https://github.com/serde-rs/serde) | `1.0.201` | `1.0.202` |
| [toml](https://github.com/toml-rs/toml) | `0.8.12` | `0.8.13` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.60` | `1.0.61` |
| [insta](https://github.com/mitsuhiko/insta) | `1.38.0` | `1.39.0` |
| [prost](https://github.com/tokio-rs/prost) | `0.12.4` | `0.12.6` |
| [itertools](https://github.com/rust-itertools/itertools) | `0.12.1` | `0.13.0` |
| [syn](https://github.com/dtolnay/syn) | `2.0.63` | `2.0.65` |


Updates `serde` from 1.0.201 to 1.0.202
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.201...v1.0.202)

Updates `toml` from 0.8.12 to 0.8.13
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.12...toml-v0.8.13)

Updates `thiserror` from 1.0.60 to 1.0.61
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.60...1.0.61)

Updates `insta` from 1.38.0 to 1.39.0
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.38.0...1.39.0)

Updates `prost` from 0.12.4 to 0.12.6
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.12.4...v0.12.6)

Updates `itertools` from 0.12.1 to 0.13.0
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.12.1...v0.13.0)

Updates `syn` from 2.0.63 to 2.0.65
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.63...2.0.65)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: prost
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 19:50:59 +00:00
Arya c494aa7bd1
change(network): Allow custom testnets to make peer connections and configure more parameters (#8528)
* Allow custom testnets to define more parameters and to make peer connections based on the initial_testnet_peer config field

* Updates latest stored test config

* Update zebra-network/src/config.rs

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

---------

Co-authored-by: Marek <mail@marek.onl>
2024-05-20 13:11:34 +00:00
Arya 5ca40aa58b
add(network): Adds a network magic field to `testnet::Parameters` and the config (#8524)
* Adds a `target_difficulty_limit` field on `testnet::Parameters`

* updates test to increment block nonce until finding a block that's below the difficulty threshold

* increment the nonce while the difficulty is invalid instead of while the difficulty threshold is invalid

* Adds comments

* moves network Magic type from zebra-network to zebra-chain

* Adds `network_magic` field to `testnet::Parameters` and uses the regtest network magic from zcashd

* Add a network magic config field for custom testnets

* Adds/updates tests

* Update zebra-chain/src/parameters/network/testnet.rs

* Adds a link to the Regtest network magic in zcashd

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-05-18 20:30:59 +00:00
Alfredo Garcia e0da45bc1b
update orchard for zebra-consensus (#8529) 2024-05-18 19:59:08 +00:00
Arya 1484d3de70
Disables several tests on Windows to avoid port conflicts (#8551) 2024-05-18 12:54:23 +00:00
Arya 99b017e2a4
add(consensus): Add a `target_difficulty_limit` field on `testnet::Parameters` (#8518)
* Adds a `target_difficulty_limit` field on `testnet::Parameters`

* updates test to increment block nonce until finding a block that's below the difficulty threshold

* increment the nonce while the difficulty is invalid instead of while the difficulty threshold is invalid

* Adds comments
2024-05-17 23:06:08 +00:00
dependabot[bot] 827599e1aa
build(deps): bump the devops group across 1 directory with 6 updates (#8545)
Bumps the devops group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.1.4` | `4.1.6` |
| [google-github-actions/auth](https://github.com/google-github-actions/auth) | `2.1.2` | `2.1.3` |
| [r7kamura/rust-problem-matchers](https://github.com/r7kamura/rust-problem-matchers) | `1.4.0` | `1.5.0` |
| [codecov/codecov-action](https://github.com/codecov/codecov-action) | `4.3.0` | `4.4.0` |
| [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `44.3.0` | `44.4.0` |
| [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) | `1.44.0` | `1.46.0` |



Updates `actions/checkout` from 4.1.4 to 4.1.6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.4...v4.1.6)

Updates `google-github-actions/auth` from 2.1.2 to 2.1.3
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v2.1.2...v2.1.3)

Updates `r7kamura/rust-problem-matchers` from 1.4.0 to 1.5.0
- [Release notes](https://github.com/r7kamura/rust-problem-matchers/releases)
- [Commits](https://github.com/r7kamura/rust-problem-matchers/compare/v1.4.0...v1.5.0)

Updates `codecov/codecov-action` from 4.3.0 to 4.4.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.3.0...v4.4.0)

Updates `tj-actions/changed-files` from 44.3.0 to 44.4.0
- [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.3.0...v44.4.0)

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

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: devops
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: devops
- dependency-name: r7kamura/rust-problem-matchers
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: devops
- 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-minor
  dependency-group: devops
- dependency-name: reviewdog/action-actionlint
  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-05-17 16:39:02 +00:00
Arya 0f5450f565
change(release): Reduce the end of support time from 20 weeks to 16 weeks (#8530)
* Reduce the end of support time from 20 weeks to 16 weeks.

* Update release-process section of the book

* Adds changelog entry

* Update CHANGELOG.md

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-05-15 21:12:52 +00:00
dependabot[bot] e8a1b17b55
build(deps): bump the prod group with 5 updates (#8519)
Bumps the prod group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [semver](https://github.com/dtolnay/semver) | `1.0.22` | `1.0.23` |
| [serde](https://github.com/serde-rs/serde) | `1.0.200` | `1.0.201` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.59` | `1.0.60` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.116` | `1.0.117` |
| [syn](https://github.com/dtolnay/syn) | `2.0.60` | `2.0.63` |


Updates `semver` from 1.0.22 to 1.0.23
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.22...1.0.23)

Updates `serde` from 1.0.200 to 1.0.201
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.200...v1.0.201)

Updates `thiserror` from 1.0.59 to 1.0.60
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.59...1.0.60)

Updates `serde_json` from 1.0.116 to 1.0.117
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.116...v1.0.117)

Updates `syn` from 2.0.60 to 2.0.63
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.60...2.0.63)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 00:49:21 +00:00
Arya a6569d4881
change(mining): Restores parts of the internal-miner feature for use on Regtest (#8506)
* Allow configurable Nu5 activation height on Regtest

* Fixes test

* removes outdated TODO

* Adds `current_with_activation_height()` method and uses it in `Commitment::from_bytes()`

* Enables parts of the internal miner for use on Regtest when the solution isn't checked

* Update internal miner config field docs
2024-05-10 18:28:05 +00:00
Arya d2d1a18d81
add(consensus): Add `slow_start_{interval/shift}` fields to `testnet::Parameters` (#8477)
* - Adds `slow_start_interval` field to `testnet::Parameters`
- Moves SLOW_START_INTERVAL/SLOW_START_SHIFT constants to zebra-chain

* Apply suggestions from code review

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

---------

Co-authored-by: Marek <mail@marek.onl>
2024-05-08 17:14:54 +00:00
Arya 15e1096826
change(consensus): Allow configurable NU5 activation height on Regtest (#8505)
* Allow configurable Nu5 activation height on Regtest

* Fixes test

* removes outdated TODO

* Adds `current_with_activation_height()` method and uses it in `Commitment::from_bytes()`
2024-05-08 14:46:13 +00:00
Arya 0040c2be87
fix(consensus): Update `median_timespan()` method to align with zcashd implementation (#8491)
* Updates `median_timespan()` method to align with zcashd implementation of ActualTimespan

* Minor refactor

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-05-07 20:51:13 +00:00
Arya 3e264c73a6
allows square brackets in network config listen addr / external add (#8504) 2024-05-07 19:47:08 +00:00
dependabot[bot] 6506d73df5
build(deps): bump tokio-util from 0.7.10 to 0.7.11 in the prod group (#8509)
Bumps the prod group with 1 update: [tokio-util](https://github.com/tokio-rs/tokio).


Updates `tokio-util` from 0.7.10 to 0.7.11
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.10...tokio-util-0.7.11)

---
updated-dependencies:
- dependency-name: tokio-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 19:46:59 +00:00
Alfredo Garcia 0ca01e6a46
chore: Release v1.7.0 (#8507)
* changelog and readme for 1.7.0 release

* chore: Release

* update zebra-scan and zebra-grpc to the release crates dry run script

* update ESTIMATED_RELEASE_HEIGHT

* update the release period to 6 weeks

* update release block

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* Apply suggestions from code review

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

---------

Co-authored-by: Marek <mail@marek.onl>
2024-05-07 14:25:50 +00:00
Alfredo Garcia 211a238f1c
release(dependencies): Run `cargo update` (#8498)
* Run `cargo update`

* update deny.toml
2024-05-03 17:36:52 +00:00
Alfredo Garcia 2c5bece694
typo in dependbot yaml (#8494)
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-05-03 18:33:50 +02:00
Alfredo Garcia 183249d2ed
add checkpoints for release 1.7.0 (#8493) 2024-05-03 13:49:34 +00:00
Arya c4c04c2c2c
Attempts to fix dependabot groups (#8433)
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-05-03 09:40:05 +02:00
Alfredo Garcia 239fcc85ba
feat(network): Configurable external address for Version network messages (#8488)
* add configurable external address for Version network messages

* apply suggestions from code review

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

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-05-03 01:07:52 +00:00
Arya 8a786fe6ce
add(consensus): Adds block construction and validation for NU5 from block height 1 for Regtest (#8475)
* Always activate Canopy at Height(1) on Regtest

* Ignores the zip 212 grace period on configured Testnets and Regtest

* - Returns early when there is no Heartwood activation height when creating or updating HistoryTree
- Skips call to `check::legacy_chain()` when no NU5 activation height is set (it would return immediately anyway)
- Replaces `.map()` with `.filter_map()` in `NetworkUpgrade::target_spacings()`
- Removes outdated TODO

* - When proof of work is disabled, skips checking if Zebra is synced to the network tip in the getblocktemplate method

* Sets full_verifier_utxo_lookahead to Height::MIN instead of panicking

* When network is regtest, skips starting sync task and commits the genesis block if it's missing in the state

* updates/fixes test config

* Adds test for committing Canopy blocks on Regtest

* - Updates median time past and difficulty checks to use fewer than 11/17/28 blocks

* uses SLOW_START_INTERVAL of 0 if PoW is disabled, adds TODOs

* Update getblocktemplate method to return reserved chain history activation root hash, uses Nu5 at height 1

Test passes.

* Updates test to expect NU5 as the default nu activation at Height(1)

* Removes invalid difficulty snapshot

* fixes tests

* removes regtest NU5 activation height config field

* Apply suggestions from code review

* Update zebra-state/src/service/check/difficulty.rs

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

* Update zebra-state/src/service/check/difficulty.rs

* Updates docs/comments, renames an argument

---------

Co-authored-by: Marek <mail@marek.onl>
2024-05-02 19:43:42 +00:00
Marek d47acd06f6
add(chain): Impl `zcash_protocol::consensus::Parameters` for `Network` (#8425)
* Use full paths for types from `zcash_primitives`

Upcoming commits will use `zcash_protocol::consensus::Parameters`, which
would make names such as `zp_consensus::Parameters` ambiguous since such
a name could stand for both `zcash_primitives...` and
`zcash_protocol...`.

* Impl and use conversion between network kinds

These conversions will make implementing
`zcash_protocol::consensus::Parameters` for `Network` easier.

* Impl conversions between network upgrades

* Impl `zcash_protocol::consensus::Parameters`

* Move `mod address` from under the gbt feature

* Remove a redundant `impl From`

* Impl `From` for a reference type correctly

The previous implementation called `into` on a reference without
dereferencing it. I thought the compiler would implicitly dereference,
but it didn't, which lead to infinite recursion since the fn ended up
calling itself.
2024-05-02 00:22:37 +00:00
dependabot[bot] f14cf315d0
build(deps): bump the devops group with 2 updates (#8457)
Bumps the devops group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [tj-actions/changed-files](https://github.com/tj-actions/changed-files).


Updates `actions/checkout` from 4.1.2 to 4.1.4
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.2...v4.1.4)

Updates `tj-actions/changed-files` from 44.0.1 to 44.3.0
- [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.1...v44.3.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: devops
- dependency-name: tj-actions/changed-files
  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>
Co-authored-by: Arya <aryasolhi@gmail.com>
2024-04-30 22:38:27 +00:00
Arya 7893874624
fix(consensus): Check Equihash solutions with n=200, k=9 parameters (#8474)
* Always checks equihash solution with n=200, k=9 parameters

* updates TODO

* updates TODO
2024-04-29 23:04:31 +00:00
Arya d84d7356dd
add(consensus): Adds `disable_pow` and `genesis_hash` fields, converts `equihash::Solution` to an enum (#8421)
* 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>

* Adds `network_name` field and accessor method on `Parameters`, uses it in the `Display` impl for `Network`

* Removes unnecessary `.filter()`

* adds constraints on valid network names and a test

* adds config field for setting network name, adds "with_" prefix to ParameterBuilder setter methods

* Adds `MainnetKind`, `TestnetKind`, and `RegtestKind` to reserved network names

* updates stored test configs and fixes `network_name()` docs

* 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

* Updates `activates_network_upgrades_correctly` test to check Regtest activation heights (and default Mainnet/Testnet)

* 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`

* Removes outdated TODO

* Restores `testnet_parameters` section of the latest stored config.

* Adds `with_sapling_hrps()` method and uses it to set the Regtest HRPs in `new_regtest()`.

Adds a test for Sapling HRP validation

* Checks that default Mainnet/Testnet/Regtest Sapling HRPs pass validation in `with_sapling_hrps()`

* Uses the correct constant in test

* Adds `is_regtest()` methods

* Adds genesis hash methods and fields to `testnet::Parameters` and its builder

* Copies Regtest genesis block from zcashd

* moves genesis hash check to Network.checkpoint_list()

* Checks the first line in the checkpoint list instead of the first item in the BTreeMap

* Checks that there is _some_ genesis block in the checkpoints list in `from_list()`, adds Regtest checkpoints (which only includes the genesis block)

* Adds a doc comment to `ParametersBuilder::default()`

* Adds a `disable_pow` field and skips checking proof of work if it's true

* Makes `equihash::Solution` an enum to support Regtest solutions, adds a test for validating and committing the Regtest genesis block

* use genesis_hash as first checkpoint when checkpoints are missing for configured testnets too

* Applies suggestions from code review.

* Reverts changes to `activation_height()` method

* Avoids panic in test

* Updates test docs

* drop custom panic hooks after expected panics

---------

Co-authored-by: Marek <mail@marek.onl>
2024-04-26 05:30:36 +00:00
Arya c28e37bf23
disables `rejection_restores_internal_state_genesis` test on Windows (#8468) 2024-04-26 05:30:31 +00:00
Arya e5d4d739b7
add(consensus/network): Adds `new_regtest()` constructors to `testnet::Parameters` and `Network` (#8413)
* 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>

* Adds `network_name` field and accessor method on `Parameters`, uses it in the `Display` impl for `Network`

* Removes unnecessary `.filter()`

* adds constraints on valid network names and a test

* adds config field for setting network name, adds "with_" prefix to ParameterBuilder setter methods

* Adds `MainnetKind`, `TestnetKind`, and `RegtestKind` to reserved network names

* updates stored test configs and fixes `network_name()` docs

* 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

* Updates `activates_network_upgrades_correctly` test to check Regtest activation heights (and default Mainnet/Testnet)

* 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`

* Removes outdated TODO

* Restores `testnet_parameters` section of the latest stored config.

* Adds `with_sapling_hrps()` method and uses it to set the Regtest HRPs in `new_regtest()`.

Adds a test for Sapling HRP validation

* Checks that default Mainnet/Testnet/Regtest Sapling HRPs pass validation in `with_sapling_hrps()`

* Uses the correct constant in test

* Adds `is_regtest()` methods

* Updates test docs

* drop custom panic hooks after expected panics

---------

Co-authored-by: Marek <mail@marek.onl>
2024-04-25 04:04:05 +00:00
Arya e95a70de7a
increases timeout duration waiting on done notification in non-blocking logger test (#8462) 2024-04-24 20:28:17 +00:00
Arya ee9ab3162a
fixes concurrency bug in z_get_treestate RPC method (#8460) 2024-04-24 20:27:56 +00:00
Alfredo Garcia d869ec6fe4
change(release): Adjust estimated release interval and end of support (#8429)
* change estimated release interval and end of support

* update readme
2024-04-24 19:22:07 +00:00