Zebra/zebra-consensus/src
Henry de Valence e0817d1747 state: introduce PreparedBlock, FinalizedBlock
This change introduces two new types:

- `PreparedBlock`, representing a block which has undergone semantic
  validation and has been prepared for contextual validation;
- `FinalizedBlock`, representing a block which is ready to be finalized
  immediately;

and changes the `Request::CommitBlock`,`Request::CommitFinalizedBlock`
variants to use these types instead of their previous fields.

This change solves the problem of passing data between semantic
validation and contextual validation, and cleans up the state code by
allowing it to pass around a bundle of data.  Previously, the state code
just passed around an `Arc<Block>`, which forced it to needlessly
recompute block hashes and other data, and was incompatible with the
already-known but not-yet-implemented data transfer requirements, namely
passing in the Sprout and Sapling anchors computed during contextual
validation.

This commit propagates the `PreparedBlock` and `FinalizedBlock` types
through the state code but only uses their data opportunistically, e.g.,
changing .hash() computations to use the precomputed hash.  In the
future, these structures can be extended to pass data through the
verification pipeline for reuse as appropriate.  For instance, these
changes allow the sprout and sapling anchors to be propagated through
the state.
2020-11-23 14:16:39 +10:00
..
block Remove test attributes and allow(dead_code) for test code that tests currently unimplemented functionality 2020-11-21 05:40:25 -05:00
chain state: don't pre-buffer the service 2020-10-26 12:05:35 -07:00
checkpoint state: introduce PreparedBlock, FinalizedBlock 2020-11-23 14:16:39 +10:00
parameters Refactor block target spacing into NetworkUpgrade methods 2020-11-12 12:30:54 +10:00
primitives deps: move to tokio 0.3, tower 0.4 2020-11-20 10:08:16 -08:00
transaction consensus: remove incorrect check 2020-11-21 14:09:15 -05:00
block.rs state: introduce PreparedBlock, FinalizedBlock 2020-11-23 14:16:39 +10:00
chain.rs consensus,state: document cancellation contracts for services 2020-11-17 14:56:27 -08:00
checkpoint.rs state: introduce PreparedBlock, FinalizedBlock 2020-11-23 14:16:39 +10:00
config.rs consensus: minimize API, clean docs 2020-10-20 11:16:22 -04:00
error.rs consensus: fix bug in tx input/output presence check 2020-11-21 14:09:15 -05:00
lib.rs Remove allow(dead_code) on transaction module] 2020-10-28 21:44:13 -04:00
parameters.rs move genesis parameters to zebra-chain (#1151) 2020-10-12 14:08:23 -07:00
primitives.rs consensus: add stub groth16::Verifier 2020-10-20 11:16:22 -04:00
script.rs consensus: fix same-block utxo lookups 2020-11-23 14:16:39 +10:00
transaction.rs consensus: add remaining checks trace counter to tx verifier 2020-11-23 14:16:39 +10:00