Replace libzcashconsensus with libzcash_script
We inherited `libzcashconsensus` from upstream (we just renamed it before launch to avoid conflicts). However, it has become increasingly inaccurately named; it only covers (Zcash's subset of) the Bitcoin scripting system, and not the myriad of other consensus changes (in particular, the shielded pools).
This PR reworks the library to instead be focused on transparent script verification:
- The script verification APIs are altered to take `amount` and `consensusBranchId` fields.
- Equihash code is removed (the canonical Equihash validator is now the `equihash` Rust crate).
- The library is renamed to `libzcash_script`.
The API changes are backwards-incompatible, but the library rename prevents any issues. Also, `libzcashconsensus` was in fact broken and not compiling for several years and no one complained, suggesting that it was not actually being relied on within the ecosystem. By contrast, this focused library already has a consumer: the `zebrad` full node.
Closeszcash/zcash#4879.
Update UniValue subtree
This brings us up-to-date with upstream Bitcoin's version of the library.
Includes a commit cherry-picked from bitcoin/bitcoin#12193.
Set up an mdbook in which we can document zcashd's architecture design
I've explained various parts of zcashd's node architecture enough times
now that it really should be written down!
We didn't initially expose these because we assumed that this API was
likely being used somewhere in the ecosystem. However, the build system
for libzcashconsensus has been broken since 2018, and no issues were
raised, which strongly indicates that this API is not currently in use.
This library (in the version we inherited from Bitcoin Core 0.11.2) is
entirely focused on transparent script verification; a full Equihash
solver is out of scope. Now that Heartwood has activated, the canonical
Equihash validator is the Rust implementation in the equihash crate.
Ensure that `CONFIGURE_FLAGS=--enable-debug` correctly uses -O0 for dependencies and main build
Test plan:
* build using `zcutil/build.sh V=1` and confirm from the build log that all dependencies and the main build use `-O1`
* run `zcutil/distclean.sh` then build using `CONFIGURE_FLAGS=--enable-debug zcutil/build.sh V=1`
* confirm from the build log that all dependencies and the main build use `-O0`
* run builds with and without `--enable-debug` under `gdb`, and find a case where local variables are usually optimized out, but not with `--enable-debug`.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/leveldb/build_detect_platform shows how upstream defines them.
These platform may not be able to fully build or run Bitcoin, but defining all
known to leveldb saves future hassle.
Now that all possible platforms are enumerated, specifying an unknown one is an
error.
- LevelDB platform was not guessed correctly (it ended up defining
`-DOS_OPENBSD59` instead of `-DOS_OPENBSD`)
- On OpenBSD there is no convenience link from `python3.5` to `python3`:
add detection for other python interpreter names.
- If it has to guess the LevelDB OS, print a autoconf warning so that
the user can check.
Zcash: Excludes the Python change.
depends: Allow per-host package download paths
Clang's download path includes its version, but LLVM doesn't always
publish every package for every version, so we need to support multiple
versions.
Fixeszcash/zcash#4954.
Clang's download path includes its version, but LLVM doesn't always
publish every package for every version, so we need to support multiple
versions.
Fixeszcash/zcash#4954.
depends: Move to Clang 11
Most platforms are on 11.0.1; Darwin and Windows are both on 11.0.0
because that is the latest that binaries are provided for.
Requires `zstd` to cross-compile Windows binaries.
C++17 deprecated the two-argument version of std::allocator::allocate.
Starting with 11.0, libc++ enforces these deprecations, which causes
warnings from the Boost headers, and since we require native Linux
builds to be warning-free, this breaks CI.
Boost addressed this issue for MSVC in 1.75; the patch in this commit
forces Clang to be handled in the same way.