2020-06-02 16:16:17 -07:00
|
|
|
[package]
|
|
|
|
name = "zebra-state"
|
2022-10-11 18:17:55 -07:00
|
|
|
version = "1.0.0-beta.16"
|
2020-06-02 16:16:17 -07:00
|
|
|
authors = ["Zcash Foundation <zebra@zfnd.org>"]
|
|
|
|
license = "MIT OR Apache-2.0"
|
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"
|
2020-06-02 16:16:17 -07:00
|
|
|
|
2021-07-27 17:01:19 -07:00
|
|
|
[features]
|
2022-03-30 11:23:55 -07:00
|
|
|
proptest-impl = ["proptest", "proptest-derive", "zebra-test", "zebra-chain/proptest-impl"]
|
2022-10-20 23:01:29 -07:00
|
|
|
getblocktemplate-rpcs = []
|
2020-06-02 16:16:17 -07:00
|
|
|
|
|
|
|
[dependencies]
|
2022-03-06 18:07:25 -08:00
|
|
|
bincode = "1.3.3"
|
2022-09-02 14:11:18 -07:00
|
|
|
chrono = { version = "0.4.22", default-features = false, features = ["clock", "std"] }
|
2021-09-22 16:34:09 -07:00
|
|
|
dirs = "4.0.0"
|
2022-03-06 18:07:25 -08:00
|
|
|
displaydoc = "0.2.3"
|
2022-10-21 12:02:04 -07:00
|
|
|
futures = "0.3.25"
|
2021-03-04 02:01:44 -08:00
|
|
|
hex = "0.4.3"
|
change(state): Write non-finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5257)
* Add a new block commit task and channels, that don't do anything yet
* Add last_block_hash_sent to the state service, to avoid database accesses
* Update last_block_hash_sent regardless of commit errors
* Rename a field to StateService.max_queued_finalized_height
* Commit finalized blocks to the state in a separate task
* Check for panics in the block write task
* Wait for the block commit task in tests, and check for errors
* Always run a proptest that sleeps once
* Add extra debugging to state shutdowns
* Work around a RocksDB shutdown bug
* Close the finalized block channel when we're finished with it
* Only reset state queue once per error
* Update some TODOs
* Add a module doc comment
* Drop channels and check for closed channels in the block commit task
* Close state channels and tasks on drop
* Remove some duplicate fields across StateService and ReadStateService
* Try tweaking the shutdown steps
* Update and clarify some comments
* Clarify another comment
* Don't try to cancel RocksDB background work on drop
* Fix up some comments
* Remove some duplicate code
* Remove redundant workarounds for shutdown issues
* Remode a redundant channel close in the block commit task
* Remove a mistaken `!force` shutdown condition
* Remove duplicate force-shutdown code and explain it better
* Improve RPC error logging
* Wait for chain tip updates in the RPC tests
* Wait 2 seconds for chain tip updates before skipping them
* Remove an unnecessary block_in_place()
* Fix some test error messages that were changed by earlier fixes
* Expand some comments, fix typos
Co-authored-by: Marek <mail@marek.onl>
* Actually drop children of failed blocks
* Explain why we drop descendants of failed blocks
* Clarify a comment
* Wait for chain tip updates in a failing test on macOS
* Clean duplicate finalized blocks when the non-finalized state activates
* Send an error when receiving a duplicate finalized block
* Update checkpoint block behaviour, document its consensus rule
* Wait for chain tip changes in inbound_block_height_lookahead_limit test
* Wait for the genesis block to commit in the fake peer set mempool tests
* Disable unreliable mempool verification check in the send transaction test
* Appease rustfmt
* Use clear_finalized_block_queue() everywhere that blocks are dropped
* Document how Finalized and NonFinalized clones are different
* sends non-finalized blocks to the block write task
* passes ZebraDb to commit_new_chain, commit_block, and no_duplicates_in_finalized_chain instead of FinalizedState
* Update zebra-state/src/service/write.rs
Co-authored-by: teor <teor@riseup.net>
* updates comments, renames send_process_queued, other minor cleanup
* update assert_block_can_be_validated comment
* removes `mem` field from StateService
* removes `disk` field from StateService and updates block_iter to use `ZebraDb` instead of the finalized state
* updates tests that use the disk to use read_service.db instead
* moves best_tip to a read fn and returns finalized & non-finalized states from setup instead of the state service
* changes `contextual_validity` to get the network from the finalized_state instead of another param
* swaps out StateService with FinalizedState and NonFinalizedState in tests
* adds NotReadyToBeCommitted error and returns it from validate_and_commit when a blocks parent hash is not in any chain
* removes NonFinalizedWriteCmd and calls, moves update_latest_channels above rsp_tx.send
* makes parent_errors_map an indexmap
* clears non-finalized block queue when the receiver is dropped and when the StateService is being dropped
* sends non-finalized blocks to the block write task
* passes ZebraDb to commit_new_chain, commit_block, and no_duplicates_in_finalized_chain instead of FinalizedState
* updates comments, renames send_process_queued, other minor cleanup
* Update zebra-state/src/service/write.rs
Co-authored-by: teor <teor@riseup.net>
* update assert_block_can_be_validated comment
* removes `mem` field from StateService
* removes `disk` field from StateService and updates block_iter to use `ZebraDb` instead of the finalized state
* updates tests that use the disk to use read_service.db instead
* moves best_tip to a read fn and returns finalized & non-finalized states from setup instead of the state service
* changes `contextual_validity` to get the network from the finalized_state instead of another param
* swaps out StateService with FinalizedState and NonFinalizedState in tests
* adds NotReadyToBeCommitted error and returns it from validate_and_commit when a blocks parent hash is not in any chain
* removes NonFinalizedWriteCmd and calls, moves update_latest_channels above rsp_tx.send
* makes parent_errors_map an indexmap
* clears non-finalized block queue when the receiver is dropped and when the StateService is being dropped
* removes duplicate field definitions on StateService that were a result of a bad merge
* update NotReadyToBeCommitted error message
* Appear rustfmt
* Fix doc links
* Rename a function to initial_contextual_validity()
* Do error tasks on Err, and success tasks on Ok
* Simplify parent_error_map truncation
* Rewrite best_tip() to use tip()
* Rename latest_mem() to latest_non_finalized_state()
```sh
fastmod latest_mem latest_non_finalized_state zebra*
cargo fmt --all
```
* Simplify latest_non_finalized_state() using a new WatchReceiver API
* Expand some error messages
* Send the result after updating the channels, and document why
* wait for chain_tip_update before cancelling download in mempool_cancel_mined
* adds `sent_non_finalized_block_hashes` field to StateService
* adds batched sent_hash insertions and checks sent hashes in queue_and_commit_non_finalized before adding a block to the queue
* check that the `curr_buf` in SentHashes is not empty before pushing it to the `sent_bufs`
* Apply suggestions from code review
Co-authored-by: teor <teor@riseup.net>
* Fix rustfmt
* Check for finalized block heights using zs_contains()
* adds known_utxos field to SentHashes
* updates comment on SentHashes.add method
* Apply suggestions from code review
Co-authored-by: teor <teor@riseup.net>
* return early when there's a duplicate hash in QueuedBlocks.queue instead of panicking
* Make finalized UTXOs near the final checkpoint available for full block verification
* Replace a checkpoint height literal with the actual config
* Update mainnet and testnet checkpoints - 7 October 2022
* Fix some state service init arguments
* Allow more lookahead in the downloader, but less lookahead in the syncer
* Add the latest config to the tests, and fix the latest config check
* Increase the number of finalized blocks checked for non-finalized block UTXO spends
* fix(log): reduce verbose logs for block commits (#5348)
* Remove some verbose block write channel logs
* Only warn about tracing endpoint if the address is actually set
* Use CloneError instead of formatting a non-cloneable error
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Increase block verify timeout
* Work around a known block timeout bug by using a shorter timeout
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-10-11 12:25:45 -07:00
|
|
|
indexmap = "1.9.1"
|
2022-09-20 19:53:22 -07:00
|
|
|
itertools = "0.10.5"
|
2020-07-23 18:47:48 -07:00
|
|
|
lazy_static = "1.4.0"
|
2022-09-26 21:19:01 -07:00
|
|
|
metrics = "0.20.1"
|
2022-02-21 17:17:21 -08:00
|
|
|
mset = "0.1.0"
|
2022-08-01 02:07:08 -07:00
|
|
|
regex = "1.6.0"
|
2022-04-07 22:43:02 -07:00
|
|
|
rlimit = "0.8.3"
|
2022-09-05 11:58:45 -07:00
|
|
|
rocksdb = { version = "0.19.0", default_features = false, features = ["lz4"] }
|
2022-10-22 15:31:45 -07:00
|
|
|
serde = { version = "1.0.147", features = ["serde_derive"] }
|
2022-01-14 07:11:23 -08:00
|
|
|
tempfile = "3.3.0"
|
2022-09-29 04:37:48 -07:00
|
|
|
thiserror = "1.0.37"
|
2022-06-14 23:43:20 -07:00
|
|
|
|
2022-07-22 09:19:11 -07:00
|
|
|
rayon = "1.5.3"
|
2022-09-28 17:22:13 -07:00
|
|
|
tokio = { version = "1.21.2", features = ["sync", "tracing"] }
|
2022-06-21 10:12:19 -07:00
|
|
|
tower = { version = "0.4.13", features = ["buffer", "util"] }
|
2022-10-12 23:46:27 -07:00
|
|
|
tracing = "0.1.37"
|
2021-11-16 11:47:54 -08:00
|
|
|
|
|
|
|
zebra-chain = { path = "../zebra-chain" }
|
2021-07-27 17:01:19 -07:00
|
|
|
zebra-test = { path = "../zebra-test/", optional = true }
|
|
|
|
|
2022-07-22 09:19:11 -07:00
|
|
|
proptest = { version = "0.10.1", optional = true }
|
|
|
|
proptest-derive = { version = "0.3.0", optional = true }
|
|
|
|
|
2020-06-02 16:16:17 -07:00
|
|
|
[dev-dependencies]
|
2022-09-26 15:23:59 -07:00
|
|
|
color-eyre = "0.6.2"
|
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.
|
2022-08-04 15:03:24 -07:00
|
|
|
tinyvec = { version = "1.6.0", features = ["rustc_1_55"] }
|
2022-08-03 16:42:50 -07:00
|
|
|
|
2022-09-22 13:22:22 -07:00
|
|
|
once_cell = "1.15.0"
|
2022-04-28 00:08:30 -07:00
|
|
|
spandoc = "0.2.2"
|
2022-03-18 13:30:16 -07:00
|
|
|
|
|
|
|
hex = { version = "0.4.3", features = ["serde"] }
|
2022-09-28 17:22:39 -07:00
|
|
|
insta = { version = "1.21.0", features = ["ron"] }
|
2022-03-18 13:30:16 -07:00
|
|
|
|
2020-10-02 15:51:51 -07:00
|
|
|
proptest = "0.10.1"
|
2022-02-14 17:44:33 -08:00
|
|
|
proptest-derive = "0.3.0"
|
2022-03-01 18:44:39 -08:00
|
|
|
|
2022-06-27 16:12:56 -07:00
|
|
|
halo2 = { package = "halo2_proofs", version = "0.2.0" }
|
2022-05-18 18:03:55 -07:00
|
|
|
jubjub = "0.9.0"
|
2022-03-01 18:44:39 -08:00
|
|
|
|
2022-09-28 17:22:13 -07:00
|
|
|
tokio = { version = "1.21.2", features = ["full", "tracing", "test-util"] }
|
2021-11-16 11:47:54 -08:00
|
|
|
|
|
|
|
zebra-chain = { path = "../zebra-chain", features = ["proptest-impl"] }
|
|
|
|
zebra-test = { path = "../zebra-test/" }
|