* Regroup imports in `.../tests/common/regtest.rs`
* Regroup imports in `.../methods/tests/prop.rs`
* Regroup imports in `.../get_block_template.rs`
* Regroup imports in `.../zip317.rs`
* Regroup imports in `.../get_blockchain_info.rs`
* Regroup imports in `.../types/get_raw_mempool.rs`
* Regroup imports in `.../types/transaction.rs`
* Regroup imports in `.../server/tests/vectors.rs`
* Regroup imports in `.../args.rs`
* Regroup imports in `.../main.rs`
* Regroup imports in `.../openapi-generator/main.rs`
* Regroup imports in `zebrad/src/commands/start.rs`
* Regroup imports in `.../tests/fake_peer_set.rs`
* Regroup imports in `.../components/miner.rs`
* Regroup imports in `.../tests/acceptance.rs`
* Regroup imports in `.../get_block_template.rs`
* Introduce Nu7
* Introduce Nu7 fo other crates of Zebra
* Fix of new_regtest call (as it additionally needs Nu7 arg now)
* Fix of new_regtest call (as it additionally needs Nu7 arg now) (2)
* Set Nu7 as a network update for testnet in zebra-chain network tests
* Fix serde names for NU7
* Update test snapshot in zebra-rpc to use NU7
* Copy Nu7-related changes from zsa-integration-state
* Uncomment zcash_unstable = nu7
* Fix Nu7 constants and add cfg(zcash_unstable ...) attribute according to PR #15 review comments
* Update network constant values according to PR #15 review comments
* Add zcash_unstable=nu6 Rust flag to .cargo/config.toml to use nu6 by default
* Add zcash_unstable = nu6 cfg in zebra-network/.../types.rs
* Fix nu7 activation heights in network_upgrade.rs (nu6 value + 1 does not work - causes a test failure)
* Add cfg for CURRENT_NETWORK_PROTOCOL_VERSION constant definition, add FIXMEs for a couple of Nu6 processing cases, add processing of Nu7
* Update get_blockchain_info@testnet_10.snap
* Update get_blockchain_info@mainnet_10.snap
* updated cfg flag
* remove `zcash_unstable` flag
* Remove testnet and mainnet NU7 activation heights, comment out consensus branch id and conversion to zcash primitives nu type
* Yep, it'll work after NU7
* Yep, the test should work fine after NU7
* Yep, it only needs to be a post-nu6 height.
* other fixes and cleanups
* Updates snapshots, removes unnecessary FIXMEs, fixes issues with bad merge conflict resolution
* fixes test hang when there are NUs defined without activation heights
* fixes test, applies suggestion from code review.
* Enable consensus branch ID for Nu7
---------
Co-authored-by: Dmitry Demin <dmitry@qed-it.com>
Co-authored-by: Arya <aryasolhi@gmail.com>
Co-authored-by: Marek <mail@marek.onl>
* 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>
* 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>
* Adds a `target_difficulty_limit` field on `testnet::Parameters`
* updates test to increment block nonce until finding a block that's below the difficulty threshold
* increment the nonce while the difficulty is invalid instead of while the difficulty threshold is invalid
* Adds comments
* Allow configurable Nu5 activation height on Regtest
* Fixes test
* removes outdated TODO
* Adds `current_with_activation_height()` method and uses it in `Commitment::from_bytes()`
* Always activate Canopy at Height(1) on Regtest
* Ignores the zip 212 grace period on configured Testnets and Regtest
* - Returns early when there is no Heartwood activation height when creating or updating HistoryTree
- Skips call to `check::legacy_chain()` when no NU5 activation height is set (it would return immediately anyway)
- Replaces `.map()` with `.filter_map()` in `NetworkUpgrade::target_spacings()`
- Removes outdated TODO
* - When proof of work is disabled, skips checking if Zebra is synced to the network tip in the getblocktemplate method
* Sets full_verifier_utxo_lookahead to Height::MIN instead of panicking
* When network is regtest, skips starting sync task and commits the genesis block if it's missing in the state
* updates/fixes test config
* Adds test for committing Canopy blocks on Regtest
* - Updates median time past and difficulty checks to use fewer than 11/17/28 blocks
* uses SLOW_START_INTERVAL of 0 if PoW is disabled, adds TODOs
* Update getblocktemplate method to return reserved chain history activation root hash, uses Nu5 at height 1
Test passes.
* Updates test to expect NU5 as the default nu activation at Height(1)
* Removes invalid difficulty snapshot
* fixes tests
* removes regtest NU5 activation height config field
* Apply suggestions from code review
* Update zebra-state/src/service/check/difficulty.rs
Co-authored-by: Marek <mail@marek.onl>
* Update zebra-state/src/service/check/difficulty.rs
* Updates docs/comments, renames an argument
---------
Co-authored-by: Marek <mail@marek.onl>