Benchmarking framework, loosely based on google's micro-benchmarking
library (https://github.com/google/benchmark)
Wny not use the Google Benchmark framework? Because adding Even More Dependencies
isn't worth it. If we get a dozen or three benchmarks and need nanosecond-accurate
timings of threaded code then switching to the full-blown Google Benchmark library
should be considered.
The benchmark framework is hard-coded to run each benchmark for one wall-clock second,
and then spits out .csv-format timing information to stdout. It is left as an
exercise for later (or maybe never) to add command-line arguments to specify which
benchmark(s) to run, how long to run them for, how to format results, etc etc etc.
Again, see the Google Benchmark framework for where that might end up.
See src/bench/MilliSleep.cpp for a sanity-test benchmark that just benchmarks
'sleep 100 milliseconds.'
To compile and run benchmarks:
cd src; make bench
Sample output:
Benchmark,count,min,max,average
Sleep100ms,10,0.101854,0.105059,0.103881
Update libsodium download-path
This PR fixes the macOS build that is currently failing due to the download path for Libsodium changing - mentioned in issue #4295
depends macOS: hide linker visibility warnings
Closes https://github.com/zcash/zcash/issues/4255
Tested that all lines with `ld: warning: direct access in` are gone from build log.
Bitcoin wallet PRs 3
Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#7687
- bitcoin/bitcoin#11116
- Excludes SegWit tests
- Excludes `isInvalid` code (which is part of the SegWit support structure)
- bitcoin/bitcoin#13002
- Excludes changes to `importwallet` (missing bitcoin/bitcoin#11667)
- Excludes changes to `ProcessImport` (missing bitcoin/bitcoin#7551)
- Third commit was rewritten to add an internal SigVersion argument (which we didn't have because it was added to support SegWit logic).
Such outputs can still be watched, and signed for, but they aren't treated as valid payments.
That means they won't cause transactions to appear in listtransactions, their outputs to be
shown under listunspent, or affect balances.
Inside IsMine we care about the distinction between scriptPubKey execution
and P2SH redeemScript execution. The consensus code does not care about this
distinction, and thus SigVersion does not have a field for P2SH. As the IsMine
code will care, it uses a separate enum with more fields.
Only IsMine's internal code needs this, as part of a recursion into P2SH and P2WSH
scripts. The exposed functions always operate on actual scriptPubKeys and not on
redeemScripts or witness scripts.
Zcash: Rewrote this commit so that it instead adds an internal
SigVersion argument (which we didn't have because it was added to
support SegWit logic).
Co-authored-by: Jack Grigg <jack@z.cash>
Before this, if someone imported a scriptPubKey directly (in hex form) using
importaddress, outputs sending to it would be treated as change, as the
corresponding CTxDestination was not added to the address book.
Fix this by trying to detect scriptPubKeys that are in fact convertible to a
CTxDestination and add them anyway. Add a warning to the RPC help to warn
against importing raw non-standard scripts.