2019-08-29 14:46:54 -07:00
|
|
|
[package]
|
|
|
|
name = "zebra-consensus"
|
2024-10-25 15:52:19 -07:00
|
|
|
version = "1.0.0-beta.41"
|
2019-10-08 09:25:59 -07:00
|
|
|
authors = ["Zcash Foundation <zebra@zfnd.org>"]
|
2023-06-13 01:46:01 -07:00
|
|
|
description = "Implementation of Zcash consensus checks"
|
2019-10-08 09:25:59 -07:00
|
|
|
license = "MIT OR Apache-2.0"
|
2023-06-13 01:46:01 -07:00
|
|
|
repository = "https://github.com/ZcashFoundation/zebra"
|
Enforce Rust edition 2021 (#3332)
* Rust edition 2021: zebra-network, cargo fix --edition and clippy --fix
* Rust edition 2021: zebra-chain, cargo fix --edition
* Rust edition 2021: tower-batch, cargo fix --edition
* Rust edition 2021: tower-fallback, cargo fix --edition
* Rust edition 2021: zebra-client, cargo fix --edition
* Rust edition 2021: zebra-consensus, cargo fix --edition
* Rust edition 2021: zebra-rpc, cargo fix --edition
* Rust edition 2021: zebra-state, cargo fix --edition
* Rust edition 2021: zebra-state, cargo fix --edition
* Rust edition 2021: zebra-test, cargo fix --edition
* Rust edition 2021: zebra-utils, cargo fix --edition
* Rust edition 2021: zebrad, cargo fix --edition
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-14 04:10:18 -08:00
|
|
|
edition = "2021"
|
2019-08-29 14:46:54 -07:00
|
|
|
|
2023-06-13 01:46:01 -07:00
|
|
|
readme = "../README.md"
|
|
|
|
homepage = "https://zfnd.org/zebra/"
|
|
|
|
# crates.io is limited to 5 keywords and categories
|
|
|
|
keywords = ["zebra", "zcash"]
|
|
|
|
# Must be one of <https://crates.io/category_slugs>
|
|
|
|
categories = ["asynchronous", "cryptography::cryptocurrencies"]
|
|
|
|
|
Send crawled transaction IDs to downloader (#2801)
* Rename type parameter to be more explicit
Replace the single letter with a proper name.
* Remove imports for `Request` and `Response`
The type names will conflict with the ones for the mempool service.
* Attach `Mempool` service to the `Crawler`
Add a field to the `Crawler` type to store a way to access the `Mempool`
service.
* Forward crawled transactions to downloader
The crawled transactions are now sent to the transaction downloader and
verifier, to be included in the mempool.
* Derive `Eq` and `PartialEq` for `mempool::Request`
Make it simpler to use the `MockService::expect_request` method.
* Test if crawled transactions are downloaded
Create some dummy crawled transactions, and let the crawler discover
them. Then check if they are forwarded to the mempool to be downloaded
and verified.
* Don't send empty transaction ID list to downloader
Ignore response from peers that don't provide any crawled transactions.
* Log errors when forwarding crawled transaction IDs
Calling the Mempool service should not fail, so if an error happens it
should be visible. However, errors when downloading individual
transactions can happen from time to time, so there's no need for them
to be very visible.
* Document existing `mempool::Crawler` test
Provide some depth as to what the test expect from the crawler's
behavior.
* Refactor to create `setup_crawler` helper function
Make it easier to reuse the common test setup code.
* Simplify code to expect requests
Now that `zebra_network::Request` implement `Eq`, the call can be
simplified into `expect_request`.
* Refactor to create `respond_with_transaction_ids`
A helper function that checks for a network crawl request and responds
with the given list of crawled transaction IDs.
* Refactor to create `crawler_iterator` helper
A function to intercept and respond to the fanned-out requests sent
during a single crawl iteration.
* Refactor to create `respond_to_queue_request`
Reduce the repeated code necessary to intercept and reply to a request
for queuing transactions to be downloaded.
* Add `respond_to_queue_request_with_error` helper
Intercepts a mempool request to queue transactions to be downloaded, and
responds with an error, simulating an internal problem in the mempool
service implementation.
* Derive `Arbitrary` for `NetworkUpgrade`
This is required for deriving `Arbitrary` for some error types.
* Derive `Arbitrary` for `TransactionError`
Allow random transaction errors to be generated for property tests.
* Derive `Arbitrary` for `MempoolError`
Allow random Mempool errors to be generated for property tests.
* Test if errors don't stop the mempool crawler
The crawler should be robust enough to continue operating even if the
mempool service fails to download transactions or even fails to handle
requests to enqueue transactions.
* Reduce the log level for download errors
They should happen regularly, so there's no need to have them with a
high visibility level.
Co-authored-by: teor <teor@riseup.net>
* Stop crawler if service stops
If `Mempool::poll_ready` returns an error, it's because the mempool
service has stopped and can't handle any requests, so the crawler should
stop as well.
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2021-10-04 17:55:42 -07:00
|
|
|
[features]
|
2024-10-08 05:28:16 -07:00
|
|
|
#default = []
|
|
|
|
default = ["tx-v6"]
|
2023-01-16 13:39:47 -08:00
|
|
|
|
|
|
|
# Production features that activate extra dependencies, or extra features in dependencies
|
|
|
|
|
2023-04-13 01:42:17 -07:00
|
|
|
progress-bar = [
|
|
|
|
"howudoin",
|
|
|
|
"zebra-state/progress-bar",
|
|
|
|
]
|
|
|
|
|
2024-01-11 06:41:01 -08:00
|
|
|
# Mining RPC support
|
2023-01-11 15:39:51 -08:00
|
|
|
getblocktemplate-rpcs = [
|
2023-01-16 13:39:47 -08:00
|
|
|
"zebra-state/getblocktemplate-rpcs",
|
|
|
|
"zebra-node-services/getblocktemplate-rpcs",
|
|
|
|
"zebra-chain/getblocktemplate-rpcs",
|
2023-01-11 15:39:51 -08:00
|
|
|
]
|
2023-01-16 13:39:47 -08:00
|
|
|
|
|
|
|
# Test-only features
|
2022-03-30 11:23:55 -07:00
|
|
|
proptest-impl = ["proptest", "proptest-derive", "zebra-chain/proptest-impl", "zebra-state/proptest-impl"]
|
Send crawled transaction IDs to downloader (#2801)
* Rename type parameter to be more explicit
Replace the single letter with a proper name.
* Remove imports for `Request` and `Response`
The type names will conflict with the ones for the mempool service.
* Attach `Mempool` service to the `Crawler`
Add a field to the `Crawler` type to store a way to access the `Mempool`
service.
* Forward crawled transactions to downloader
The crawled transactions are now sent to the transaction downloader and
verifier, to be included in the mempool.
* Derive `Eq` and `PartialEq` for `mempool::Request`
Make it simpler to use the `MockService::expect_request` method.
* Test if crawled transactions are downloaded
Create some dummy crawled transactions, and let the crawler discover
them. Then check if they are forwarded to the mempool to be downloaded
and verified.
* Don't send empty transaction ID list to downloader
Ignore response from peers that don't provide any crawled transactions.
* Log errors when forwarding crawled transaction IDs
Calling the Mempool service should not fail, so if an error happens it
should be visible. However, errors when downloading individual
transactions can happen from time to time, so there's no need for them
to be very visible.
* Document existing `mempool::Crawler` test
Provide some depth as to what the test expect from the crawler's
behavior.
* Refactor to create `setup_crawler` helper function
Make it easier to reuse the common test setup code.
* Simplify code to expect requests
Now that `zebra_network::Request` implement `Eq`, the call can be
simplified into `expect_request`.
* Refactor to create `respond_with_transaction_ids`
A helper function that checks for a network crawl request and responds
with the given list of crawled transaction IDs.
* Refactor to create `crawler_iterator` helper
A function to intercept and respond to the fanned-out requests sent
during a single crawl iteration.
* Refactor to create `respond_to_queue_request`
Reduce the repeated code necessary to intercept and reply to a request
for queuing transactions to be downloaded.
* Add `respond_to_queue_request_with_error` helper
Intercepts a mempool request to queue transactions to be downloaded, and
responds with an error, simulating an internal problem in the mempool
service implementation.
* Derive `Arbitrary` for `NetworkUpgrade`
This is required for deriving `Arbitrary` for some error types.
* Derive `Arbitrary` for `TransactionError`
Allow random transaction errors to be generated for property tests.
* Derive `Arbitrary` for `MempoolError`
Allow random Mempool errors to be generated for property tests.
* Test if errors don't stop the mempool crawler
The crawler should be robust enough to continue operating even if the
mempool service fails to download transactions or even fails to handle
requests to enqueue transactions.
* Reduce the log level for download errors
They should happen regularly, so there's no need to have them with a
high visibility level.
Co-authored-by: teor <teor@riseup.net>
* Stop crawler if service stops
If `Mempool::poll_ready` returns an error, it's because the mempool
service has stopped and can't handle any requests, so the crawler should
stop as well.
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2021-10-04 17:55:42 -07:00
|
|
|
|
2024-10-02 01:37:23 -07:00
|
|
|
# Support for transaction version 6
|
|
|
|
tx-v6 = [
|
|
|
|
"zebra-state/tx-v6",
|
|
|
|
"zebra-chain/tx-v6"
|
|
|
|
]
|
|
|
|
|
2019-08-29 14:46:54 -07:00
|
|
|
[dependencies]
|
2023-09-11 10:56:41 -07:00
|
|
|
blake2b_simd = "1.0.2"
|
2023-04-18 03:11:38 -07:00
|
|
|
bellman = "0.14.0"
|
|
|
|
bls12_381 = "0.8.0"
|
|
|
|
halo2 = { package = "halo2_proofs", version = "0.3.0" }
|
|
|
|
jubjub = "0.10.0"
|
2023-06-27 08:32:30 -07:00
|
|
|
rand = "0.8.5"
|
2024-04-16 19:20:28 -07:00
|
|
|
rayon = "1.10.0"
|
2021-11-19 15:02:56 -08:00
|
|
|
|
2024-04-19 16:23:57 -07:00
|
|
|
chrono = { version = "0.4.38", default-features = false, features = ["clock", "std"] }
|
2021-11-19 15:02:56 -08:00
|
|
|
lazy_static = "1.4.0"
|
2024-10-25 10:33:11 -07:00
|
|
|
once_cell = "1.20.2"
|
|
|
|
serde = { version = "1.0.211", features = ["serde_derive"] }
|
2020-07-23 20:17:39 -07:00
|
|
|
|
2024-10-25 10:33:11 -07:00
|
|
|
futures = "0.3.31"
|
2023-04-02 18:33:08 -07:00
|
|
|
futures-util = "0.3.28"
|
2024-10-25 10:33:11 -07:00
|
|
|
metrics = "0.24.0"
|
2024-10-07 13:11:13 -07:00
|
|
|
thiserror = "1.0.64"
|
2024-10-25 10:33:11 -07:00
|
|
|
tokio = { version = "1.41.0", features = ["time", "sync", "tracing", "rt-multi-thread"] }
|
2022-06-21 10:12:19 -07:00
|
|
|
tower = { version = "0.4.13", features = ["timeout", "util", "buffer"] }
|
2023-10-16 13:13:38 -07:00
|
|
|
tracing = "0.1.39"
|
2021-02-17 02:01:32 -08:00
|
|
|
tracing-futures = "0.2.5"
|
2020-06-11 02:49:32 -07:00
|
|
|
|
2024-08-23 17:55:57 -07:00
|
|
|
sapling-crypto.workspace = true
|
|
|
|
orchard.workspace = true
|
2021-11-25 08:26:32 -08:00
|
|
|
|
2024-08-23 17:55:57 -07:00
|
|
|
zcash_proofs = { workspace = true, features = ["multicore" ] }
|
2023-10-24 16:27:24 -07:00
|
|
|
wagyu-zcash-parameters = "0.2.0"
|
2021-11-19 15:02:56 -08:00
|
|
|
|
2024-10-25 15:52:19 -07:00
|
|
|
tower-fallback = { path = "../tower-fallback/", version = "0.2.41-beta.17" }
|
|
|
|
tower-batch-control = { path = "../tower-batch-control/", version = "0.2.41-beta.17" }
|
2021-11-19 15:02:56 -08:00
|
|
|
|
2024-10-25 15:52:19 -07:00
|
|
|
zebra-script = { path = "../zebra-script", version = "1.0.0-beta.41" }
|
|
|
|
zebra-state = { path = "../zebra-state", version = "1.0.0-beta.41" }
|
|
|
|
zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.41" }
|
|
|
|
zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.41" }
|
2020-07-08 04:22:36 -07:00
|
|
|
|
2023-04-13 01:42:17 -07:00
|
|
|
# prod feature progress-bar
|
|
|
|
howudoin = { version = "0.1.2", optional = true }
|
|
|
|
|
2023-01-16 13:39:47 -08:00
|
|
|
# Test-only dependencies
|
2023-11-14 17:03:57 -08:00
|
|
|
proptest = { version = "1.4.0", optional = true }
|
2024-07-10 11:49:12 -07:00
|
|
|
proptest-derive = { version = "0.5.0", optional = true }
|
Send crawled transaction IDs to downloader (#2801)
* Rename type parameter to be more explicit
Replace the single letter with a proper name.
* Remove imports for `Request` and `Response`
The type names will conflict with the ones for the mempool service.
* Attach `Mempool` service to the `Crawler`
Add a field to the `Crawler` type to store a way to access the `Mempool`
service.
* Forward crawled transactions to downloader
The crawled transactions are now sent to the transaction downloader and
verifier, to be included in the mempool.
* Derive `Eq` and `PartialEq` for `mempool::Request`
Make it simpler to use the `MockService::expect_request` method.
* Test if crawled transactions are downloaded
Create some dummy crawled transactions, and let the crawler discover
them. Then check if they are forwarded to the mempool to be downloaded
and verified.
* Don't send empty transaction ID list to downloader
Ignore response from peers that don't provide any crawled transactions.
* Log errors when forwarding crawled transaction IDs
Calling the Mempool service should not fail, so if an error happens it
should be visible. However, errors when downloading individual
transactions can happen from time to time, so there's no need for them
to be very visible.
* Document existing `mempool::Crawler` test
Provide some depth as to what the test expect from the crawler's
behavior.
* Refactor to create `setup_crawler` helper function
Make it easier to reuse the common test setup code.
* Simplify code to expect requests
Now that `zebra_network::Request` implement `Eq`, the call can be
simplified into `expect_request`.
* Refactor to create `respond_with_transaction_ids`
A helper function that checks for a network crawl request and responds
with the given list of crawled transaction IDs.
* Refactor to create `crawler_iterator` helper
A function to intercept and respond to the fanned-out requests sent
during a single crawl iteration.
* Refactor to create `respond_to_queue_request`
Reduce the repeated code necessary to intercept and reply to a request
for queuing transactions to be downloaded.
* Add `respond_to_queue_request_with_error` helper
Intercepts a mempool request to queue transactions to be downloaded, and
responds with an error, simulating an internal problem in the mempool
service implementation.
* Derive `Arbitrary` for `NetworkUpgrade`
This is required for deriving `Arbitrary` for some error types.
* Derive `Arbitrary` for `TransactionError`
Allow random transaction errors to be generated for property tests.
* Derive `Arbitrary` for `MempoolError`
Allow random Mempool errors to be generated for property tests.
* Test if errors don't stop the mempool crawler
The crawler should be robust enough to continue operating even if the
mempool service fails to download transactions or even fails to handle
requests to enqueue transactions.
* Reduce the log level for download errors
They should happen regularly, so there's no need to have them with a
high visibility level.
Co-authored-by: teor <teor@riseup.net>
* Stop crawler if service stops
If `Mempool::poll_ready` returns an error, it's because the mempool
service has stopped and can't handle any requests, so the crawler should
stop as well.
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2021-10-04 17:55:42 -07:00
|
|
|
|
2020-07-08 14:23:00 -07:00
|
|
|
[dev-dependencies]
|
2024-03-21 11:23:41 -07:00
|
|
|
color-eyre = "0.6.3"
|
2022-08-03 16:42:50 -07:00
|
|
|
# This is a transitive dependency via color-eyre.
|
|
|
|
# Enable a feature that makes tinyvec compile much faster.
|
2024-07-23 08:44:31 -07:00
|
|
|
tinyvec = { version = "1.8.0", features = ["rustc_1_55"] }
|
2022-08-03 16:42:50 -07:00
|
|
|
|
2021-11-16 19:26:15 -08:00
|
|
|
hex = "0.4.3"
|
2024-02-14 04:24:33 -08:00
|
|
|
num-integer = "0.1.46"
|
2023-11-14 17:03:57 -08:00
|
|
|
proptest = "1.4.0"
|
2024-07-10 11:49:12 -07:00
|
|
|
proptest-derive = "0.5.0"
|
2022-04-28 00:08:30 -07:00
|
|
|
spandoc = "0.2.2"
|
2022-06-14 23:43:20 -07:00
|
|
|
|
2024-10-25 10:33:11 -07:00
|
|
|
tokio = { version = "1.41.0", features = ["full", "tracing", "test-util"] }
|
2022-05-31 20:53:51 -07:00
|
|
|
tracing-error = "0.2.0"
|
2023-11-26 19:26:29 -08:00
|
|
|
tracing-subscriber = "0.3.18"
|
2020-07-08 14:23:00 -07:00
|
|
|
|
2024-10-25 15:52:19 -07:00
|
|
|
zebra-state = { path = "../zebra-state", version = "1.0.0-beta.41", features = ["proptest-impl"] }
|
|
|
|
zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.41", features = ["proptest-impl"] }
|
|
|
|
zebra-test = { path = "../zebra-test/", version = "1.0.0-beta.41" }
|