Commit Graph

1436 Commits

Author SHA1 Message Date
Daira Emma Hopwood bafc49e39e miner_tests.cpp improvements.
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-20 15:46:56 +01:00
Daira Emma Hopwood 3b255b8941 Repair `miner_tests.py` btest.
The previous code did not mine enough blocks to have sufficient matured
funds for the tests it needed to perform, taking into account the slow
start. So, we now mine 200 instead of 110 blocks.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-19 22:48:46 +01:00
Daira Emma Hopwood 9af901e1a9 Add assertions that `GetRandInt*` functions are called with `nMax >= 0`.
All existing uses have been checked to ensure they are consistent with
this assertion.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-19 22:48:46 +01:00
Daira Emma Hopwood 0acbbfe609 Fix miner_tests btest.
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Daira Emma Hopwood d20a52faaa Fix some messages, comments, and documentation that:
* used "fee" to mean "fee rate", "kB" to mean 1000 bytes, "satoshis"
  to mean zatoshis, or that incorrectly used "BTC" in place of "ZEC";
* used obsolete concepts such as "zero fee" or "free transaction"; or
* did not accurately document their applicability.

Uses of "satoshis" as a JSON key are not altered.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Daira Emma Hopwood e2f99f5133 Fix the dust threshold rate to three times 100 zats/1000 bytes.
(We express it that way rather than 300 zats/1000 bytes, because the
threshold is always rounded to an integer and then multiplied by 3.)

Bitcoin Core added the concept of "dust" in bitcoin/bitcoin#2577.
At that point the dust threshold was tied to three times the
minRelayTxFee rate, with the motivation that if you'd pay more than
a third of the minimum relay fee to spend something, it should be
considered dust. This was implemented as a standard rule rejecting
dust outputs.

This motivation will not apply after ZIP 317 block construction
is implemented: at that point the ZIP 317 marginal fee will be
5000 zats per logical action, but the dust threshold rate will
still be three times 100 zats per 1000 bytes. Those costs would
only coincide if the marginal size per logical action were
5000/300 * 1000 ~= 16667 bytes, and in practice the marginal size
for any kind of input is much smaller than that.

However, to avoid interoperability problems (older wallets creating
transactions that newer nodes will reject because they view the
outputs as dust), we will have to coordinate any increase in the
dust threshold carefully.

More history: in Zcash the minRelayTxFee rate was 5000 zats/1000 bytes
at launch, changed to 1000 zats/1000 bytes in zcashd v1.0.3 and to
100 zats/1000 bytes in zcashd v1.0.7-1 (#2141). The relaying problem
for shielded transactions (#1969) that prompted the latter change was
fixed more thoroughly by the addition of `CFeeRate::GetFeeForRelay`
in #4916, ensuring that a transaction paying `DEFAULT_FEE` can always
be relayed. At the same time the default fee was set to 1000 zats,
per ZIP 313.

An earlier commit in this PR changed relaying policy to be more strict
about enforcing minRelayTxFee. The commit just before this one also
allowed `-minrelaytxfee=0`, which we are going to use to avoid some test
breakage. But if the dust threshold rate were still set to three times
the minRelayTxFee rate, then setting `-minrelaytxfee=0` would have the
side effect of setting the dust threshold to zero, which is not intended.

Bitcoin Core took a different approach to disentangling the dust
threshold from the relay threshold, adding a `-dustrelayfee` option
(bitcoin/bitcoin#9380). We don't want to do that because it is likely
that we will change the dust policy again, and adding a user-visible
config option might conflict with that. Also, it isn't a good idea for
the dust threshold rate to be configurable per node; it's a standard
rule parameter and should only be changed with network-wide coordination
(if it is increased then wallets have to change before nodes, and vice
versa if it is decreased). So for now we set it to a constant that
matches the behaviour before this PR.

Since we can no longer modify the dust threshold, we remove a check
from transaction_tests.cpp that relied on doing so.

This change also indirectly fixes a false-positive assertion error that
would occur in `SpendableInputs::LimitToAmount` if we allowed the dust
threshold to be zero.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Alex Morcos 1d866c85d8 [cleanup] Remove coin age priority completely.
Remove GetPriority and ComputePriority.  Remove internal machinery for tracking priority in CTxMemPoolEntry.

(cherry picked from commit bitcoin/bitcoin@359e8a03d1)

Zcash:
* We don't have `src/bench/mempool_eviction.cpp`.
* We don't have `-walletrejectlongchains`.
* Now we can remove `MAX_PRIORITY`.
* Fix a comment in `coins.h` while we're changing code next to it.
* Update the `Mempool/PriorityStatsDoNotCrash` regression test.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Alex Morcos 3972c7e6b6 [test] Remove priority from tests
Remove all coin age priority functionality from unit tests and RPC tests.

(cherry picked from commit bitcoin/bitcoin@0315888d0d)

Zcash:
* We cannot remove the `pool` parameter from the `CTxMemPool` constructor
  because we do not have bitcoin/bitcoin#9138. (Backporting that PR is
  unnecessary and would be a distraction from the purpose of this one;
  the changes made by it are orthgonal.)
* We don't have `prioritise_transaction.py`, `MempoolAncestorIndexingTest`,
  `MempoolSizeLimitTest`, or the `estimateSmartFee` functionality, so omit
  the changes for those.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Wladimir J. van der Laan 12291b2e41 Merge #7730: Remove priority estimation
0bd581a add release notes for removal of priority estimation (Alex Morcos)
b2322e0 Remove priority estimation (Alex Morcos)

(cherry picked from commit bitcoin/bitcoin@3c03dc2cfc)

Zcash:
* MAX_PRIORITY is still needed because it's used for the priority of
  shielded transactions.
* Changes relating to "smart priority" are omitted since we do not have
  that.
* Change the new minimum client version for `fee_estimates.dat` to
  FEE_ESTIMATES_WITHOUT_PRIORITY_VERSION == 5050000. Immediately make
  sure we write at least that version and accept it for reading.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Greg Pfeil 14c11c385a
Fix zcash-cli crash when printing help message
When a `zcash-cli` command fails, it attempts to print the help message for the command. However,
making the `help` call can also fail, and there was a bug in this check, so that we tried to display
the help message when the `help` call failed, and tried to display the error when the `help` call
succeeded – both leading to an assertion failure.

This also makes some minor changes to the output formatting.

Fixes #6561
2023-04-15 16:07:33 -06:00
Kris Nuttycombe 6854c25415
Merge pull request #5993 from str4d/5716-cxx-ed25519
rust: Migrate Ed25519 FFI to `cxx`
2023-04-14 09:37:30 -06:00
Greg Pfeil 2435b974ee
Enrich zcash-cli arg conversion
Instead of storing the indices of args to convert from string, store two
`vector<bool>` (per operation), the first containing an entry for each required
parameter (`true` if we should convert it), and the second containing an entry
for each optional parameter.

This allows us to check a few more things on the client side:
- does the operation exist
- have enough arguments been passed
- have too many arguments been passed

This is ostensibly a fix for `zcash-cli` to be able to use `asOfHeight` where
available, but it also caught a few bugs in the old implementation:
- `submitblock` didn’t convert its optional (but ignored) second arg;
- `z_getpaymentdisclosure` docs claimed all the args were strings, but two are
  actually ints;`
- `listreceivedbyaddress` didn’t convert the optional `includeImmatureCodebase`;
- `listsinceblock` didn’t convert the optional `includeRemoved` and
  `includeChange`;`
- `gettransaction` didn’t convert `verbose`;
- `listunspent` didn’t convert `includeUnsafe` or `queryOptions`;
- `z_getbalanceforviewingkey` didn’t convert minconf; and
- a minor non-bug – `z_getbalanceforaddress` had a handler even though the
  operation has been removed.

`getblockdeltas` also incorrectly tries to convert its required string argument,
but correcting that would be a breaking API change. Instead, it is deferred to

Fixes #6429.
2023-04-12 10:11:56 -06:00
Jack Grigg b1dc94249c rust: Migrate Ed25519 FFI to `cxx` 2023-04-11 16:36:26 +00:00
Jack Grigg 19fed267e3 Use `cxx` bridge for all Orchard bundle inspection and validation
zcash/zcash#5987 added a bridge to `orchard::Bundle<Authorized, Amount>`
for `getrawtransaction`. This commit expands it to also cover the
consensus rules, by migrating over missing functionality from the
hand-written FFI methods, and exposing the Orchard `BatchValidator` type
directly (as with Sapling) instead of via the C++ `AuthValidator`
intermediary.

Part of zcash/zcash#6397.
2023-04-07 12:16:28 +00:00
Jack Grigg 33367709f7 Merge most `cxx::bridge` definitions into a single bridge
This enables us to use Rust types across more bridged APIs, which we
can't do with multiple bridge definitions until `cxx` adds support.
2023-04-05 10:50:35 +00:00
Daira Emma Hopwood dd246587a3 Fix bit-rotted code in miner tests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2023-03-29 00:05:51 +01:00
Jack Grigg 7f35a0da5c Migrate to `zcash_primitives 0.10`
Closes zcash/zcash#6398.
2023-03-17 00:09:45 +00:00
Kris Nuttycombe 1b2d994a39 zcashd release v5.3.3
Notable changes
 ===============
 
 This hotfix remediates memory exhaustion vulnerabilities that zcashd inherited
 as a fork of bitcoind. These bugs could allow an attacker to use peer-to-peer
 messages to fill the memory of a node, resulting in a crash.
 -----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEX8Nd8pnYcf0pobEL9FXpuSAjoYsFAmP1CD8ACgkQ9FXpuSAj
 oYvGXQwAqaa1l5qC3VY/60jkH4xmWoSUEzeCOPUG7lYJrIEyzgXj8Ko0Cjr308jm
 ISXDDTOxKb2hfnCbeqbZqRyFbzGzG5L6AkjHAvmQMiZwx2JlbH2k+jd5fggOZSMv
 shL5KbxWN2YRftc8r+fDraJMbGULbKBWQooKaFyQmupT+bVsRf1Nh+lFIVG4FUwA
 oWZot36wB6Y99Y57wlyN2m22+j1glyk5mKv2ttXYbdwSRTFB5W5L1US6Z8uxXQPb
 Qa7sVO90QtzkHr+GPtMiTn513VuLFr+KArGn+qidU/PvblJI/vXuBf54g7JZw4Ot
 gkKziatgaN3pO30I4rTij78LCgKJZ/WImLE7nwTl/bG2Ki1WfyolNLjS+1pXpcPL
 xlXso5ioKlSIGhnlPouXwoxlaqTpDwRKLp0azNJl5hG/tXEHupToK2M61woi9LlP
 4RB+a75OptFi9NMp/Sx0T8zNRn7OB8iP+3BgRP0+mzcLC1AHfjJk/IRo9CQh5jRZ
 MMe98OrC
 =6QYn
 -----END PGP SIGNATURE-----

Merge tag 'v5.3.3' into hotfix-v5.4.2

zcashd release v5.3.3

Notable changes
===============

This hotfix remediates memory exhaustion vulnerabilities that zcashd inherited
as a fork of bitcoind. These bugs could allow an attacker to use peer-to-peer
messages to fill the memory of a node, resulting in a crash.
2023-03-13 06:18:00 -06:00
Daira Hopwood 0a39cc6727 Enable a CRollingBloomFilter to be reset to a state where it takes little memory.
Co-authored-by: Jack Grigg <jack@z.cash>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2023-02-20 18:32:46 +00:00
Kris Nuttycombe cc2fd60617 Make all CCoinsView methods pure-virtual. 2023-02-15 13:58:46 -07:00
Charlie O'Keefe b7d613b6ca
Merge pull request #6313 from str4d/6309-backport-blockassembler
Backport `BlockAssembler` class
2023-02-02 15:33:45 -07:00
Alex Morcos e6d4027888 Refactor CreateNewBlock to be a method of the BlockAssembler class
(cherry picked from commit bitcoin/bitcoin@4dc94d1036)

Zcash: Adapted to include our miner changes.
2023-01-30 21:59:42 +00:00
Kris Nuttycombe 3cec519ce4 scripted-diff: Update Zcash copyrights to 2023
-BEGIN VERIFY SCRIPT-
for party in "The Zcash developers" "The Bitcoin Core developers" "Bitcoin Developers"; do
  sed -i"" -e "s#Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? $party#Copyright (c) \1-2023 $party#" COPYING
  sed -i"" -e "s#\(.*\)\([0-9]\{4\}\)\(-[0-9]\{4\}\)\, $party#\1\2-2023, $party#" contrib/debian/copyright
done

sed -i"" -e "s/define(_COPYRIGHT_YEAR, [0-9]\{4\})/define(_COPYRIGHT_YEAR, 2023)/" configure.ac
sed -i"" -e "s/#define COPYRIGHT_YEAR [0-9]\{4\}/#define COPYRIGHT_YEAR 2023/" src/clientversion.h

git grep "^// Copyright (c) .* The Zcash developers" \
  | awk -F ':' '{print $1}' \
  | xargs -I {} sed -i"" -e "s#// Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? The Zcash developers#// Copyright (c) \1-2023 The Zcash developers#" {}
-END VERIFY SCRIPT-
2023-01-23 11:31:54 -07:00
instagibbs 4bb399a8f5 Corrected values
(cherry picked from commit bitcoin/bitcoin@f8536a62c3)
2023-01-19 21:49:14 +00:00
instagibbs bbf4f8b6e9 Gave miner test values constants for less error-prone values.
(cherry picked from commit bitcoin/bitcoin@617deeb06e)

Zcash: Adapted to mining slow start.
2023-01-19 21:49:13 +00:00
Suhas Daftuar 9d04148414 Add tags to mempool's mapTx indices
(cherry picked from commit bitcoin/bitcoin@086da92ea7)
2023-01-19 21:49:13 +00:00
Jack Grigg c16b1e8c24 test: Improve CreateNewBlock_validity exception checks 2022-12-20 11:41:04 +00:00
Alex Morcos 45355e85d0 Rewrite CreateNewBlock
Use the score index on the mempool to only add sorted txs in order.  Remove much of the validation while building the block, relying on mempool to be consistent and only contain txs that can be mined.
The mempool is assumed to be consistent as far as not containing txs which spend non-existent outputs or double spends, and scripts are valid.  Finality of txs is still checked (except not coinbase maturity, assumed in mempool).
Still TestBlockValidity in case mempool consistency breaks and return error state if an invalid block was created.
Unit tests are modified to realize that invalid blocks can now be constructed if the mempool breaks its consistency assumptions and also updated to have the right fees, since the cached value is now used for block construction.

Conflicts:
	src/miner.cpp

(cherry picked from commit bitcoin/bitcoin@553cad94e2)

Zcash: Merged in our changes.
2022-12-20 11:41:04 +00:00
Mark Friedenbach 38e319a88f Prevent block.nTime from decreasing
Under some circumstances it is possible for there to be a significant,
discontinuous jump in a node's clock value. On mining nodes, this can
result in block templates which are no longer valid due to time-based
nLockTime constraints. UpdateTime() is modified so that it will never
decrease a block's nLockTime, thereby preventing such invalidations.

(cherry picked from commit bitcoin/bitcoin@ef8dfe41d1)

Zcash: Updated CreateNewBlock_validity test and wallet_1941 RPC test to
ensure we satisfy the future timestamp soft fork rule.
2022-12-20 08:56:15 +00:00
Jack Grigg 1018ebd002 test: Handle mining slow start inside `CreateNewBlock_validity`
This partially reverts zcash/zcash@4f4a8c3c88
and correctly handles the mining slow start without repeatedly calling
CreateNewBlock.
2022-12-20 08:06:39 +00:00
Suhas Daftuar b63c58500a Track transaction packages in CTxMemPoolEntry
Associate with each CTxMemPoolEntry all the size/fees of descendant
mempool transactions.  Sort mempool by max(feerate of entry, feerate
of descendants).  Update statistics on-the-fly as transactions enter
or leave the mempool.

Also add ancestor and descendant limiting, so that transactions can
be rejected if the number or size of unconfirmed ancestors exceeds
a target, or if adding a transaction would cause some other mempool
entry to have too many (or too large) a set of unconfirmed in-
mempool descendants.

(cherry picked from commit bitcoin/bitcoin@5add7a74a6)

Zcash:
- Mempool methods were adapted to our mempool changes.
- Default ancestor and descendant size limits were double to account for
  our larger block size.
- The mempool_packages RPC test fee was adapted to account for our
  emissions curve (which results in a smaller per-block reward that
  needs to be split into smaller shards for sequential transactions.
- Includes some modifications to account for us backporting
  bitcoin/bitcoin@f3fe83673e early in
  zcash/zcash#5269.
2022-12-19 05:38:43 +00:00
Daira Hopwood d502714326 Refactor HaveShieldedRequirements to use tl::expected (example with a void T)
and rename it to CheckShieldedRequirements.

Signed-off-by: Daira Hopwood <jacaranda.org>
2022-12-08 20:53:54 +00:00
Dimitris Apostolou 0994282019
Fix typos 2022-11-25 23:09:48 +02:00
DeckerSU 25c2b950ba
miner: fix MAXSOLS
https://github.com/KomodoPlatform/komodo/pull/556
882bc1ff7a
2022-08-16 13:19:50 +02:00
Pieter Wuille 6fc711d0d5 [MOVEONLY] Move unused Merkle branch code to tests
Zcash: Also includes some minor changes from scripted diffs that
occurred between backported PRs.

(cherry picked from commit bitcoin/bitcoin@4defdfab94)
2022-07-16 10:13:26 +00:00
Pieter Wuille fb70e9286a Specialized double sha256 for 64 byte inputs
Zcash: Commented out second BENCHMARK argument as we haven't backported
the benchmark refactor that adds it.

(cherry picked from commit bitcoin/bitcoin@d0c9632883)
2022-07-16 10:13:26 +00:00
Pieter Wuille 2d1e63c45a Add SHA256 dispatcher
(cherry picked from commit bitcoin/bitcoin@2991c91d88)
2022-07-16 10:13:26 +00:00
Pieter Wuille 101d19fe17 scripted-diff: Use new naming style for insecure_rand* functions
-BEGIN VERIFY SCRIPT-
sed -i 's/\<insecure_randbits(/InsecureRandBits(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<insecure_randbool(/InsecureRandBool(/g' src/test/*.cpp src/test/*.h src/gtest/*.cpp src/wallet/test/*.cpp
sed -i 's/\<insecure_randrange(/InsecureRandRange(/g' src/test/*.cpp src/test/*.h src/gtest/*.cpp src/wallet/test/*.cpp
sed -i 's/\<insecure_randbytes(/InsecureRandBytes(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<insecure_rand256(/InsecureRand256(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<insecure_rand(/InsecureRand32(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
sed -i 's/\<seed_insecure_rand(/SeedInsecureRand(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp
-END VERIFY SCRIPT-

(cherry picked from commit bitcoin/bitcoin@e945848582)
2022-07-15 22:10:23 +00:00
Pieter Wuille 3e6b2edc74 scripted-diff: Use randbits/bool instead of randrange where possible
-BEGIN VERIFY SCRIPT-
sed -i 's/insecure_randbits(1)/insecure_randbool()/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(2)/insecure_randbool()/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(2)/insecure_randbool()/g' src/gtest/test_*.cpp
sed -i 's/insecure_randrange(4)/insecure_randbits(2)/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(32)/insecure_randbits(5)/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(256)/insecure_randbits(8)/g' src/test/*_tests.cpp
-END VERIFY SCRIPT-

Zcash: Added gtests to script.

(cherry picked from commit bitcoin/bitcoin@2fcd9cc86b)
2022-07-15 22:10:23 +00:00
Pieter Wuille 008fb745c5 Use randbits instead of ad-hoc emulation in prevector tests
(cherry picked from commit bitcoin/bitcoin@2ada678521)
2022-07-15 22:10:23 +00:00
Pieter Wuille 722d1c4c64 Replace rand() & ((1 << N) - 1) with randbits(N)
Zcash: Excluding changes to tests we don't have.

(cherry picked from commit bitcoin/bitcoin@5f0b04eedc)
2022-07-15 22:10:23 +00:00
Pieter Wuille 05c60b2b7e Replace more rand() % NUM by randranges
Zcash: Excluding changes to tests we don't have.

(cherry picked from commit bitcoin/bitcoin@3ecabae363)
2022-07-15 22:10:23 +00:00
Pieter Wuille 5a1c450496 scripted-diff: use insecure_rand256/randrange more
-BEGIN VERIFY SCRIPT-
sed -i "s/\<GetRandHash(/insecure_rand256(/" src/test/*_tests.cpp
sed -i "s/\<GetRand(/insecure_randrange(/" src/test/*_tests.cpp src/test/test_bitcoin.cpp
sed -i 's/\<insecure_rand() % \([0-9]\+\)/insecure_randrange(\1)/g' src/test/*_tests.cpp
-END VERIFY SCRIPT-

Zcash: Excludes changes to files we don't have.

(cherry picked from commit bitcoin/bitcoin@efee1db21a)
2022-07-15 22:10:23 +00:00
Pieter Wuille eab53622f4 Add various insecure_rand wrappers for tests
(cherry picked from commit bitcoin/bitcoin@1119927df0)
2022-07-15 22:10:23 +00:00
Pieter Wuille f7a23218d1 Merge test_random.h into test_bitcoin.h
Zcash: Excludes changes to files we don't have, and removes the
duplicate definitions in `src/gtest/utils.h`.

(cherry picked from commit bitcoin/bitcoin@124d13a58c)
2022-07-15 22:10:23 +00:00
Pieter Wuille 0ef7ce2c61 scripted-diff: Rename cuckoo tests' local rand context
-BEGIN VERIFY SCRIPT-
sed -i 's/insecure_rand/local_rand_ctx/g' src/test/cuckoocache_tests.cpp
-END VERIFY SCRIPT-

(cherry picked from commit bitcoin/bitcoin@90620d66c9)
2022-07-15 22:10:23 +00:00
Pieter Wuille c9a9691a2f Add FastRandomContext::rand256() and ::randbytes()
FastRandomContext now provides all functionality that the real Rand* functions
provide.

(cherry picked from commit bitcoin/bitcoin@37e864eb9f)
2022-07-15 22:10:23 +00:00
Kris Nuttycombe 40df3d402e
Merge pull request #6042 from nuttycom/feature/clock_capability
Add a clock for testing with an offset from the system clock.
2022-07-15 08:23:23 -06:00
Kris Nuttycombe e7922af588 Add a clock for testing with an offset from the system clock.
This change improves clock management for zcashd by ensuring
that all clock methods (obtaining seconds, milliseconds, and
microseconds since the epoch) agree under testing conditions
using `-mocktime`, and also adds a feature that allows tests
to specify an offset to the system clock; this is useful to
allow comprehensive testing of the "timejacking attack mitigation"
consensus rules.
2022-07-14 16:33:54 -06:00
Jack Grigg 087c85ec03 Cache Sapling and Orchard bundle validation
This adds two new CuckooCaches in validation, each caching whether all
of a transaction bundle's proofs and signatures were valid.

Bundles which match the validation cache never have proofs or signatures
added to the batch validators. For blocks where all transactions have
been previously observed in the mempool, the final validation of the
batches should be a no-op.

Part of zcash/zcash#6049.
2022-07-13 15:49:37 +00:00