Zebra/zebra-state/src
Arya 3cbee9465a
change(rpc): Add proposal capability to getblocktemplate (#5870)
* adds ValidateBlock request to state

* adds `Request` enum in block verifier

skips solution check for BlockProposal requests

calls CheckBlockValidity instead of Commit block for BlockProposal requests

* uses new Request in references to chain verifier

* adds getblocktemplate proposal mode response type

* makes getblocktemplate-rpcs feature in zebra-consensus select getblocktemplate-rpcs in zebra-state

* Adds PR review revisions

* adds info log in CheckBlockProposalValidity

* Reverts replacement of match statement

* adds `GetBlockTemplate::capabilities` fn

* conditions calling checkpoint verifier on !request.is_proposal

* updates references to validate_and_commit_non_finalized

* adds snapshot test, updates test vectors

* adds `should_count_metrics` to NonFinalizedState

* Returns an error from chain verifier for block proposal requests below checkpoint height

adds feature flags

* adds "proposal" to GET_BLOCK_TEMPLATE_CAPABILITIES_FIELD

* adds back block::Request to zebra-consensus lib

* updates snapshots

* Removes unnecessary network arg

* skips req in tracing intstrument for read state

* Moves out block proposal validation to its own fn

* corrects `difficulty_threshold_is_valid` docs

adds/fixes some comments, adds TODOs

general cleanup from a self-review.

* Update zebra-state/src/service.rs

* Apply suggestions from code review

Co-authored-by: teor <teor@riseup.net>

* Update zebra-rpc/src/methods/get_block_template_rpcs.rs

Co-authored-by: teor <teor@riseup.net>

* check best chain tip

* Update zebra-state/src/service.rs

Co-authored-by: teor <teor@riseup.net>

* Applies cleanup suggestions from code review

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-11 23:39:51 +00:00
..
service change(rpc): Add proposal capability to getblocktemplate (#5870) 2023-01-11 23:39:51 +00:00
tests change(state): Write non-finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5257) 2022-10-11 19:25:45 +00:00
arbitrary.rs change(mempool) reject transactions with spent outpoints or nullifiers (#5434) 2022-10-24 19:48:45 +00:00
config.rs feat(state): delete old database directories (#4586) 2022-06-21 00:59:51 +00:00
constants.rs fix(testnet): look back up to 10,000 blocks on testnet for a legacy chain (#5133) 2022-09-20 11:31:24 +00:00
error.rs change(mempool): Contextually validates mempool transactions in best chain (#5716) 2022-11-30 04:40:15 +00:00
lib.rs feat(rpc): populate some getblocktemplate RPC block header fields using the state best chain tip (#5659) 2022-11-28 09:06:32 +00:00
request.rs change(rpc): Add proposal capability to getblocktemplate (#5870) 2023-01-11 23:39:51 +00:00
response.rs change(rpc): Add proposal capability to getblocktemplate (#5870) 2023-01-11 23:39:51 +00:00
service.rs change(rpc): Add proposal capability to getblocktemplate (#5870) 2023-01-11 23:39:51 +00:00
tests.rs 1. change(state): Run most StateService read requests without shared mutable chain state (#5132) 2022-09-14 00:35:37 +00:00