Commit Graph

440 Commits

Author SHA1 Message Date
Alfredo Garcia 0fe47bbbbb
feature(rpc): Migrate from deprecated `jsonrpc_*` crates to `jsonrpsee` (#9059)
* update methods

* update get block template rpc methods

* update other getblocktemplate files

* upgrade server and middlewares

* upgrade zebrad start command

* remove unused imports

* add a todo for unauthenticated rpc error

* upgrade tests, temporally comment out some of them

* fix the rpc tx queue

* update denies

* fix  links

* clippy

* fir more doc links

* fix queue tests

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

* add suggestions from code review

* fix snapshots

* try `block_on` instead of `now_or_never` in the http middleware

* move import

* Apply suggestions from code review

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

* fix bounds

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-12-21 02:29:16 +00:00
Arya 1974fea885
change(rpc): Avoid re-verifying transactions in blocks if those transactions are in the mempool (#8951)
* skips re-verifying transactions in blocks that are present in the mempool.

* clippy fix

* adds a test

* fixes clippy lint

* Use NU6 & V5 tx in new test

* Uses correct consensus branch id in test
2024-12-19 18:46:27 +00:00
Conrado Gouvea 543f0669e1
add(rpc): getblock: return transaction details with verbosity=2 (#9083)
* getblock: return tx objects with verbosity=2

* fix test

* use FuturesOrdered

* Suggestion for "add(rpc): getblock: return transaction details with verbosity=2" (#9084)

* Replaces multiple service calls (per transaction) with a single call to the state service for all of a block's transactions.

* adjustments to reuse code from getrawtransaction

---------

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* update snapshot

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-12-14 12:28:57 +00:00
Marek b0c4d19a7c
fix(rpc): Refactor `getrawtransaction` & RPC error handling (#9049)
* clean-up: simplify the def of `MapServerError`

* Use `HexData` instead of `String` for TXIDs

* Remove a redundant test

We don't need such a test anymore because the deserialization is handled
by Serde now.

* Adjust tests for using `HexData`

* Make `height` and `confirmations` optional

* Use legacy error codes

* fmt

* Remove unneeded error codes

* Remove `zebra-rpc/src/constants.rs`

* Rename `MapServerError` to `MapError`

* Rename `OkOrServerError` to `OkOrError`

* Allow specifying error codes when mapping errors

* Allow setting error codes when mapping options

* Use the right error code for `getrawtransaction`

* fmt

* Add docs for the error conversion traits

* Refactor the error handling for `getblock`

* Refactor error handling in `sendrawtransaction`

* Refactor the error handling for `getblock`

* Update the error handling for `getrawtransaction`

* Refactor error handling for `z_gettreestate`

* Refactor the error handling for address parsing

* Refactor the error handling for getrawtransaction

* Update `z_gettreestate` snapshots

* Cosmetics

* Refactor error handling in `getblock`

* Refactor error handling in `getblockheader`

* Simplify `getrawtransaction`

* Check errors for `getrawtransaction`

* fmt

* Simplify proptests

* Fix unit tests for `getaddresstxids`

* Fix unit tests for `getaddressutxos`

* fix docs

* Update snapshots for `getrawtransaction`

* Update zebra-rpc/src/server/error.rs

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

* Use `transaction::Hash` instead of `HexData`

* Simplify error handling

* Update zebra-rpc/src/server/error.rs

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

* Move a note on performance

* Fix a typo

* Use `String` instead of `transaction::Hash`

* Adjust and add proptests

* Reintroduce snapshots for invalid TXIDs

* Don't derive `Serialize` & `Deserialize` for txids

Deriving `serde::Serialize` & `serde::Deserialize` for
`transaction::Hash` was superfluous, and we didn't need it anywhere in
the code.

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-12-13 14:01:53 +00:00
dependabot[bot] 568b25e590
build(deps): bump the prod group with 10 updates (#9077)
* build(deps): bump the prod group with 10 updates

Bumps the prod group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.21` | `4.5.23` |
| [chrono](https://github.com/chronotope/chrono) | `0.4.38` | `0.4.39` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.41.1` | `1.42.0` |
| [tokio-stream](https://github.com/tokio-rs/tokio) | `0.1.16` | `0.1.17` |
| [tower](https://github.com/tower-rs/tower) | `0.4.13` | `0.5.1` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.3` | `2.0.6` |
| [tracing-subscriber](https://github.com/tokio-rs/tracing) | `0.3.18` | `0.3.19` |
| [prost](https://github.com/tokio-rs/prost) | `0.13.3` | `0.13.4` |
| [primitive-types](https://github.com/paritytech/parity-common) | `0.12.2` | `0.13.1` |
| [tokio-util](https://github.com/tokio-rs/tokio) | `0.7.12` | `0.7.13` |


Updates `clap` from 4.5.21 to 4.5.23
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.21...clap_complete-v4.5.23)

Updates `chrono` from 0.4.38 to 0.4.39
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.38...v0.4.39)

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

Updates `tokio-stream` from 0.1.16 to 0.1.17
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.16...tokio-stream-0.1.17)

Updates `tower` from 0.4.13 to 0.5.1
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](https://github.com/tower-rs/tower/compare/tower-0.4.13...tower-0.5.1)

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

Updates `tracing-subscriber` from 0.3.18 to 0.3.19
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.18...tracing-subscriber-0.3.19)

Updates `prost` from 0.13.3 to 0.13.4
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Changelog](https://github.com/tokio-rs/prost/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.13.3...v0.13.4)

Updates `primitive-types` from 0.12.2 to 0.13.1
- [Commits](https://github.com/paritytech/parity-common/commits/primitive-types-v0.13.1)

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

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: tokio-stream
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tower
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: prost
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: primitive-types
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- 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>

* downgrade tower and primitive-types

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-12-11 16:29:44 +00:00
dependabot[bot] be50f7ce83
build(deps): bump the prod group across 1 directory with 22 updates (#9065)
* build(deps): bump the prod group across 1 directory with 22 updates

Bumps the prod group with 21 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.20` | `4.5.21` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.6.0` | `2.7.0` |
| [serde](https://github.com/serde-rs/serde) | `1.0.214` | `1.0.215` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.41.0` | `1.41.1` |
| [tower](https://github.com/tower-rs/tower) | `0.4.13` | `0.5.1` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.65` | `2.0.3` |
| [tracing-error](https://github.com/tokio-rs/tracing) | `0.2.0` | `0.2.1` |
| [tracing](https://github.com/tokio-rs/tracing) | `0.1.40` | `0.1.41` |
| [metrics](https://github.com/metrics-rs/metrics) | `0.24.0` | `0.24.1` |
| [thread-priority](https://github.com/iddm/thread-priority) | `1.1.0` | `1.2.0` |
| [sentry](https://github.com/getsentry/sentry-rust) | `0.32.3` | `0.35.0` |
| [inferno](https://github.com/jonhoo/inferno) | `0.11.21` | `0.12.0` |
| [hyper](https://github.com/hyperium/hyper) | `1.5.0` | `1.5.1` |
| [bytes](https://github.com/tokio-rs/bytes) | `1.8.0` | `1.9.0` |
| [indicatif](https://github.com/console-rs/indicatif) | `0.17.8` | `0.17.9` |
| [insta](https://github.com/mitsuhiko/insta) | `1.41.0` | `1.41.1` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.132` | `1.0.133` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.13.0` | `3.14.0` |
| [primitive-types](https://github.com/paritytech/parity-common) | `0.12.2` | `0.13.1` |
| [elasticsearch](https://github.com/elastic/elasticsearch-rs) | `8.5.0-alpha.1` | `8.16.0-alpha.1` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.11.27` | `0.12.9` |



Updates `clap` from 4.5.20 to 4.5.21
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.20...clap_complete-v4.5.21)

Updates `indexmap` from 2.6.0 to 2.7.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.6.0...2.7.0)

Updates `serde` from 1.0.214 to 1.0.215
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.214...v1.0.215)

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

Updates `tower` from 0.4.13 to 0.5.1
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](https://github.com/tower-rs/tower/compare/tower-0.4.13...tower-0.5.1)

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

Updates `tracing-error` from 0.2.0 to 0.2.1
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-error-0.2.0...tracing-error-0.2.1)

Updates `tracing` from 0.1.40 to 0.1.41
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.40...tracing-0.1.41)

Updates `metrics` from 0.24.0 to 0.24.1
- [Changelog](https://github.com/metrics-rs/metrics/blob/main/release.toml)
- [Commits](https://github.com/metrics-rs/metrics/compare/metrics-v0.24.0...metrics-v0.24.1)

Updates `thread-priority` from 1.1.0 to 1.2.0
- [Commits](https://github.com/iddm/thread-priority/commits)

Updates `sentry` from 0.32.3 to 0.35.0
- [Release notes](https://github.com/getsentry/sentry-rust/releases)
- [Changelog](https://github.com/getsentry/sentry-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-rust/compare/0.32.3...0.35.0)

Updates `inferno` from 0.11.21 to 0.12.0
- [Changelog](https://github.com/jonhoo/inferno/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jonhoo/inferno/compare/v0.11.21...v0.12.0)

Updates `hyper` from 1.5.0 to 1.5.1
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v1.5.0...v1.5.1)

Updates `bytes` from 1.8.0 to 1.9.0
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.8.0...v1.9.0)

Updates `indicatif` from 0.17.8 to 0.17.9
- [Release notes](https://github.com/console-rs/indicatif/releases)
- [Commits](https://github.com/console-rs/indicatif/compare/0.17.8...0.17.9)

Updates `insta` from 1.41.0 to 1.41.1
- [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.41.0...1.41.1)

Updates `serde_json` from 1.0.132 to 1.0.133
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.132...v1.0.133)

Updates `tempfile` from 3.13.0 to 3.14.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.13.0...v3.14.0)

Updates `primitive-types` from 0.12.2 to 0.13.1
- [Commits](https://github.com/paritytech/parity-common/commits/primitive-types-v0.13.1)

Updates `elasticsearch` from 8.5.0-alpha.1 to 8.16.0-alpha.1
- [Release notes](https://github.com/elastic/elasticsearch-rs/releases)
- [Commits](https://github.com/elastic/elasticsearch-rs/commits)

Updates `reqwest` from 0.11.27 to 0.12.9
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.27...v0.12.9)

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

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tower
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: prod
- dependency-name: tracing-error
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tracing
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: metrics
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: thread-priority
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: sentry
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: inferno
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: hyper
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: indicatif
  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-patch
  dependency-group: prod
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: primitive-types
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: elasticsearch
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: reqwest
  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>

* downgrade tower, add denies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-12-07 04:27:09 +00:00
Arya 179aaa4c4f
Release v2.1.0 (#9072)
* Updates changelog, crate versions, end of support height, and docs.

* Update CHANGELOG.md

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

---------

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2024-12-06 18:28:56 +00:00
Conrado Gouvea d1ae441ab9
change(rpc): Update `getblock` RPC to more closely match zcashd (#9006)
* rpc: align getblock with zcashd behaviour

* Removes handling for verbosity = 3 in getblock method, adds finalorchardroot field, removes unnecessary state request. (#9008)

* align final(sapling|orchard)root with zcashd behaviour

* fix test

* Apply suggestions from code review

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

* restore getblock docs; remove unneeded TODOs

* Update zebra-rpc/src/methods.rs

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

* get rif of cloning self (#9044)

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-12-02 14:58:34 +00:00
Arya 1e46914131
add(rpc): Adds `getblockheader` RPC method (#8967)
* Adds getblockheader RPC method

* Updates snapshots, adds hash/height/next_block_hash fields to verbose response

* updates getblock snapshot

* updates getblockheader response type to hex-encode fields, adds ToHex impl for sapling::tree::Root, adds snapshot and vector tests for new RPC method, adds snapshots.

* rustfmt

* fixes snapshots, matches zcashd more closely

* fixes vectors test

* updates lwd failure messages (probably doesn't matter, but seems better to handle it now than risk debugging it later)

* fixes getblock_rpc test, fixes/reverses finalsaplingroot field byte-order.

* fixes vector test, addresses remaining differences with zcashd (except the `chainwork` field), updates snapshots, and avoids a possible panic when there's a chain reorg between state queries.

* Adds a comment noting that the `relative_to_network()` method was copied from zcashd

* Apply suggestions from code review

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

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-11-18 12:16:27 +00:00
Arya 1dfac40751
add(mempool): Verify transactions with unmined inputs in the mempool (#8857)
* Adds a parameter to `zebra_consensus::router::init()` for accepting a mempool setup argument, adds and uses an `init_test()` fn for passing a closed channel receiver in tests where no mempool service is needed in the transaction verifier.

* Adds a `mempool` argument to the transaction::Verifier constructor (and a `new_for_tests()` constructor for convenience)

* Removes `Clone` impl on `transaction::Verifier` to add mempool oneshot receiver, updates tests.

* Adds TODOs

* updates transaction verifier's poll_ready() method to setup the mempool service handle.

* Updates VerifiedSet struct used in mempool storage

* Updates mempool service and its `Storage` to use the updated `VerifiedSet` `transactions()` return type.

* updates `created_outputs` when inserting or removing a transaction from the mempool's verified set

* Adds a TODO, updates field docs

* Updates `spent_utxos()` to query the mempool for unspent outputs

* Adds `spent_mempool_outpoints` as a field on tx verifier mempool response

* Updates mempool `Downloads` to return the spent_mempool_outpoints from the tx verifier response

* Updates `Storage.insert()` to accept a list of spent mempool transaction outputs

* Adds transaction dependencies when inserting a tx in `VerifiedSet`

* polls mempool svc from tx verifier when a mempool tx that creates transparent outputs has been verified.

adds a TODO for adding a `pending_outputs` field to the mempool Storage

* Adds `pending_outputs` field on mempool Storage and responds to pending outputs requests when inserting new transactions into the mempool's verified set

* replaces `UnminedTxId` type with `transaction::Hash` in mempool's verified set

* prune pending outputs when rejecting and removing same effects.

* Remove dependent transactions from verified set when removing a tx

* updates tests

* appeases clippy.

* removes unused `len()` method

* fixes doc links

* Adds transaction dependencies to the `FullTransactions` response, let the caller handle it (required to avoid moving zip317 tx selection code to mempool)

* updates block template construction to avoid including transactions unless their dependencies have already been added.

* updates tests

* Replaces placeholder setup channel with one that sends the mempool svc to the tx verifier, adds a timeout layer, adds a TODO about a concurrency bug

* Use a single query to check for unspent outputs in the mempool

* Updates `getblocktemplate` method to consider dependencies when sorting transactions for the final template

* fixes clippy lints, removes unnecessary Option in UnspentOutput response variant

* renames type alias and method, adds a TODO to use iteration instead of recursion

* Adds mempool_removes_dependent_transactions() test

* Updates Storage and VerifiedSet clear() methods to clear pending_outputs, created_outputs, and transaction_dependencies, adds TODO to use iteration instead of recursion.

* removes outdated TODO

* Adds a TODO for reporting queued transaction verification results from the mempool from the poll_ready() method

* Adds `mempool_responds_to_await_output` test

* updates mempool_responds_to_await_output test

* Uses iteration instead of recursion in verified set's remove() method and zip317 mod's dependencies_depth() method

* Adds a mempool_request_with_mempool_output_is_accepted test for the transaction verifier

* Moves delay duration before polling the mempool to a constant, uses a shorter timeout for mempool output lookups, adds a `poll_count` to MockService, and updates `mempool_request_with_unmined_output_spends_is_accepted` to check that the transaction verifier polls the mempool after verifying a mempool transaction with transparent outputs

* adds long_poll_input_mempool_tx_ids_are_sorted test

* Adds a `excludes_tx_with_unselected_dependencies` test

* Updates a TODO

* moves `TransactionDependencies` struct to `zebra-node-services`

* Updates `FullTransactions` response variant's `transaction_dependencies` type

* updates zip317 transaction selection for block templates to include dependent transactions

* Moves and refactors zip317 tx selection test to its own module, adds an `unmined_transactions_in_blocks()` method on network

* Removes `unmined_transactions_in_blocks()`  test utility fn from mempool Storage test module and replaces calls to it with calls to the new test method on Network

* Fixes spelling mistake

* Adds `includes_tx_with_selected_dependencies` test

* fixes zip317 block construction issue

* Fixes vectors test

* Update zebra-node-services/src/mempool.rs

* restores `tip_rejected_exact` type

* updates affected tests

* Documents the new argument in `Storage::insert()`, updates outdated comment

* Update zebrad/src/components/mempool/storage/verified_set.rs

* fixes potential issue with calling buffered mempool's poll_ready() method without calling it.

* Avoids removing dependent transactions of transactions that have been mined onto the best chain.

* Updates `spent_utxos()` method documentation

* Avoids sorting getblocktemplate transactions in non-test compilations

* documents PendingOutputs struct

* Apply suggestions from code review

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

* cargo fmt

* Applies suggestions from code review

Avoids unnecessarily rejecting dependent transactions of randomly evicted mempool transactions.

Updates `TransactionDependencies::remove_all()` to omit provided transaction id from the list of removed transaction ids.

* Applies suggestions from code review.

* Adds minor comments

* Update zebrad/src/components/mempool/storage/verified_set.rs

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

* Remove an outdated comment (#9013)

---------

Co-authored-by: Marek <mail@marek.onl>
2024-11-18 12:16:21 +00:00
idky137 c26c3f2be1
add pub functionality for zaino (#8964)
* add pub functionality for zaino

* updated doc comment with review suggestion
2024-11-05 19:15:27 +00:00
Marek fef500a728
chore: Release v2.0.1 (#8979)
* Run `cargo update`

* chore: Release

* Update `release-crates-dry-run.sh`

* Update `ESTIMATED_RELEASE_HEIGHT`

* Update `CHANGELOG.md`

* Update `ESTIMATED_RELEASE_HEIGHT`
2024-10-30 11:41:41 -03:00
Marek f45f6f282c
chore: Release v2.0.0 (#8974)
* Update `CHANGELOG.md`

* Update EOS

* Update CHANGELOG.md

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

* Update `release crates` script

* chore: Release

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-10-25 22:52:19 +00:00
dependabot[bot] a941b67a57
build(deps): bump the prod group across 1 directory with 18 updates (#8958)
* build(deps): bump the prod group across 1 directory with 18 updates

Bumps the prod group with 15 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.18` | `4.5.20` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.5.0` | `2.6.0` |
| [serde](https://github.com/serde-rs/serde) | `1.0.210` | `1.0.211` |
| [futures](https://github.com/rust-lang/futures-rs) | `0.3.30` | `0.3.31` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.40.0` | `1.41.0` |
| [tower](https://github.com/tower-rs/tower) | `0.4.13` | `0.5.1` |
| [pin-project](https://github.com/taiki-e/pin-project) | `1.1.5` | `1.1.6` |
| [metrics](https://github.com/metrics-rs/metrics) | `0.23.0` | `0.24.0` |
| [hyper](https://github.com/hyperium/hyper) | `1.4.1` | `1.5.0` |
| [bytes](https://github.com/tokio-rs/bytes) | `1.7.2` | `1.8.0` |
| [metrics-exporter-prometheus](https://github.com/metrics-rs/metrics) | `0.15.3` | `0.16.0` |
| [once_cell](https://github.com/matklad/once_cell) | `1.19.0` | `1.20.2` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.128` | `1.0.132` |
| [primitive-types](https://github.com/paritytech/parity-common) | `0.12.2` | `0.13.1` |
| [serde_with](https://github.com/jonasbb/serde_with) | `3.9.0` | `3.11.0` |



Updates `clap` from 4.5.18 to 4.5.20
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.18...clap_complete-v4.5.20)

Updates `indexmap` from 2.5.0 to 2.6.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.5.0...2.6.0)

Updates `serde` from 1.0.210 to 1.0.211
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.210...v1.0.211)

Updates `futures` from 0.3.30 to 0.3.31
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.30...0.3.31)

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

Updates `tower` from 0.4.13 to 0.5.1
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](https://github.com/tower-rs/tower/compare/tower-0.4.13...tower-0.5.1)

Updates `pin-project` from 1.1.5 to 1.1.6
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.1.5...v1.1.6)

Updates `metrics` from 0.23.0 to 0.24.0
- [Changelog](https://github.com/metrics-rs/metrics/blob/main/release.toml)
- [Commits](https://github.com/metrics-rs/metrics/compare/metrics-v0.23.0...metrics-v0.24.0)

Updates `hyper` from 1.4.1 to 1.5.0
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v1.4.1...v1.5.0)

Updates `bytes` from 1.7.2 to 1.8.0
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.7.2...v1.8.0)

Updates `metrics-exporter-prometheus` from 0.15.3 to 0.16.0
- [Changelog](https://github.com/metrics-rs/metrics/blob/main/release.toml)
- [Commits](https://github.com/metrics-rs/metrics/compare/metrics-exporter-prometheus-v0.15.3...metrics-exporter-prometheus-v0.16.0)

Updates `once_cell` from 1.19.0 to 1.20.2
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.19.0...v1.20.2)

Updates `serde_json` from 1.0.128 to 1.0.132
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/1.0.128...1.0.132)

Updates `primitive-types` from 0.12.2 to 0.13.1
- [Commits](https://github.com/paritytech/parity-common/commits/primitive-types-v0.13.1)

Updates `serde_with` from 3.9.0 to 3.11.0
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v3.9.0...v3.11.0)

Updates `futures-util` from 0.3.30 to 0.3.31
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.30...0.3.31)

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

Updates `futures-core` from 0.3.30 to 0.3.31
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.30...0.3.31)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: tower
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: pin-project
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: metrics
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: hyper
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: metrics-exporter-prometheus
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: primitive-types
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde_with
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: futures-util
  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
- dependency-name: futures-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
...

Signed-off-by: dependabot[bot] <support@github.com>

* downgrade `primitive-types` and `tower`

* cargo vet

* update deny.toml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: Marek <mail@marek.onl>
2024-10-25 17:33:11 +00:00
Marek 0b1562d4b6
change: Set NU6 Mainnet activation height and network protocol version (#8960)
* Update docs for min network protocol versions

* Add a TODO for updating init net protocol version

* Update `CURRENT_NETWORK_PROTOCOL_VERSION`

* Add NU6 Mainnet activation height

* Extend docs for funding streams

* Extend tests for Mainnet funding streams

* Update snapshots
2024-10-24 20:15:32 +00:00
Arya 46c6b6eb38
fix(docs): Fix NU6-related documentation (#8949)
* replaces some potential panics with error in block verifier checks

* fixes outstanding documentation issues listed as examples in audit report

* fixes remaining TODOs in `parameters::network::subsidy` module.

* Addresses other TODOs added during NU6 implementation, fixes a TODO in `subsidy_is_valid()` about using the network slow start interval parameters when PoW is disabled.

* updates snapshot
2024-10-22 19:19:24 +00:00
Alfredo Garcia b1ffc89454
feat(rpc): Cookie auth system for the RPC endpoint (#8900)
* add a cookie auth system for the rpc endpoint

* fix rand import

* fixes based on cookie method research

* add and use `cookie_dir` config, rpc client changes

* add missing dependency

* add a enable_cookie auth option to config and use it in all tests

* get rid of the unauthenticated method

* change config in qa python tests to run unauthenticated

* change return types in cookie methods

* change comment

* fix(rpc): Refactor the cookie-based RPC authentication (#8940)

* Refactor the cookie-based RPC authentication

* Rephrase docs

* Apply suggestions from code review

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

---------

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

* clippy

---------

Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: Arya <aryasolhi@gmail.com>
2024-10-22 09:45:26 +00:00
Alfredo Garcia b89492168a
Release Zebra (`v2.0.0-rc.0`) (#8927)
* changelog

* add panic fix to changelog

* Apply suggestions from code review

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

* chore: Release

* update release-crates-dry-run workflow script

* fix command in release script

* change end of support

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-10-11 17:21:07 +00:00
Alfredo Garcia f2e7bc95ce
feat(regtest): Add regtest halving interval and port test (#8888)
* add halving interval to regtest and to custom testnet

* add nuparams.py rpc test

* fix inconsistency in nu6 name in rpc methods

* rename `halving_interval` to `pre_blossom_halving_interval` in the config

* make fixes

* Suggestion for "feat(regtest): Add regtest halving interval and port test" (#8894)

* adds `height_for_halving_index()` and `num_halvings()` fns

* avoid unnecessary panic

* avoid using constant pre/post blossom halving intervals in num_halvings()

* make regtest and testnet constant more private

* move `height_for_halving_index`

* fmt

* add a `funding_stream_address_change_interval` method

* add checked operations to `height_for_halving_index` fn

* add post_blossom interval as paramneters + other refactors

* rename function

* fix docs

* move constant

* Updates `new_regtest()` method to return a Testnet without funding streams, updates funding stream setter methods to set a flag indicating that parameters affecting the funding stream address period should be locked, updates the setter methods for parameters that affect the funding stream address period to panic if those parameters should be locked. (#8921)

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-10-10 18:26:54 +00:00
dependabot[bot] 841047aa37
build(deps): bump the prod group across 1 directory with 24 updates (#8899)
* build(deps): bump the prod group across 1 directory with 24 updates

Bumps the prod group with 24 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.13` | `4.5.18` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.3.0` | `2.5.0` |
| [serde](https://github.com/serde-rs/serde) | `1.0.204` | `1.0.210` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.39.2` | `1.40.0` |
| [tokio-stream](https://github.com/tokio-rs/tokio) | `0.1.15` | `0.1.16` |
| [tower](https://github.com/tower-rs/tower) | `0.4.13` | `0.5.0` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.63` | `1.0.64` |
| [hyper-util](https://github.com/hyperium/hyper-util) | `0.1.6` | `0.1.9` |
| [bytes](https://github.com/tokio-rs/bytes) | `1.7.1` | `1.7.2` |
| [regex](https://github.com/rust-lang/regex) | `1.10.6` | `1.11.0` |
| [insta](https://github.com/mitsuhiko/insta) | `1.39.0` | `1.40.0` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.122` | `1.0.128` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.11.0` | `3.13.0` |
| [prost](https://github.com/tokio-rs/prost) | `0.13.1` | `0.13.3` |
| [tonic](https://github.com/hyperium/tonic) | `0.12.1` | `0.12.3` |
| [tonic-build](https://github.com/hyperium/tonic) | `0.12.1` | `0.12.3` |
| [primitive-types](https://github.com/paritytech/parity-common) | `0.12.2` | `0.13.1` |
| [uint](https://github.com/paritytech/parity-common) | `0.9.5` | `0.10.0` |
| [tokio-util](https://github.com/tokio-rs/tokio) | `0.7.11` | `0.7.12` |
| [rlimit](https://github.com/Nugine/rlimit) | `0.10.1` | `0.10.2` |
| [tonic-reflection](https://github.com/hyperium/tonic) | `0.12.1` | `0.12.3` |
| [owo-colors](https://github.com/jam1garner/owo-colors) | `4.0.0` | `4.1.0` |
| [syn](https://github.com/dtolnay/syn) | `2.0.72` | `2.0.79` |
| [quote](https://github.com/dtolnay/quote) | `1.0.36` | `1.0.37` |



Updates `clap` from 4.5.13 to 4.5.18
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.13...clap_complete-v4.5.18)

Updates `indexmap` from 2.3.0 to 2.5.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.3.0...2.5.0)

Updates `serde` from 1.0.204 to 1.0.210
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.204...v1.0.210)

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

Updates `tokio-stream` from 0.1.15 to 0.1.16
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.15...tokio-stream-0.1.16)

Updates `tower` from 0.4.13 to 0.5.0
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](https://github.com/tower-rs/tower/compare/tower-0.4.13...tower-0.5.0)

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

Updates `hyper-util` from 0.1.6 to 0.1.9
- [Release notes](https://github.com/hyperium/hyper-util/releases)
- [Changelog](https://github.com/hyperium/hyper-util/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper-util/compare/v0.1.6...v0.1.9)

Updates `bytes` from 1.7.1 to 1.7.2
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.7.1...v1.7.2)

Updates `regex` from 1.10.6 to 1.11.0
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.6...1.11.0)

Updates `insta` from 1.39.0 to 1.40.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.39.0...1.40.0)

Updates `serde_json` from 1.0.122 to 1.0.128
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.122...1.0.128)

Updates `tempfile` from 3.11.0 to 3.13.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.11.0...v3.13.0)

Updates `prost` from 0.13.1 to 0.13.3
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Changelog](https://github.com/tokio-rs/prost/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.13.1...v0.13.3)

Updates `tonic` from 0.12.1 to 0.12.3
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.12.1...v0.12.3)

Updates `tonic-build` from 0.12.1 to 0.12.3
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.12.1...v0.12.3)

Updates `primitive-types` from 0.12.2 to 0.13.1
- [Commits](https://github.com/paritytech/parity-common/commits/primitive-types-v0.13.1)

Updates `uint` from 0.9.5 to 0.10.0
- [Commits](https://github.com/paritytech/parity-common/compare/uint-v0.9.5...uint-v0.10.0)

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

Updates `rlimit` from 0.10.1 to 0.10.2
- [Changelog](https://github.com/Nugine/rlimit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Nugine/rlimit/compare/v0.10.1...v0.10.2)

Updates `tonic-reflection` from 0.12.1 to 0.12.3
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.12.1...v0.12.3)

Updates `owo-colors` from 4.0.0 to 4.1.0
- [Commits](https://github.com/jam1garner/owo-colors/compare/v4.0.0...v4.1.0)

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

Updates `quote` from 1.0.36 to 1.0.37
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.36...1.0.37)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: tokio-stream
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tower
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: hyper-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tempfile
  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: tonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tonic-build
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: primitive-types
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: uint
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: tokio-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: rlimit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tonic-reflection
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: owo-colors
  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
- dependency-name: quote
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
...

Signed-off-by: dependabot[bot] <support@github.com>

* downgrade `primitive-types` and `tower`

* fix docs and deprecated stuff

* cargo vet updates

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-10-07 20:11:13 +00:00
Alfredo Garcia c8280d488f
feat(tests): Move the RPC tests framework from zcashd (#8866)
* move the rpc-tests framework from zcashd

* ignore pycache

* remove all tests from the list except getmininginfo

* iimprove a bit the readme

* change some env variable names

* add cache, add reindex test

* fix the paralell framework

* fix env variables

* change tests order

* update docs with env variable name change

* fix binary location

* reduce base config

* restore env var

* ignore stderr in the output
2024-09-20 16:36:20 +00:00
Alfredo Garcia c5d8eb5f83
fix(rpc): modify shutdown used in `stop()` (#8863)
* modify shutdown used in `stop()`

* use conditional compilation

* add note

* fix conditional compilation
2024-09-18 20:14:41 +00:00
Alfredo Garcia 3f94303bb2
feat(rpc): Add more fields to `getmininginfo` call (#8860)
* add additional fields to getmininginfo

* update openapi spec

* fix zebra-state standalone build

* make sure fields are not present when tip is 0
2024-09-18 11:05:25 +00:00
Alfredo Garcia 082cdad1c1
feat(rpc): Add a `generate` rpc method (#8849)
* implement `generate` rpc method

* update openapi

---------

Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-09-09 21:51:37 +00:00
Alfredo Garcia 554a37d20a
feat(rpc): Add a `stop` rpc method (#8839)
* add a `stop` rpc method

* add todo comment

* add a ticket number to the TODO

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

---------

Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-09-09 13:02:35 +00:00
Arya 6b95d271d8
fix(rpc): Return verification errors from `sendrawtransaction` RPC method (#8788)
* Adds a mempool request to wait for a transaction verification result and uses it in `sendrawtransaction` RPC method

* removes unnecessary clone

* fix clippy warnings

* returns verification errors for all `mempool::Queue` requests, removes `QueueRpc` request variant

* returns oneshot channel in mempool::Response::Queue

* updates a test vector to check for download or verification error in mempool::response::Queued result receiver

* Always require tokio as a dependency in zebra-node-services

* checks for closed channel errors in sendrawtransaction and updates a prop test to check that verification errors are propagated correctly
2024-08-30 20:09:10 +00:00
Arya 8b1be8846e
chore: Release v1.9.0 (#8734)
* Updates `EOS_PANIC_AFTER` end of support constant from 16 weeks to 14 weeks, so the Mainnet panic height is just before the second halving and end of the current dev fund.

* version bumps

* Updates CHANGELOG.md

* Updates changelog

* updates end of support time to 10 weeks

* Adds a note to the changelog about recovering after finalizing blocks from a fork

* Add new changes on main to CHANGELOG.md

* Updates ESTIMATED_RELEASE_HEIGHT

* Apply suggestions from code review

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* Update zebrad/src/components/sync/end_of_support.rs

---------

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2024-08-28 01:07:37 +00:00
Arya adde5c92f3
change(consensus/network): Updates `CURRENT_NETWORK_PROTOCOL_VERSION` and adds an NU6 activation height on Testnet (#8804)
* Updates CURRENT_NETWORK_PROTOCOL_VERSION and adds an NU6 activation height on Testnet

* Updates post-NU6 funding stream start height on Testnet

* updates snapshots

* updates snapshot
2024-08-27 23:24:33 +00:00
Tomek Piotrowski 37de457f2b
build(deps): make librustzcash crates workspace dependencies (#8792)
* build(deps): make librustzcash crates workspace dependencies

Fixes #8791

* add duplicated dependencies to deny.toml
2024-08-24 00:55:57 +00:00
Arya 9fbcb4ccd2
Updates ignored failure messages in lightwalletd_integration test (#8784) 2024-08-20 22:13:29 +00:00
Arya 83c6725e84
change(rpc): Add value pool balances to `getblockchaininfo` RPC method response (#8769)
* Moves `Zec` type out from behind feature flag

* Adds 'ValuePoolBalance` type

* Updates getblockchaininfo return type to a BoxFuture

* minor refactor

* Adds service request

* Adds real value balances to getblockchaininfo RPC response

* Updates snapshots and the suggested command for updating snapshots

* Uses generic error constructors wherever possible and removes outdated TODOs

* Updates prop tests to handle mock service requests
2024-08-16 19:54:44 +00:00
Alfredo Garcia 11b0833374
change(rpc): Modify `getblocksubsidy` for NU6 (#8742)
* set testnet activation height

* add lockbox object to getblocksubsidy RPC method

* add totals to getblocksubsidy

* fix comment

* use vectors instead of options for arrays

* update getblocksubsidy

* match zcashd output

* fix network consistency check for nu6 testnet

* doc changes

* fix typo

* change `is_nu6`

* Suggestion for "change(rpc): Modify `getblocksubsidy` for NU6" (#8766)

* refactors get_block_subsidy RPC method

* replaces a `Default` impl with derived impls

* removes NU6 testnet activation height

* updates snapshot test to use a configured Testnet for the post-NU6 getblocksubsidy output

* fixes snapshot test

* fixes snapshot

* Add a snapshot of getblockchaininfo with a future nu6 height

---------

Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
Co-authored-by: Arya <aryasolhi@gmail.com>
2024-08-15 22:51:14 +00:00
Alfredo Garcia a57557625a
deps(librustzcash): Upgrade zcash dependencies for NU6 (#8746)
* temporally upgrade zcash primitives to github main branch

* add allowed git repo in deny.toml

* add quotes to url

* fix denies

* change issue number for TODOs

* fix test name

* Apply suggestions from code review

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

---------

Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
Co-authored-by: Marek <mail@marek.onl>
2024-08-12 13:21:57 +00:00
dependabot[bot] 702ae54065
build(deps): bump the prod group with 8 updates (#8743)
* build(deps): bump the prod group with 8 updates

Bumps the prod group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.11` | `4.5.13` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.2.6` | `2.3.0` |
| [toml](https://github.com/toml-rs/toml) | `0.8.16` | `0.8.19` |
| [inferno](https://github.com/jonhoo/inferno) | `0.11.20` | `0.11.21` |
| [bytes](https://github.com/tokio-rs/bytes) | `1.6.1` | `1.7.1` |
| [regex](https://github.com/rust-lang/regex) | `1.10.5` | `1.10.6` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.121` | `1.0.122` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.10.1` | `3.11.0` |


Updates `clap` from 4.5.11 to 4.5.13
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.11...v4.5.13)

Updates `indexmap` from 2.2.6 to 2.3.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.2.6...2.3.0)

Updates `toml` from 0.8.16 to 0.8.19
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.16...toml-v0.8.19)

Updates `inferno` from 0.11.20 to 0.11.21
- [Changelog](https://github.com/jonhoo/inferno/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jonhoo/inferno/compare/v0.11.20...v0.11.21)

Updates `bytes` from 1.6.1 to 1.7.1
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.6.1...v1.7.1)

Updates `regex` from 1.10.5 to 1.10.6
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.5...1.10.6)

Updates `serde_json` from 1.0.121 to 1.0.122
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.121...v1.0.122)

Updates `tempfile` from 3.10.1 to 3.11.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.1...v3.11.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: inferno
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: regex
  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: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
...

Signed-off-by: dependabot[bot] <support@github.com>

* cargo vet

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-08-09 10:32:22 +00:00
Marek 82ded59a31
change: Track the balance of the deferred chain value pool (#8729)
* Addresses clippy lints

* checks network magic and returns early from `is_regtest()`

* Moves  `subsidy.rs` to `zebra-chain`, refactors funding streams into structs, splits them into pre/post NU6 funding streams, and adds them as a field on `testnet::Parameters`

* Replaces Vec with HashMap, adds `ConfiguredFundingStreams` type and conversion logic with constraints.

Minor refactors

* Empties recipients list

* Adds a comment on num_addresses calculation being invalid for configured Testnets, but that being okay since configured testnet parameters are checked when they're being built

* Documentation fixes, minor cleanup, renames a test, adds TODOs, and fixes test logic

* Removes unnecessary `ParameterSubsidy` impl for &Network, adds docs and TODOs

* Adds a "deferred" FundingStreamReceiver, adds a post-NU6 funding streams, updates the `miner_fees_are_valid()` and `subsidy_is_valid()` functions to check that the deferred pool contribution is valid and that there are no unclaimed block subsidies after NU6 activation, and adds some TODOs

* adds `lockbox_input_value()` fn

* Adds TODOs for linking to relevant ZIPs and updating height ranges

* Adds `nu6_lockbox_funding_stream` acceptance test

* updates funding stream values test to check post-NU6 funding streams too, adds Mainnet/Testnet NU6 activation heights, fixes lints/compilation issue

* Reverts Mainnet/Testnet NU6 activation height definitions, updates `test_funding_stream_values()` to use a configured testnet with the post-NU6 Mainnet funding streams height range

* reverts unnecessary refactor

* appease clippy

* Adds a test for `lockbox_input_value()`

* Applies suggestions from code review

* Fixes potential panic

* Fixes bad merge

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

* Updates acceptance test to check that invalid blocks are rejected

* Checks that the original valid block template at height 2 is accepted as a block submission

* Reverts changes for coinbase should balance exactly ZIP

* Add `Deferred` to `ValueBalance`

* Update snapshots

* Unrelated: Revise docs

* Add TODOs

* Stop recalculating the block subsidy

* Track deferred balances

* Support heights below slow start shift in halvings

* Fix `CheckpointVerifiedBlock` conversion in tests

* Allow deserialization of legacy `ValueBalance`s

* Simplify docs

* Fix warnings raised by Clippy

* Fix warnings raised by `cargo fmt`

* Update zebra-chain/src/block.rs

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

* Refactor docs around chain value pool changes

* updates test name

* Updates deferred pool funding stream name to "Lockbox", moves post-NU6 height ranges to constants, updates TODO

* Updates `get_block_subsidy()` RPC method to exclude lockbox funding stream from `fundingstreams` field

* Adds a TODO for updating `FundingStreamReceiver::name()` method docs

* Updates `FundingStreamRecipient::new()` to accept an iterator of items instead of an option of an iterator, updates a comment quoting the coinbase transaction balance consensus rule to note that the current code is inconsistent with the protocol spec, adds a TODO for updating the quote there once the protocol spec has been updated.

* Update zebra-consensus/src/checkpoint.rs

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

* Update docs for value balances

* Cleanup: Simplify getting info for FS receivers

* Avoid a panic when deserializing value balances

* Uses FPF Testnet address for post-NU6 testnet funding streams

* Updates the NU6 consensus branch id

* Update zebra-consensus/src/checkpoint.rs

* Bump the major database format version

* Add a database upgrade mark

* Fix tests after merge

* trigger GitHub actions

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-08-05 20:30:47 +00:00
Arya e56ee4c792
change(consensus): Add lockbox funding stream (#8694)
* Addresses clippy lints

* checks network magic and returns early from `is_regtest()`

* Moves  `subsidy.rs` to `zebra-chain`, refactors funding streams into structs, splits them into pre/post NU6 funding streams, and adds them as a field on `testnet::Parameters`

* Replaces Vec with HashMap, adds `ConfiguredFundingStreams` type and conversion logic with constraints.

Minor refactors

* Empties recipients list

* Adds a comment on num_addresses calculation being invalid for configured Testnets, but that being okay since configured testnet parameters are checked when they're being built

* Documentation fixes, minor cleanup, renames a test, adds TODOs, and fixes test logic

* Removes unnecessary `ParameterSubsidy` impl for &Network, adds docs and TODOs

* Adds a "deferred" FundingStreamReceiver, adds a post-NU6 funding streams, updates the `miner_fees_are_valid()` and `subsidy_is_valid()` functions to check that the deferred pool contribution is valid and that there are no unclaimed block subsidies after NU6 activation, and adds some TODOs

* adds `lockbox_input_value()` fn

* Adds TODOs for linking to relevant ZIPs and updating height ranges

* Adds `nu6_lockbox_funding_stream` acceptance test

* updates funding stream values test to check post-NU6 funding streams too, adds Mainnet/Testnet NU6 activation heights, fixes lints/compilation issue

* Reverts Mainnet/Testnet NU6 activation height definitions, updates `test_funding_stream_values()` to use a configured testnet with the post-NU6 Mainnet funding streams height range

* reverts unnecessary refactor

* appease clippy

* Adds a test for `lockbox_input_value()`

* Applies suggestions from code review

* Fixes potential panic

* Fixes bad merge

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

* Updates acceptance test to check that invalid blocks are rejected

* Checks that the original valid block template at height 2 is accepted as a block submission

* Reverts changes for coinbase should balance exactly ZIP

* updates test name

* Updates deferred pool funding stream name to "Lockbox", moves post-NU6 height ranges to constants, updates TODO

* Updates `get_block_subsidy()` RPC method to exclude lockbox funding stream from `fundingstreams` field

* Adds a TODO for updating `FundingStreamReceiver::name()` method docs

* Updates `FundingStreamRecipient::new()` to accept an iterator of items instead of an option of an iterator, updates a comment quoting the coinbase transaction balance consensus rule to note that the current code is inconsistent with the protocol spec, adds a TODO for updating the quote there once the protocol spec has been updated.

* Uses FPF Testnet address for post-NU6 testnet funding streams

* Updates the NU6 consensus branch id

---------

Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-08-01 23:22:36 +00:00
dependabot[bot] 7b0c1adb62
build(deps): bump the prod group with 5 updates (#8726)
* build(deps): bump the prod group with 5 updates

Bumps the prod group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.10` | `4.5.11` |
| [toml](https://github.com/toml-rs/toml) | `0.8.15` | `0.8.16` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.39.0` | `1.39.2` |
| [console-subscriber](https://github.com/tokio-rs/console) | `0.3.0` | `0.4.0` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.120` | `1.0.121` |


Updates `clap` from 4.5.10 to 4.5.11
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.10...clap_complete-v4.5.11)

Updates `toml` from 0.8.15 to 0.8.16
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.15...toml-v0.8.16)

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

Updates `console-subscriber` from 0.3.0 to 0.4.0
- [Release notes](https://github.com/tokio-rs/console/releases)
- [Changelog](https://github.com/tokio-rs/console/blob/main/release-plz.toml)
- [Commits](https://github.com/tokio-rs/console/compare/console-subscriber-v0.3.0...console-subscriber-v0.4.0)

Updates `serde_json` from 1.0.120 to 1.0.121
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.120...v1.0.121)

---
updated-dependencies:
- dependency-name: clap
  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: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: console-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
...

Signed-off-by: dependabot[bot] <support@github.com>

* cargo vet

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-07-30 00:15:26 +00:00
Arya 988dd55e48
change(network-params): Configurable Testnet funding streams (#8718)
* Addresses clippy lints

* checks network magic and returns early from `is_regtest()`

* Moves  `subsidy.rs` to `zebra-chain`, refactors funding streams into structs, splits them into pre/post NU6 funding streams, and adds them as a field on `testnet::Parameters`

* Replaces Vec with HashMap, adds `ConfiguredFundingStreams` type and conversion logic with constraints.

Minor refactors

* Empties recipients list

* Adds a comment on num_addresses calculation being invalid for configured Testnets, but that being okay since configured testnet parameters are checked when they're being built

* Documentation fixes, minor cleanup, renames a test, adds TODOs, and fixes test logic

* Removes unnecessary `ParameterSubsidy` impl for &Network, adds docs and TODOs

---------

Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-07-29 16:15:09 +00:00
Arya 14f473d1ea
Adds timeouts tonic clients in tests (#8724) 2024-07-27 15:20:47 +00:00
dependabot[bot] 4f6c4aeaa1
build(deps): bump the prod group across 1 directory with 8 updates (#8717)
* build(deps): bump the prod group across 1 directory with 8 updates

Bumps the prod group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.9` | `4.5.10` |
| [toml](https://github.com/toml-rs/toml) | `0.8.14` | `0.8.15` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.38.1` | `1.39.0` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.62` | `1.0.63` |
| [tonic](https://github.com/hyperium/tonic) | `0.12.0` | `0.12.1` |
| [tonic-build](https://github.com/hyperium/tonic) | `0.12.0` | `0.12.1` |
| [tonic-reflection](https://github.com/hyperium/tonic) | `0.12.0` | `0.12.1` |
| [syn](https://github.com/dtolnay/syn) | `2.0.71` | `2.0.72` |



Updates `clap` from 4.5.9 to 4.5.10
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.9...v4.5.10)

Updates `toml` from 0.8.14 to 0.8.15
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.14...toml-v0.8.15)

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

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

Updates `tonic` from 0.12.0 to 0.12.1
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.12.0...v0.12.1)

Updates `tonic-build` from 0.12.0 to 0.12.1
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.12.0...v0.12.1)

Updates `tonic-reflection` from 0.12.0 to 0.12.1
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.12.0...v0.12.1)

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

---
updated-dependencies:
- dependency-name: clap
  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: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tonic-build
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tonic-reflection
  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>

* cargo vet

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: Arya <aryasolhi@gmail.com>
2024-07-26 20:19:38 +00:00
Arya 6181ebe239
Addresses clippy lints (#8723) 2024-07-26 14:29:35 +00:00
dependabot[bot] 0fdd26431e
build(deps): bump the prod group across 1 directory with 15 updates (#8692)
* build(deps): bump the prod group across 1 directory with 15 updates

Bumps the prod group with 15 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.8` | `4.5.9` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.38.0` | `1.38.1` |
| [tinyvec](https://github.com/Lokathor/tinyvec) | `1.7.0` | `1.8.0` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.61` | `1.0.62` |
| [inferno](https://github.com/jonhoo/inferno) | `0.11.19` | `0.11.20` |
| [hyper](https://github.com/hyperium/hyper) | `0.14.29` | `1.3.1` |
| [metrics-exporter-prometheus](https://github.com/metrics-rs/metrics) | `0.15.1` | `0.15.3` |
| [prost](https://github.com/tokio-rs/prost) | `0.12.6` | `0.13.1` |
| [tonic](https://github.com/hyperium/tonic) | `0.11.0` | `0.12.0` |
| [vergen](https://github.com/rustyhorde/vergen) | `8.3.1` | `8.3.2` |
| [tonic-build](https://github.com/hyperium/tonic) | `0.11.0` | `0.12.0` |
| [serde_with](https://github.com/jonasbb/serde_with) | `3.8.3` | `3.9.0` |
| [bytes](https://github.com/tokio-rs/bytes) | `1.6.0` | `1.6.1` |
| [tonic-reflection](https://github.com/hyperium/tonic) | `0.11.0` | `0.12.0` |
| [syn](https://github.com/dtolnay/syn) | `2.0.69` | `2.0.71` |



Updates `clap` from 4.5.8 to 4.5.9
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.8...v4.5.9)

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

Updates `tinyvec` from 1.7.0 to 1.8.0
- [Changelog](https://github.com/Lokathor/tinyvec/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Lokathor/tinyvec/compare/v1.7.0...v1.8.0)

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

Updates `inferno` from 0.11.19 to 0.11.20
- [Changelog](https://github.com/jonhoo/inferno/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jonhoo/inferno/compare/v0.11.19...v0.11.20)

Updates `hyper` from 0.14.29 to 1.3.1
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.14.29...v1.3.1)

Updates `metrics-exporter-prometheus` from 0.15.1 to 0.15.3
- [Changelog](https://github.com/metrics-rs/metrics/blob/main/release.toml)
- [Commits](https://github.com/metrics-rs/metrics/compare/metrics-exporter-prometheus-v0.15.1...metrics-exporter-prometheus-v0.15.3)

Updates `prost` from 0.12.6 to 0.13.1
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Changelog](https://github.com/tokio-rs/prost/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.12.6...v0.13.1)

Updates `tonic` from 0.11.0 to 0.12.0
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.11.0...v0.12.0)

Updates `vergen` from 8.3.1 to 8.3.2
- [Release notes](https://github.com/rustyhorde/vergen/releases)
- [Commits](https://github.com/rustyhorde/vergen/commits)

Updates `tonic-build` from 0.11.0 to 0.12.0
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.11.0...v0.12.0)

Updates `serde_with` from 3.8.3 to 3.9.0
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v3.8.3...v3.9.0)

Updates `bytes` from 1.6.0 to 1.6.1
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.6.0...v1.6.1)

Updates `tonic-reflection` from 0.11.0 to 0.12.0
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.11.0...v0.12.0)

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

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tinyvec
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: inferno
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: hyper
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: prod
- dependency-name: metrics-exporter-prometheus
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: prost
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: tonic
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: vergen
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tonic-build
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde_with
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: tonic-reflection
  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>

* make changes for hyper 1.0

* unrelated clippy

* fix panic

* update denies

* add missing deny.toml

* add more denies for all features

* add timeout feature to tower in zebra-grpc

* cargo vet

* cargo vet prune

* codespell

* change waiting message

* remove hyper direct dependency from zebra-rpc

* fix doc typos

* simplify tracing endpoint

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-07-23 15:44:31 +00:00
Arya 6b9b9942bf
Adds `full_activation_list()` method and uses it in `getblockchaininfo` (#8699) 2024-07-20 00:40:29 +00:00
Marek f9066aedc0
add(chain): Add an NU6 network upgrade variant (#8693)
* Revise docs for network upgrades

* Add a NU6 enum variant

* Apply suggestions from code review

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

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-07-18 17:49:24 +00:00
Arya 14463a7f5d
add(rpc): Add a tonic server in zebra-rpc (#8674)
* adds a tonic server

* Adds a test stub, moves method impls to their own modules, minor fixes.

* Moves indexer rpc mod behind a feature, adds a config field for its listen address, and initializes the indexer RPC when zebrad starts

* Skips tonic_build() in zebra-rpc build script unless indexer-rpcs feature is selected, simplifies indexer.proto file, makes tonic deps optional

* formats zebra-rpc Cargo.toml

* Adds tokio_stream dependency, adds chain_tip_change field to IndexerRPC, and implements a simple version of the chain_tip_change RPC method

* passes latest chain tip to indexer::server::init from start cmd and  updates vectors test

* Update zebra-rpc/src/config.rs

* fixes a race condition in trusted_chain_sync_handles_forks_correctly
2024-07-16 12:25:31 +00:00
dependabot[bot] f3c2e1971d
build(deps): bump the prod group across 1 directory with 11 updates (#8664)
* build(deps): bump the prod group across 1 directory with 11 updates

Bumps the prod group with 11 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.7` | `4.5.8` |
| [serde](https://github.com/serde-rs/serde) | `1.0.203` | `1.0.204` |
| [tinyvec](https://github.com/Lokathor/tinyvec) | `1.6.1` | `1.7.0` |
| [metrics](https://github.com/metrics-rs/metrics) | `0.22.3` | `0.23.0` |
| [metrics-exporter-prometheus](https://github.com/metrics-rs/metrics) | `0.14.0` | `0.15.1` |
| [log](https://github.com/rust-lang/log) | `0.4.21` | `0.4.22` |
| [proptest-derive](https://github.com/proptest-rs/proptest) | `0.4.0` | `0.5.0` |
| [console-subscriber](https://github.com/tokio-rs/console) | `0.2.0` | `0.3.0` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.118` | `1.0.120` |
| [serde_with](https://github.com/jonasbb/serde_with) | `3.8.1` | `3.8.3` |
| [syn](https://github.com/dtolnay/syn) | `2.0.68` | `2.0.69` |



Updates `clap` from 4.5.7 to 4.5.8
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.7...v4.5.8)

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

Updates `tinyvec` from 1.6.1 to 1.7.0
- [Changelog](https://github.com/Lokathor/tinyvec/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Lokathor/tinyvec/compare/v1.6.1...v1.7.0)

Updates `metrics` from 0.22.3 to 0.23.0
- [Changelog](https://github.com/metrics-rs/metrics/blob/main/release.toml)
- [Commits](https://github.com/metrics-rs/metrics/compare/metrics-v0.22.3...metrics-v0.23.0)

Updates `metrics-exporter-prometheus` from 0.14.0 to 0.15.1
- [Changelog](https://github.com/metrics-rs/metrics/blob/main/release.toml)
- [Commits](https://github.com/metrics-rs/metrics/compare/metrics-exporter-prometheus-v0.14.0...metrics-exporter-prometheus-v0.15.1)

Updates `log` from 0.4.21 to 0.4.22
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.21...0.4.22)

Updates `proptest-derive` from 0.4.0 to 0.5.0
- [Release notes](https://github.com/proptest-rs/proptest/releases)
- [Changelog](https://github.com/proptest-rs/proptest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/proptest-rs/proptest/compare/0.4.0...proptest-derive-0.5.0)

Updates `console-subscriber` from 0.2.0 to 0.3.0
- [Release notes](https://github.com/tokio-rs/console/releases)
- [Changelog](https://github.com/tokio-rs/console/blob/main/release-plz.toml)
- [Commits](https://github.com/tokio-rs/console/compare/console-subscriber-v0.2.0...console-subscriber-v0.3.0)

Updates `serde_json` from 1.0.118 to 1.0.120
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.118...v1.0.120)

Updates `serde_with` from 3.8.1 to 3.8.3
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v3.8.1...v3.8.3)

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

---
updated-dependencies:
- dependency-name: clap
  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: tinyvec
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: metrics
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: metrics-exporter-prometheus
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: proptest-derive
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: console-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prod
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod
- dependency-name: serde_with
  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>

* remove multiple log levels to zebrad

* cargo vet update

* keep features for tracing

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-07-10 18:49:12 +00:00
Arya 4213e82a4f
change(rpc): Adds a TrustedChainSync struct for keeping up with Zebra's non-finalized best chain from a separate process (#8596)
* 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

* Adds a non-finalized read state syncer to zebra-rpc

* moves, removes, updates, or addresses TODOs

* reduces disk IO while waiting for the a new chain tip & updates the chain tip sender when the finalized tip has changed.

* Returns boxed errors from RpcRequestClient methods instead of color_eyre type

* Avoids resetting the non-finalized state when there's an error getting a block unless it has the missing block error code.

* Adds stub for acceptance test(s) and removes outdated TODO

* adds TODOs for testing

* Tests that `ChainTipChange` is updated when the non-finalized best chain grows

* adds a last_chain_tip_hash and uses a FuturesOrdered for getblock requests

* Fixes a pre-flush sync issue by using a secondary db instead of a read-only db

* Moves disk IO to blocking tasks

* Updates acceptance test to how forks are handled

* Checks synced read state for all of the expected blocks

* checks that there isn't a tip change until the best chain changes

* checks for chain tip changes in test

* run test without feature

* fixes lint

* Fixes compilation/test issues

* Adds docs / comments, moves HexData out from behind the getblocktemplate-rpcs feature flag, moves test behind the mining feature flag.

* Fixes lints

* removes syncer and rpc-syncer features

* Fixes test on Windows, applies suggestions from code review

* Updates `POLL_DELAY` documentation

* Updates method docs

* Fixes a test bug

* use rpc-client feature in zebrad production code

* use rpc-client feature in zebra-node-services for building zebra-rpc crate

---------

Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-07-09 14:15:47 +00:00
Marek 0d8b10b95f
chore: Release v1.8.0 (#8655)
* Update `CHANGELOG.md`

* chore: Release

* Update versions in the release dry-run workflow

* Update EOS

* Estimate release height to ~ upcoming Tuesday

* Apply suggestions from code review

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

* Add a "Summary" title to the changelog

* Remove the summary title

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-07-02 16:46:49 +00:00
Marek d1a9004b32
change(chain): Drop transactions with unpaid actions (#8638)
* Set unpaid action limit to 0

* Update changelog

* Apply suggestions from code review

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

* Rephrase a note on mempool checks

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2024-06-25 22:39:51 +00:00
Arya fb424220a8
fix(tests): Address port conflict issues and enable related Windows tests (#8624)
* Uses an OS-assigned port when testing rpc_server_spawn

* reads port from logs and enables 2 acceptance tests on Windows

* generalizes read listen addr from logs fn and re-enables another test

* updates zebra-grpc snapshot tests to use OS-assigned port

* Re-enable grpc vectors tests on Windows while avoiding port conflicts

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-06-21 14:32:33 +00:00