Zebra/zebra-consensus/src
Alfredo Garcia 75d29aca24
Add V5 transparent and sapling to transaction::check, add missing coinbase PrevOut check (#2070)
* validate sapling v5 tx

* Make itertools dependency optional

We only need itertools when the `proptest-impl` feature is enabled.

* Check if V4 and V5 coinbase transactions contain PrevOut transparent inputs

This is a bugfix on V4 transaction validation. The PrevOut consensus
rule was not explicitly stated in the Zcash spec until April 2021.
(But it was implied by Bitcoin, and partially implemented by Zebra.)

Also do the shielded sapling input check for V5 transactions.

* Add spec and orchard TODOs to has_inputs_and_outputs

Also make the variable names match the spec.

* Sort transaction functions to match v5 data order

* Simplify transaction input and output checks

Move counts or iterators into `Transaction` methods, so we can remove
duplicate code, and make the consensus rule logic clearer.

* Update sapling_balances_match for Transaction v5

- Quote from the spec
- Explain why the function is redunant for v5
- Rename the function so it's clear that it is sapling-specific

Co-authored-by: teor <teor@riseup.net>
2021-04-28 10:43:00 +10:00
..
block Add V5 transparent and sapling to transaction::check, add missing coinbase PrevOut check (#2070) 2021-04-28 10:43:00 +10:00
chain Delete duplicate test code for chain verifier 2021-03-04 08:06:31 +10:00
checkpoint Fix some missed Sapling to Canopy checkpoint code changes 2021-03-18 10:13:47 +10:00
parameters Replace smart quotes with ascii quotes 2021-03-15 03:18:10 -04:00
primitives Rename shielded_data to sapling_shielded_data as needed (#2072) 2021-04-27 10:37:53 -03:00
transaction Add V5 transparent and sapling to transaction::check, add missing coinbase PrevOut check (#2070) 2021-04-28 10:43:00 +10:00
block.rs Use interoperable names for common metrics 2021-03-17 09:38:07 +10:00
chain.rs Document the correctness of Poll::Pending wakeups 2021-03-27 08:55:49 -04:00
checkpoint.rs Check proof-of-work in the CheckpointVerifier 2021-03-12 08:55:29 +10:00
config.rs Document that the mandatory checkpoint can change 2021-03-22 22:17:44 -04:00
error.rs Add V5 transparent and sapling to transaction::check, add missing coinbase PrevOut check (#2070) 2021-04-28 10:43:00 +10:00
lib.rs Merge pull request #1713 from ZcashFoundation/use-groth16-batch-math 2021-03-24 12:28:25 -04:00
parameters.rs move genesis parameters to zebra-chain (#1151) 2020-10-12 14:08:23 -07:00
primitives.rs Ed25519 async batch verification for JoinSplit signatures (#1952) 2021-03-31 09:08:19 +10:00
script.rs Make the state usage clearer in script::Verifier (#1733) 2021-02-16 05:53:12 +10:00
transaction.rs Add V5 transparent and sapling to transaction::check, add missing coinbase PrevOut check (#2070) 2021-04-28 10:43:00 +10:00