Update to zcash 5.2.0 (#37)

* delete previous version

* Squashed 'depend/zcash/' content from commit f98166f7f5

git-subtree-dir: depend/zcash
git-subtree-split: f98166f7f556ee9b9f597d45275c32843a87b0b6

* update to zcash 5.2.0

* remove Windows support for now, see #38
This commit is contained in:
Conrado Gouvea 2022-08-22 16:40:55 -03:00 committed by GitHub
parent c9fbc441ef
commit bef75ee7bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
570 changed files with 13169 additions and 2958 deletions

View File

@ -73,7 +73,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
# "windows-latest" was removed; see https://github.com/ZcashFoundation/zcash_script/issues/38
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
with:

View File

@ -37,6 +37,7 @@ include = [
"/depend/zcash/src/secp256k1",
"/depend/zcash/src/support/cleanse.cpp",
"/depend/zcash/src/support/cleanse.h",
"/depend/zcash/src/rust/gen/",
]
[lib]
@ -47,19 +48,23 @@ path = "src/lib.rs"
external-secp = []
[dependencies]
# Must match depend/zcash/Cargo.toml
blake2b_simd = "1"
cxx = { version = "=1.0.72", features = ["c++17"] }
libc = "0.2"
memuse = "0.2"
orchard = "0.1"
orchard = "0.2"
rand_core = "0.6"
tracing = "0.1"
zcash_encoding = "0.1"
zcash_note_encryption = "0.1"
zcash_primitives = { version = "0.6", features = ["transparent-inputs"] }
zcash_primitives = { version = "0.7", features = ["transparent-inputs"] }
[build-dependencies]
cc = { version = ">= 1.0.36", features = ["parallel"] }
cxx-gen = "0.7.73"
bindgen = "0.59"
syn = { version = "1.0.99", features = ["full", "printing"] }
[dev-dependencies]
rustc-serialize = "0.3"

View File

@ -33,37 +33,28 @@ To do that, check for versions in:
### Updating `depend/zcash`
We keep a copy of the zcash source in `depend/zcash` with the help of `git subtree`.
It has one single difference that must be enforced everytime it's updated: the root
It has one single difference that must be enforced every time it's updated: the root
`Cargo.toml` must be deleted, since otherwise cargo will ignore the entire folder
when publishing the crate (see https://github.com/rust-lang/cargo/issues/8597).
However, `git subtree` requires merge commits in order to make further updates
work correctly. Since we don't allow those in our repository, we start over
every time, basically using it as a glorified `git clone`. This issue is being
tracked in https://github.com/ZcashFoundation/zcash_script/issues/35.
If you need to update the zcash source, run:
```console
git subtree pull -P depend/zcash https://github.com/zcash/zcash.git <ref> --squash
git rm -r depend/zcash
(commit changes)
git subtree add -P depend/zcash https://github.com/zcash/zcash.git <ref> --squash
git rm depend/zcash/Cargo.toml
(commit changes)
```
where `<ref>` is a reference to a branch, tag or commit (it should be a tag when preparing
a release, but it will be likely a branch or commit when testing).
The command will likely report a conflict due to the deleted `Cargo.toml` file.
Just run
```console
git rm depend/zcash/Cargo.toml
```
and then commit the updates. Note: after updating zcash, the PR that includes it must *not* be
squashed-and-merged, due to how subtree works. Otherwise you will get errors
when trying to update zcash again.
If that ends up happening, you can always `git rm depend/zcash` and start over
(run the same command as above, but with `add` instead of `pull`);
our usage of `subtree` is to just have a convenient way of pulling copies of `zcash`.
(Unfortunately, switching to submodules is not a good solution due to the need of
deleting the `Cargo.toml`.)
### Publishing New Releases
Releases for `zcash-script` are made with the help of [cargo release](https://github.com/sunng87/cargo-release).

View File

@ -1,4 +1,6 @@
use std::{env, fmt, path::PathBuf};
use std::{env, fmt, fs, io::Read, path::PathBuf};
use syn::__private::ToTokens;
type Result<T, E = Error> = std::result::Result<T, E>;
@ -43,8 +45,78 @@ fn bindgen_headers() -> Result<()> {
Ok(())
}
/// Use cxx_gen to generate headers and source files for FFI bindings,
/// just like zcash does (see depend/zcash/src/Makefile.am).
/// (Note that zcash uses the cxxbridge-cmd binary, while we use the
/// cxx_gen library, but the result is the same.)
///
/// We could use [`cxx_build`](https://cxx.rs/tutorial.html#compiling-the-c-code-with-cargo)
/// to do this automatically. But zcash uses the
/// [manual approach](https://cxx.rs/tutorial.html#c-generated-code) which
/// creates the headers with non-standard names and paths (e.g. "blake2b.h",
/// instead of "blake2b.rs.h" which what cxx_build would create). This would
/// requires us to rename/link files which is awkward.
///
/// Note that we must generate the files in the target dir (OUT_DIR) and not in
/// any source folder, because `cargo package` does not allow that.
/// (This is in contrast to zcash which generates in `depend/zcash/src/rust/gen/`)
fn gen_cxxbridge() -> Result<()> {
let out_path = env::var("OUT_DIR").map_err(Error::Env)?;
let out_path = PathBuf::from(out_path).join("include");
// These must match `CXXBRIDGE_RS` in depend/zcash/src/Makefile.am
let filenames = [
"blake2b",
"bundlecache",
"equihash",
"orchard_bundle",
"sapling",
"wallet_scanner",
];
// The output folder must exist
fs::create_dir_all(out_path.join("rust")).unwrap();
// Generate the generic header file
fs::write(out_path.join("rust/cxx.h"), cxx_gen::HEADER).unwrap();
// Generate the source and header for each bridge file
for filename in filenames {
println!(
"cargo:rerun-if-changed=depend/zcash/src/rust/src/{}.rs",
filename
);
let mut file =
fs::File::open(format!("depend/zcash/src/rust/src/{}.rs", filename).as_str()).unwrap();
let mut content = String::new();
file.read_to_string(&mut content).unwrap();
let ast = syn::parse_file(&content).unwrap();
let token_stream = ast.to_token_stream();
let mut opt = cxx_gen::Opt::default();
opt.include.push(cxx_gen::Include {
path: "rust/cxx.h".to_string(),
kind: cxx_gen::IncludeKind::Quoted,
});
let output = cxx_gen::generate_header_and_cc(token_stream, &opt).unwrap();
fs::write(out_path.join(format!("rust/{}.h", filename)), output.header).unwrap();
fs::write(
out_path.join(format!("rust/{}.c", filename)),
output.implementation,
)
.unwrap();
}
Ok(())
}
fn main() -> Result<()> {
bindgen_headers()?;
gen_cxxbridge()?;
let include_path = env::var("OUT_DIR").map_err(Error::Env)?;
let include_path = PathBuf::from(include_path).join("include");
let target = env::var("TARGET").expect("TARGET was not set");
let mut base_config = cc::Build::new();
@ -55,6 +127,7 @@ fn main() -> Result<()> {
.include("depend/zcash/src")
.include("depend/zcash/src/rust/include/")
.include("depend/zcash/src/secp256k1/include")
.include(&include_path)
.flag_if_supported("-Wno-implicit-fallthrough")
.flag_if_supported("-Wno-catch-value")
.flag_if_supported("-Wno-reorder")
@ -79,7 +152,7 @@ fn main() -> Result<()> {
base_config
.file("depend/zcash/src/script/zcash_script.cpp")
.file("depend/zcash/src/utilstrencodings.cpp")
.file("depend/zcash/src/util/strencodings.cpp")
.file("depend/zcash/src/uint256.cpp")
.file("depend/zcash/src/pubkey.cpp")
.file("depend/zcash/src/hash.cpp")
@ -93,6 +166,7 @@ fn main() -> Result<()> {
.file("depend/zcash/src/script/script.cpp")
.file("depend/zcash/src/script/script_error.cpp")
.file("depend/zcash/src/support/cleanse.cpp")
.file(include_path.join("rust/blake2b.c"))
.compile("libzcash_script.a");
Ok(())

View File

@ -0,0 +1,38 @@
name: Audits
on: [push, pull_request]
permissions:
contents: read
jobs:
cargo-vet:
name: Vet Rust dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-vet
uses: actions-rs/cargo@v1
with:
command: install
args: --git https://github.com/mozilla/cargo-vet.git cargo-vet
# This is necessary because `cargo vet --locked` implies `cargo metadata --frozen`,
# preventing all network access.
- name: Ensure dependency sources are present
uses: actions-rs/cargo@v1
with:
command: fetch
args: --locked
- name: Run cargo vet --locked
uses: actions-rs/cargo@v1
with:
command: vet
args: --locked

View File

@ -1,129 +0,0 @@
*.tar.gz
*.deb
*.exe
src/bitcoin
src/zcashd
src/zcashd-wallet-tool
src/zcash-cli
src/zcash-gtest
src/zcash-tx
src/test/test_bitcoin
zcutil/bin/
*zcashTest.pk
*zcashTest.vk
# autoreconf
Makefile.in
aclocal.m4
autom4te.cache/
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/m4/libtool.m4
build-aux/m4/lt~obsolete.m4
build-aux/m4/ltoptions.m4
build-aux/m4/ltsugar.m4
build-aux/m4/ltversion.m4
build-aux/missing
build-aux/compile
build-aux/test-driver
config.log
config.status
configure
libtool
src/config/bitcoin-config.h
src/config/bitcoin-config.h.in
src/config/stamp-h1
share/setup.nsi
confdefs.h
conftest.cpp
conftest.err
cache/
venv-mnf/
src/univalue/gen
.deps
.dirstamp
.libs
.*.swp
*.*~*
*.bak
*.rej
*.orig
*.pyc
*.o
*.o.tmp
*.o-*
.zcash
*.a
*.lib
*.pb.cc
*.pb.h
.vscode
*.log
*.trs
*.dmg
*.json.h
*.raw.h
#libtool object files
*.lo
*.la
# Compilation
Makefile
# Rust
.cargo/.configured-for-*
.cargo/config
target/
# Unit-tests
Makefile.test
src/test/buildenv.py
# Resources cpp
qrc_*.cpp
# Mac specific
.DS_Store
build
#lcov
*.gcno
*.gcda
/*.info
test_bitcoin.coverage/
zcash-gtest.coverage/
total.coverage/
coverage_percent.txt
afl-temp
#build tests
linux-coverage-build
linux-build
win32-build
qa/pull-tester/tests_config.py
qa/pull-tester/tests_config.ini
qa/cache/*
!src/leveldb*/Makefile
/doc/doxygen/
libzcash_script.pc
contrib/debian/files
contrib/debian/substvars
src/fuzzing/*/input
src/fuzzing/*/output
src/fuzz.cpp
.updatecheck-token

View File

@ -30,9 +30,18 @@ dependencies. For further details see 'contrib/debian/copyright'.
Although almost all of the Zcash code is licensed under "permissive" open source
licenses, users and distributors should note that when built using the default
build options, Zcash depends on Oracle Berkeley DB 6.2.x, which is licensed
under the GNU Affero General Public License.
licenses, there are two dependencies that use "copyleft" open source licenses:
- Users and distributors should note that when built using the default build
options, zcashd depends on Oracle Berkeley DB 6.2.x, which is licensed under
the GNU Affero General Public License.
- Downstream code forks should note that zcashd depends on the 'orchard' crate,
which is licensed under the Bootstrap Open Source License.
A license exception is provided allowing some derived works that are linked or
combined with the 'orchard' crate to be copied or distributed under the original
licenses (in this case documented in 'contrib/debian/copyright'), provided that
the included portions of the 'orchard' code remain subject to BOSL.
See https://github.com/zcash/orchard/blob/main/COPYING for details of which
projects can make use of this exception.
Contributors should understand licensing implications before modifying the

239
depend/zcash/Cargo.lock generated
View File

@ -49,15 +49,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "aho-corasick"
version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [
"memchr",
]
[[package]]
name = "ansi_term"
version = "0.12.1"
@ -79,12 +70,6 @@ version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
[[package]]
name = "arrayvec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
name = "arrayvec"
version = "0.7.2"
@ -135,9 +120,9 @@ checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b"
[[package]]
name = "bellman"
version = "0.13.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d96d7f4f3dc9a699bdef1d19648f6f20ef966b51892d224582a4475be669cb5"
checksum = "a4dd656ef4fdf7debb6d87d4dd92642fcbcdb78cbf6600c13e25c87e4d1a3807"
dependencies = [
"bitvec",
"blake2s_simd",
@ -186,17 +171,6 @@ dependencies = [
"wyz",
]
[[package]]
name = "blake2b_simd"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587"
dependencies = [
"arrayref",
"arrayvec 0.5.2",
"constant_time_eq",
]
[[package]]
name = "blake2b_simd"
version = "1.0.0"
@ -204,7 +178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127"
dependencies = [
"arrayref",
"arrayvec 0.7.2",
"arrayvec",
"constant_time_eq",
]
@ -215,7 +189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4"
dependencies = [
"arrayref",
"arrayvec 0.7.2",
"arrayvec",
"constant_time_eq",
]
@ -464,13 +438,32 @@ dependencies = [
]
[[package]]
name = "dashmap"
version = "4.0.2"
name = "cxx"
version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c"
checksum = "b7c14d679239b1ccaad7acaf972a19b41b6c1d7a8cb942158294b4f11ec71bd8"
dependencies = [
"cfg-if 1.0.0",
"num_cpus",
"cc",
"cxxbridge-flags",
"cxxbridge-macro",
"link-cplusplus",
]
[[package]]
name = "cxxbridge-flags"
version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fdfa84261f05a9b69c0afe03270f9f26d6899ca7df6f442563908b646e8a376"
[[package]]
name = "cxxbridge-macro"
version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0269826813dfbda75223169c774fede73401793e9af3970e4edbe93879782c1d"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
@ -543,19 +536,13 @@ version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "endian-type"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
[[package]]
name = "equihash"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4127688f6177e3f57521881cb1cfd90d1228214f9dc43b8efe6f6c6948cd8280"
checksum = "ab579d7cf78477773b03e80bc2f89702ef02d7112c711d54ca93dcdce68533d5"
dependencies = [
"blake2b_simd 0.5.11",
"blake2b_simd",
"byteorder",
]
@ -565,7 +552,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a83e8d7fd0c526af4aad893b7c9fe41e2699ed8a776a6c74aecdeafe05afc75"
dependencies = [
"blake2b_simd 1.0.0",
"blake2b_simd",
]
[[package]]
@ -722,11 +709,11 @@ dependencies = [
[[package]]
name = "halo2_gadgets"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13f3914f58cc4af5e4fe83d48b02d582be18976bc7e96c3151aa2bf1c98e9f60"
checksum = "85e10bf9924da1754e443641c9e7f9f00483749f8fb837fde696ef6ed6e2f079"
dependencies = [
"arrayvec 0.7.2",
"arrayvec",
"bitvec",
"ff",
"group",
@ -740,16 +727,17 @@ dependencies = [
[[package]]
name = "halo2_proofs"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760"
checksum = "cff771b9a2445cd2545c9ef26d863c290fbb44ae440c825a20eb7156f67a949a"
dependencies = [
"blake2b_simd 1.0.0",
"blake2b_simd",
"ff",
"group",
"pasta_curves",
"rand_core 0.6.3",
"rayon",
"tracing",
]
[[package]]
@ -963,11 +951,13 @@ dependencies = [
"anyhow",
"backtrace",
"bellman",
"blake2b_simd 1.0.0",
"blake2b_simd",
"blake2s_simd",
"bls12_381",
"byteorder",
"clearscreen",
"crossbeam-channel",
"cxx",
"ed25519-zebra",
"group",
"gumdrop",
@ -982,6 +972,7 @@ dependencies = [
"orchard",
"rand 0.8.5",
"rand_core 0.6.3",
"rayon",
"secp256k1",
"secrecy",
"subtle",
@ -1000,6 +991,15 @@ dependencies = [
"zeroize",
]
[[package]]
name = "link-cplusplus"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8cae2cd7ba2f3f63938b9c724475dfb7b9861b545a90324476324ed21dbc8c8"
dependencies = [
"cc",
]
[[package]]
name = "lock_api"
version = "0.4.7"
@ -1063,9 +1063,9 @@ dependencies = [
[[package]]
name = "metrics"
version = "0.17.1"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55586aa936c35f34ba8aa5d97356d554311206e1ce1f9e68fe7b07288e5ad827"
checksum = "142c53885123b68d94108295a09d4afe1a1388ed95b54d5dacd9a454753030f2"
dependencies = [
"ahash",
"metrics-macros",
@ -1073,11 +1073,12 @@ dependencies = [
[[package]]
name = "metrics-exporter-prometheus"
version = "0.6.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "343a5ceb38235928e7a5687412590f07e6d281522dcd9ff51246f8856eef5fe5"
checksum = "953cbbb6f9ba4b9304f4df79b98cdc9d14071ed93065a9fca11c00c5d9181b66"
dependencies = [
"hyper",
"indexmap",
"ipnet",
"metrics",
"metrics-util",
@ -1085,41 +1086,34 @@ dependencies = [
"quanta",
"thiserror",
"tokio",
"tracing",
]
[[package]]
name = "metrics-macros"
version = "0.4.1"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0daa0ab3a0ae956d0e2c1f42511422850e577d36a255357d1a7d08d45ee3a2f1"
checksum = "49e30813093f757be5cf21e50389a24dc7dbb22c49f23b7e8f51d69b508a5ffa"
dependencies = [
"lazy_static",
"proc-macro2",
"quote",
"regex",
"syn",
]
[[package]]
name = "metrics-util"
version = "0.10.2"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1174223789e331d9d47a4a953dac36e397db60fa8d2a111ac505388c6c7fe32e"
checksum = "fd1f4b69bef1e2b392b2d4a12902f2af90bb438ba4a66aa222d1023fa6561b50"
dependencies = [
"ahash",
"aho-corasick",
"atomic-shim",
"crossbeam-epoch",
"crossbeam-utils",
"dashmap",
"hashbrown",
"indexmap",
"metrics",
"num_cpus",
"ordered-float",
"parking_lot",
"quanta",
"radix_trie",
"sketches-ddsketch",
]
@ -1156,15 +1150,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "nibble_vec"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43"
dependencies = [
"smallvec",
]
[[package]]
name = "nix"
version = "0.22.3"
@ -1275,13 +1260,13 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "orchard"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f918076e191a68d55c5517a16e075ecfe58fc63ed112408263f3d6194597bfcf"
checksum = "7619db7f917afd9b1139044c595fab1b6166de2db62317794b5f5e34a2104ae1"
dependencies = [
"aes",
"bitvec",
"blake2b_simd 1.0.0",
"blake2b_simd",
"ff",
"fpe",
"group",
@ -1297,18 +1282,10 @@ dependencies = [
"reddsa",
"serde",
"subtle",
"tracing",
"zcash_note_encryption",
]
[[package]]
name = "ordered-float"
version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87"
dependencies = [
"num-traits",
]
[[package]]
name = "pairing"
version = "0.22.0"
@ -1324,7 +1301,7 @@ version = "3.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8b44461635bbb1a0300f100a841e571e7d919c81c73075ef5d152ffdb521066"
dependencies = [
"arrayvec 0.7.2",
"arrayvec",
"bitvec",
"byte-slice-cast",
"impl-trait-for-tuples",
@ -1386,7 +1363,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "369d7785168ad7ff0cbe467d968ca3e19a927d8536b11ef9c21b4e454b15ba42"
dependencies = [
"blake2b_simd 1.0.0",
"blake2b_simd",
"ff",
"group",
"lazy_static",
@ -1495,11 +1472,11 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.37"
version = "1.0.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1"
checksum = "cdcc2916cde080c1876ff40292a396541241fe0072ef928cd76582e9ea5d60d2"
dependencies = [
"unicode-xid",
"unicode-ident",
]
[[package]]
@ -1533,16 +1510,6 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
[[package]]
name = "radix_trie"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd"
dependencies = [
"endian-type",
"nibble_vec",
]
[[package]]
name = "rand"
version = "0.7.3"
@ -1664,7 +1631,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cc8038c8b7e481bdf688d0585d4897ed0e9e0cee10aa365dde51238c20e4182"
dependencies = [
"blake2b_simd 1.0.0",
"blake2b_simd",
"byteorder",
"group",
"jubjub",
@ -1675,6 +1642,22 @@ dependencies = [
"zeroize",
]
[[package]]
name = "redjubjub"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6039ff156887caf92df308cbaccdc058c9d3155a913da046add6e48c4cdbd91d"
dependencies = [
"blake2b_simd",
"byteorder",
"digest 0.9.0",
"jubjub",
"rand_core 0.6.3",
"serde",
"thiserror",
"zeroize",
]
[[package]]
name = "redox_syscall"
version = "0.2.13"
@ -1701,8 +1684,6 @@ version = "1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
@ -1840,9 +1821,9 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
[[package]]
name = "sketches-ddsketch"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76a77a8fd93886010f05e7ea0720e569d6d16c65329dbe3ec033bbbccccb017b"
checksum = "04d2ecae5fcf33b122e2e6bd520a57ccf152d2dde3b38c71039df1a6867264ee"
[[package]]
name = "smallvec"
@ -1880,13 +1861,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
[[package]]
name = "syn"
version = "1.0.91"
version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d"
checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
"unicode-ident",
]
[[package]]
@ -1992,21 +1973,9 @@ dependencies = [
"mio",
"pin-project-lite",
"socket2",
"tokio-macros",
"winapi",
]
[[package]]
name = "tokio-macros"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "toml"
version = "0.5.9"
@ -2107,6 +2076,12 @@ dependencies = [
"static_assertions",
]
[[package]]
name = "unicode-ident"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
[[package]]
name = "unicode-normalization"
version = "0.1.19"
@ -2312,7 +2287,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb611a28a4e13ac715ee712f4344d6b279b767daf6345dafefb2c4bf582b6679"
dependencies = [
"blake2b_simd 1.0.0",
"blake2b_simd",
"byteorder",
"primitive-types",
]
@ -2331,14 +2306,14 @@ dependencies = [
[[package]]
name = "zcash_primitives"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcb1ef5719fb24b42450dcd6b10e6155793be5668f0d962ad8132b6e4d108635"
checksum = "4fbb401f5dbc482b831954aaa7cba0a8fe148241db6d19fe7cebda78252ca680"
dependencies = [
"aes",
"bip0039",
"bitvec",
"blake2b_simd 1.0.0",
"blake2b_simd",
"blake2s_simd",
"bls12_381",
"bs58",
@ -2368,12 +2343,12 @@ dependencies = [
[[package]]
name = "zcash_proofs"
version = "0.6.0"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e67054525b4897a97386ce562240f08ac9bcad07183130fe8d797224d712112d"
checksum = "98bf5f6af051dd929263f279b21b9c04c1f30116c70f3c190de2566677f245ef"
dependencies = [
"bellman",
"blake2b_simd 1.0.0",
"blake2b_simd",
"bls12_381",
"byteorder",
"directories",
@ -2382,6 +2357,8 @@ dependencies = [
"jubjub",
"lazy_static",
"rand_core 0.6.3",
"redjubjub",
"tracing",
"zcash_primitives",
]

View File

@ -1,4 +1,4 @@
Zcash 5.0.0
Zcash 5.2.0
<img align="right" width="120" height="80" src="doc/imgs/logo.png">
===========

View File

@ -1,7 +1,7 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 5)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_MINOR, 2)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 50)
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
@ -101,6 +101,7 @@ ZC_REQUIRE_TOOL(STRIP, strip)
ZC_REQUIRE_PROG([GIT], [git])
ZC_REQUIRE_PROG(RUSTC, rustc)
ZC_REQUIRE_PROG(CARGO, cargo)
ZC_REQUIRE_PROG(CXXBRIDGE, cxxbridge)
dnl This one is still optional and checked by complicated logic below:
AC_PATH_PROG(CCACHE,ccache)
dnl This one is not currently used anywhere, thus not required:
@ -175,6 +176,16 @@ AC_ARG_ENABLE([glibc-back-compat],
[use_glibc_compat=$enableval],
[use_glibc_compat=no])
AC_ARG_ENABLE([asm],
[AS_HELP_STRING([--disable-asm],
[disable assembly routines (enabled by default)])],
[use_asm=$enableval],
[use_asm=yes])
if test "x$use_asm" = xyes; then
AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines])
fi
AC_ARG_ENABLE([zmq],
[AS_HELP_STRING([--disable-zmq],
[disable ZMQ notifications])],
@ -308,6 +319,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wformat],[CXXFLAGS="$CXXFLAGS -Wformat"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wvla],[CXXFLAGS="$CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wformat-security],[CXXFLAGS="$CXXFLAGS -Wformat-security"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wthread-safety-analysis],[CXXFLAGS="$CXXFLAGS -Wthread-safety-analysis"],,[[$CXXFLAG_WERROR]])
## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
## unknown options if any other warning is produced. Test the -Wfoo case, and
@ -316,14 +328,23 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wself-assign],[CXXFLAGS="$CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wdeprecated-register],[CXXFLAGS="$CXXFLAGS -Wno-deprecated-register"],,[[$CXXFLAG_WERROR]])
# Check for optional instruction set support. Enabling these does _not_ imply that all code will
# be compiled with them, rather that specific objects/libs may use them after checking for runtime
# compatibility.
AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])
fi
enable_hwcrc32=no
enable_sse41=no
enable_avx2=no
enable_shani=no
if test "x$use_asm" = "xyes"; then
# Check for optional instruction set support. Enabling these does _not_ imply that all code will
# be compiled with them, rather that specific objects/libs may use them after checking for runtime
# compatibility.
AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-msse4.1],[[SSE41_CXXFLAGS="-msse4.1"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-mavx -mavx2],[[AVX2_CXXFLAGS="-mavx -mavx2"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-msse4 -msha],[[SHANI_CXXFLAGS="-msse4 -msha"]],,[[$CXXFLAG_WERROR]])
TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $SSE42_CXXFLAGS"
AC_MSG_CHECKING(for assembler crc32 support)
@ -346,6 +367,55 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
)
CXXFLAGS="$TEMP_CXXFLAGS"
TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $SSE41_CXXFLAGS"
AC_MSG_CHECKING(for SSE4.1 intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#include <immintrin.h>
]],[[
__m128i l = _mm_set1_epi32(0);
return _mm_extract_epi32(l, 3);
]])],
[ AC_MSG_RESULT(yes); enable_sse41=yes; AC_DEFINE(ENABLE_SSE41, 1, [Define this symbol to build code that uses SSE4.1 intrinsics]) ],
[ AC_MSG_RESULT(no)]
)
CXXFLAGS="$TEMP_CXXFLAGS"
TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $AVX2_CXXFLAGS"
AC_MSG_CHECKING(for AVX2 intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#include <immintrin.h>
]],[[
__m256i l = _mm256_set1_epi32(0);
return _mm256_extract_epi32(l, 7);
]])],
[ AC_MSG_RESULT(yes); enable_avx2=yes; AC_DEFINE(ENABLE_AVX2, 1, [Define this symbol to build code that uses AVX2 intrinsics]) ],
[ AC_MSG_RESULT(no)]
)
CXXFLAGS="$TEMP_CXXFLAGS"
TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $SHANI_CXXFLAGS"
AC_MSG_CHECKING(for SHA-NI intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#include <immintrin.h>
]],[[
__m128i i = _mm_set1_epi32(0);
__m128i j = _mm_set1_epi32(1);
__m128i k = _mm_set1_epi32(2);
return _mm_extract_epi32(_mm_sha256rnds2_epu32(i, i, k), 0);
]])],
[ AC_MSG_RESULT(yes); enable_shani=yes; AC_DEFINE(ENABLE_SHANI, 1, [Define this symbol to build code that uses SHA-NI intrinsics]) ],
[ AC_MSG_RESULT(no)]
)
CXXFLAGS="$TEMP_CXXFLAGS"
fi
CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
AC_ARG_WITH([utils],
@ -610,6 +680,7 @@ if test x$use_hardening != xno; then
AX_CHECK_COMPILE_FLAG([-Wformat-security],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wformat-security"],[AC_MSG_ERROR(Cannot enable -Wformat-security)],[-Wformat])
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"],[AC_MSG_ERROR(Cannot enable -Wstack-protector)])
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"],[AC_MSG_ERROR(Cannot enable -fstack-protector-all)])
AX_CHECK_COMPILE_FLAG([-Wthread-safety-analysis],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wthread-safety-analysis"],[AC_MSG_ERROR(Cannot enable -Wthread-safety-analysis)])
AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[
@ -683,6 +754,22 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
[ AC_MSG_RESULT(no)]
)
dnl check for gmtime_r(), fallback to gmtime_s() if that is unavailable
dnl fail if neither are available.
AC_MSG_CHECKING(for gmtime_r)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
[[ gmtime_r((const time_t *) nullptr, (struct tm *) nullptr); ]])],
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GMTIME_R, 1, [Define this symbol if gmtime_r is available]) ],
[ AC_MSG_RESULT(no);
AC_MSG_CHECKING(for gmtime_s);
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
[[ gmtime_s((struct tm *) nullptr, (const time_t *) nullptr); ]])],
[ AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no); AC_MSG_ERROR(Both gmtime_r and gmtime_s are unavailable) ]
)
]
)
AC_MSG_CHECKING([for visibility attribute])
AC_LINK_IFELSE([AC_LANG_SOURCE([
int foo_def( void ) __attribute__((visibility("default")));
@ -700,6 +787,29 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
]
)
TEMP_LDFLAGS="$LDFLAGS"
LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS"
AC_MSG_CHECKING([for thread_local support])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <thread>
static thread_local int foo = 0;
static void run_thread() { foo++;}
int main(){
for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();}
return foo;
}
])],
[
AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.])
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
]
)
LDFLAGS="$TEMP_LDFLAGS"
# Check for reduced exports
if test x$use_reduce_exports = xyes; then
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
@ -942,6 +1052,10 @@ AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes])
AM_CONDITIONAL([ENABLE_AVX2],[test x$enable_avx2 = xyes])
AM_CONDITIONAL([ENABLE_SHANI],[test x$enable_shani = xyes])
AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
@ -975,6 +1089,9 @@ AC_SUBST(PIE_FLAGS)
AC_SUBST(SANITIZER_CXXFLAGS)
AC_SUBST(SANITIZER_LDFLAGS)
AC_SUBST(SSE42_CXXFLAGS)
AC_SUBST(SSE41_CXXFLAGS)
AC_SUBST(AVX2_CXXFLAGS)
AC_SUBST(SHANI_CXXFLAGS)
AC_SUBST(LIBTOOL_APP_LDFLAGS)
AC_SUBST(BOOST_LIBS)
AC_SUBST(TESTDEFS)
@ -982,6 +1099,7 @@ AC_SUBST(LEVELDB_TARGET_FLAGS)
AC_SUBST(EVENT_LIBS)
AC_SUBST(EVENT_PTHREADS_LIBS)
AC_SUBST(ZMQ_LIBS)
AC_SUBST(HAVE_GMTIME_R)
AC_SUBST(LIBZCASH_LIBS)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile src/test/buildenv.py])
AC_CONFIG_FILES([qa/pull-tester/tests_config.ini],[chmod +x qa/pull-tester/tests_config.ini])
@ -1040,6 +1158,7 @@ echo "Options used to compile and link:"
echo " with wallet = $enable_wallet"
echo " with zmq = $use_zmq"
echo " with test = $use_tests"
echo " use asm = $use_asm"
echo " sanitizers = $use_sanitizers"
echo " debug enabled = $enable_debug"
echo " gprof enabled = $enable_gprof"

View File

@ -1,3 +1,27 @@
zcash (5.2.0) stable; urgency=medium
* 5.2.0 release.
-- Electric Coin Company <team@electriccoin.co> Mon, 25 Jul 2022 12:42:25 -0600
zcash (5.2.0~rc1) stable; urgency=medium
* 5.2.0-rc1 release.
-- Electric Coin Company <team@electriccoin.co> Fri, 22 Jul 2022 15:07:59 -0600
zcash (5.1.0) stable; urgency=medium
* 5.1.0 release.
-- Electric Coin Company <team@electriccoin.co> Fri, 08 Jul 2022 03:01:54 +0000
zcash (5.1.0~rc1) stable; urgency=medium
* 5.1.0-rc1 release.
-- Electric Coin Company <team@electriccoin.co> Tue, 05 Jul 2022 22:25:25 +0000
zcash (5.0.0) stable; urgency=medium
* 5.0.0 release.

View File

@ -160,8 +160,7 @@ Files: depends/sources/utfcpp-*.tar.gz
Copyright: 2006 Nemanja Trifunovic
License: Boost-Software-License-1.0
Files: depends/*/vendored-sources/halo2/*
depends/*/vendored-sources/orchard/*
Files: depends/*/vendored-sources/orchard/*
Copyright: 2020-2022 The Electric Coin Company
License: BOSL-1+ with Zcash exception
@ -228,6 +227,12 @@ Files: depends/*/vendored-sources/terminfo/*
Copyright: 2016-2020 meh <meh@schizofreni.co>
License: WTFPL
Files: depends/*/vendored-sources/unicode-ident/src/tables.rs
Copyright: 1991-2022 Unicode, Inc
License: Unicode
Comment: This entry is for code in the unicode-ident crate generated from Unicode data tables.
The license of the unicode-ident crate itself is MIT/Expat or Apache-2.0.
Files: src/crypto/ctaes/*
Copyright: 2016 Pieter Wuille
License: Expat
@ -1684,14 +1689,19 @@ License: BOSL-1+ with Zcash exception
version 1.0.
.
Only if this Original Work is included as part of the distribution of one of the
following projects ("the Project"):
following (each, the "Project"):
.
- The Zcash projects published by the Electric Coin Company,
- The Zebra project published by the Zcash Foundation,
- The Zcash projects published by the Electric Coin Company;
- The Zebra project published by the Zcash Foundation;
- A project that is designed to integrate with Zcash and provides additional
functionality or utility to the Zcash network and holders of the ZEC coin; or
- A blockchain that descends from the Zcash blockchain and that is forked
within 100 blocks of the current block height of the Zcash blockchain at the
time of the code fork;
.
then License is granted to use this package under the BOSL as modified by the
following clarification and special exception. This exception applies only to
the Original Work when linked or combined with the Project and not to the
then License is granted to use the Original Work under the BOSL as modified by
the following clarification and special exception. This exception applies only
to the Original Work when linked or combined with the Project and not to the
Original Work when linked, combined, or included in or with any other software
or project or on a standalone basis.
.
@ -1876,8 +1886,8 @@ License: BOSL-1
restricted or conditioned by this License or by law, and Licensor promises not
to interfere with or be responsible for such uses by You.
.
16. **Modification of This License.** This License is Copyright © 2007 Zooko
Wilcox-O'Hearn. Permission is granted to copy, distribute, or communicate this
16. **Modification of This License.** This License is Copyright © 2021-2022 Electric Coin Company.
Permission is granted to copy, distribute, or communicate this
License without modification. Nothing in this License permits You to modify
this License as applied to the Original Work or to Derivative Works. However,
You may modify the text of this License and copy, distribute or communicate
@ -1889,3 +1899,51 @@ License: BOSL-1
above with the notice "Licensed under <insert your license name here>" or with
a notice of your own that is not confusingly similar to the notice in this
License.
License: Unicode
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
.
See Terms of Use <https://www.unicode.org/copyright.html>
for definitions of Unicode Inc.s Data Files and Software.
.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
.
COPYRIGHT AND PERMISSION NOTICE
.
Copyright © 1991-2022 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.

View File

@ -32,6 +32,8 @@ if [[ -n "${ZCASHD_SHOWMETRICS}" ]];then ZCASHD_CMD+=" -showmetrics=${ZCASHD_SHO
if [[ -n "${ZCASHD_LOGIPS}" ]];then ZCASHD_CMD+=" -logips=${ZCASHD_LOGIPS}";fi
if [[ -n "${ZCASHD_EXPERIMENTALFEATURES}" ]];then ZCASHD_CMD+=" -experimentalfeatures=${ZCASHD_EXPERIMENTALFEATURES}";fi
if [[ -n "${ZCASHD_GEN}" ]];then ZCASHD_CMD+=" -gen=${ZCASHD_GEN}";fi
if [[ -n "${ZCASHD_EQUIHASHSOLVER}" ]];then ZCASHD_CMD+=" -equihashsolver=${ZCASHD_EQUIHASHSOLVER}";fi
if [[ -n "${ZCASHD_GENPROCLIMIT}" ]];then ZCASHD_CMD+=" -genproclimit=${ZCASHD_GENPROCLIMIT}";fi
if [[ -n "${ZCASHD_ZSHIELDCOINBASE}" ]];then ZCASHD_CMD+=" -zshieldcoinbase=${ZCASHD_ZSHIELDCOINBASE}";fi
if [[ -n "${ZCASHD_RPCUSER}" ]];then ZCASHD_CMD+=" -rpcuser=${ZCASHD_RPCUSER}";fi
if [[ -n "${ZCASHD_RPCPASSWORD}" ]];then ZCASHD_CMD+=" -rpcpassword=${ZCASHD_RPCPASSWORD}";fi

View File

@ -1,5 +1,5 @@
---
name: "zcash-5.0.0"
name: "zcash-5.2.0"
enable_cache: true
distro: "debian"
suites:

View File

@ -32,6 +32,19 @@ define fetch_file
rm -rf $$($(1)_download_dir) ))
endef
define vendor_crate_deps
(test -f $$($(1)_source_dir)/$(5) || \
( mkdir -p $$($(1)_download_dir)/$(1) && echo Vendoring dependencies for $(1)... && \
tar -xf $(native_rust_cached) -C $$($(1)_download_dir) && \
tar --strip-components=1 -xf $$($(1)_source_dir)/$(2) -C $$($(1)_download_dir)/$(1) && \
patch -p1 -d $$($(1)_download_dir)/$(1) < $(PATCHES_PATH)/$(1)/$(3) && \
$$($(1)_download_dir)/native/bin/cargo vendor --locked --manifest-path $$($(1)_download_dir)/$(1)/$(4) $$($(1)_download_dir)/$(CRATE_REGISTRY) && \
cd $$($(1)_download_dir) && \
find $(CRATE_REGISTRY) | sort | tar --no-recursion -czf $$($(1)_download_dir)/$(5).temp -T - && \
mv $$($(1)_download_dir)/$(5).temp $$($(1)_source_dir)/$(5) && \
rm -rf $$($(1)_download_dir) ))
endef
define int_get_build_recipe_hash
$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1))
$(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1))

View File

@ -0,0 +1,54 @@
package=native_cxxbridge
# The version needs to match cxx in Cargo.toml
$(package)_version=1.0.72
$(package)_download_path=https://github.com/dtolnay/cxx/archive/refs/tags
$(package)_file_name=native_cxxbridge-$($(package)_version).tar.gz
$(package)_download_file=$($(package)_version).tar.gz
$(package)_sha256_hash=22b2ec9b6cbec281f4b4d8dc8e403e7ab276b9d2140d4e7074a1388a252c4c0b
$(package)_build_subdir=gen/cmd
$(package)_dependencies=native_rust
# This file is somewhat annoying to update, but can be done like so from the repo base:
# $ export VERSION=1.0.72
# $ rm .cargo/config .cargo/.configured-for-offline
# $ mkdir tmp
# $ cd tmp
# $ tar xf ../depends/sources/native_cxxbridge-$VERSION.tar.gz
# $ cd cxx-$VERSION
# $ cargo build --release --package=cxxbridge-cmd --bin=cxxbridge
# $ cargo clean
# $ cd ..
# $ mv cxx-$VERSION cxx-$VERSION-locked
# $ tar xf ../depends/sources/native_cxxbridge-$VERSION.tar.gz
# $ diff -urN cxx-$VERSION cxx-$VERSION-locked >../depends/patches/native_cxxbridge/lockfile.diff
$(package)_patches=lockfile.diff
$(package)_extra_sources=$(package)-$($(package)_version)-vendored.tar.gz
define $(package)_fetch_cmds
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
$(call vendor_crate_deps,$(package),$($(package)_file_name),lockfile.diff,Cargo.toml,$(package)-$($(package)_version)-vendored.tar.gz)
endef
define $(package)_extract_cmds
mkdir -p $($(package)_extract_dir) && \
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
tar --no-same-owner --strip-components=1 -xf $($(package)_source) && \
tar --no-same-owner -xf $($(package)_source_dir)/$(package)-$($(package)_version)-vendored.tar.gz
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/lockfile.diff && \
mkdir -p .cargo && \
echo "[source.crates-io]" >.cargo/config && \
echo "replace-with = \"vendored-sources\"" >>.cargo/config && \
echo "[source.vendored-sources]" >>.cargo/config && \
echo "directory = \"$(CRATE_REGISTRY)\"" >>.cargo/config
endef
define $(package)_build_cmds
cargo build --locked --offline --release --package=cxxbridge-cmd --bin=cxxbridge
endef
define $(package)_stage_cmds
cargo install --locked --offline --path=. --bin=cxxbridge --root=$($(package)_staging_prefix_dir)
endef

View File

@ -1,6 +1,6 @@
zcash_packages := libsodium utfcpp
zcash_packages := libsodium rustcxx utfcpp
packages := boost libevent zeromq $(zcash_packages) googletest
native_packages := native_clang native_ccache native_rust
native_packages := native_clang native_ccache native_rust native_cxxbridge
ifneq (,$(wildcard /etc/arch-release))
native_packages += native_libtinfo

View File

@ -0,0 +1,13 @@
package=rustcxx
$(package)_version=$(native_cxxbridge_version)
$(package)_file_name=$(native_cxxbridge_file_name)
$(package)_sha256_hash=$(native_cxxbridge_sha256_hash)
# Nothing to do, this was fetched by native_cxxbridge.
define $(package)_fetch_cmds
endef
define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/include/rust && \
cp include/cxx.h $($(package)_staging_prefix_dir)/include/rust
endef

View File

@ -0,0 +1,449 @@
diff -urN cxx-1.0.72/Cargo.lock cxx-1.0.72-locked/Cargo.lock
--- cxx-1.0.72/Cargo.lock 1970-01-01 01:00:00.000000000 +0100
+++ cxx-1.0.72-locked/Cargo.lock 2022-07-25 13:19:29.023791072 +0100
@@ -0,0 +1,445 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "adler"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+
+[[package]]
+name = "autocfg"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "cc"
+version = "1.0.73"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
+dependencies = [
+ "jobserver",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "clang-ast"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9c380e0de48337007dfc91b09eb75f567f5f08209437857fbaabbaf2e77e830"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "clap"
+version = "3.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54635806b078b7925d6e36810b1755f2a4b5b4d57560432c1ecf60bcbe10602b"
+dependencies = [
+ "bitflags",
+ "clap_lex",
+ "indexmap",
+ "strsim",
+ "textwrap",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
+dependencies = [
+ "os_str_bytes",
+]
+
+[[package]]
+name = "codespan-reporting"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
+dependencies = [
+ "termcolor",
+ "unicode-width",
+]
+
+[[package]]
+name = "crc32fast"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "cxx"
+version = "1.0.72"
+dependencies = [
+ "cc",
+ "cxx-build",
+ "cxx-gen",
+ "cxx-test-suite",
+ "cxxbridge-flags",
+ "cxxbridge-macro",
+ "link-cplusplus",
+ "rustversion",
+ "trybuild",
+]
+
+[[package]]
+name = "cxx-build"
+version = "1.0.72"
+dependencies = [
+ "cc",
+ "codespan-reporting",
+ "cxx-gen",
+ "once_cell",
+ "pkg-config",
+ "proc-macro2",
+ "quote",
+ "scratch",
+ "syn",
+]
+
+[[package]]
+name = "cxx-gen"
+version = "0.7.72"
+dependencies = [
+ "codespan-reporting",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "cxx-test-suite"
+version = "0.0.0"
+dependencies = [
+ "cxx",
+ "cxx-build",
+ "cxxbridge-flags",
+]
+
+[[package]]
+name = "cxxbridge-cmd"
+version = "1.0.72"
+dependencies = [
+ "clap",
+ "codespan-reporting",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "cxxbridge-flags"
+version = "1.0.72"
+
+[[package]]
+name = "cxxbridge-macro"
+version = "1.0.72"
+dependencies = [
+ "clang-ast",
+ "cxx",
+ "flate2",
+ "memmap",
+ "proc-macro2",
+ "quote",
+ "serde",
+ "serde_json",
+ "syn",
+]
+
+[[package]]
+name = "demo"
+version = "0.0.0"
+dependencies = [
+ "cxx",
+ "cxx-build",
+]
+
+[[package]]
+name = "dissimilar"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c97b9233581d84b8e1e689cdd3a47b6f69770084fc246e86a7f78b0d9c1d4a5"
+
+[[package]]
+name = "flate2"
+version = "1.0.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
+dependencies = [
+ "crc32fast",
+ "miniz_oxide",
+]
+
+[[package]]
+name = "glob"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
+
+[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+
+[[package]]
+name = "indexmap"
+version = "1.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
+dependencies = [
+ "autocfg",
+ "hashbrown",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
+
+[[package]]
+name = "jobserver"
+version = "0.1.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.126"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
+
+[[package]]
+name = "link-cplusplus"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8cae2cd7ba2f3f63938b9c724475dfb7b9861b545a90324476324ed21dbc8c8"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "memmap"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "miniz_oxide"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
+dependencies = [
+ "adler",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
+
+[[package]]
+name = "os_str_bytes"
+version = "6.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4"
+
+[[package]]
+name = "pkg-config"
+version = "0.3.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdcc2916cde080c1876ff40292a396541241fe0072ef928cd76582e9ea5d60d2"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8"
+
+[[package]]
+name = "ryu"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
+
+[[package]]
+name = "scratch"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96311ef4a16462c757bb6a39152c40f58f31cd2602a40fceb937e2bc34e6cbab"
+
+[[package]]
+name = "serde"
+version = "1.0.140"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.140"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "strsim"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
+
+[[package]]
+name = "syn"
+version = "1.0.98"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "textwrap"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
+
+[[package]]
+name = "toml"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "trybuild"
+version = "1.0.63"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "764b9e244b482a9b81bde596aa37aa6f1347bf8007adab25e59f901b32b4e0a0"
+dependencies = [
+ "dissimilar",
+ "glob",
+ "once_cell",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "termcolor",
+ "toml",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
+
+[[package]]
+name = "unicode-width"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

View File

@ -1,39 +1,39 @@
Zcash Contributors
==================
Jack Grigg (1142)
Kris Nuttycombe (524)
Jack Grigg (1190)
Kris Nuttycombe (570)
Simon Liu (460)
Sean Bowe (379)
Daira Hopwood (325)
Sean Bowe (389)
Daira Hopwood (334)
Eirik Ogilvie-Wigley (216)
Wladimir J. van der Laan (150)
Wladimir J. van der Laan (152)
Pieter Wuille (142)
Alfredo Garcia (119)
Taylor Hornby (118)
Marshall Gaucher (112)
Pieter Wuille (106)
Marshall Gaucher (116)
Ying Tong Lai (90)
Jonas Schnelli (90)
Jay Graber (89)
Larry Ruane (88)
Ying Tong Lai (87)
Marco Falke (82)
Cory Fields (75)
Marco Falke (85)
Cory Fields (78)
Matt Corallo (60)
sasha (58)
Nathan Wilcox (56)
Matt Corallo (52)
sasha (51)
practicalswift (38)
practicalswift (42)
Kevin Gallagher (38)
Dimitris Apostolou (38)
fanquake (36)
Carl Dong (26)
Gregory Maxwell (23)
Luke Dashjr (24)
Gregory Maxwell (24)
John Newbery (23)
Jorge Timón (22)
John Newbery (22)
Luke Dashjr (21)
furszy (18)
Jonathan "Duke" Leto (18)
syd (16)
Patick Strateman (16)
furszy (15)
Charlie O'Keefe (15)
avnish (14)
Per Grön (14)
@ -41,29 +41,30 @@ Benjamin Winston (13)
Steven Smith (12)
Pavel Janík (12)
Patrick Strateman (12)
Jeremy Rubin (12)
Ariel Gabizon (12)
Suhas Daftuar (11)
Paige Peterson (11)
Kaz Wesley (11)
João Barbosa (11)
Alex Morcos (11)
Philip Kaufmann (10)
Peter Todd (10)
Marius Kjærstad (10)
João Barbosa (10)
ying tong (9)
teor (9)
nomnombtc (9)
Zancas Wilcox (9)
Russell Yanofsky (9)
kozyilmaz (8)
Zancas Wilcox (8)
Jeremy Rubin (8)
Jeff Garzik (8)
Chun Kuan Lee (8)
Ben Wilson (8)
Karl-Johan Alm (7)
James O'Beirne (6)
David Mercer (6)
Daniel Kraft (6)
Daniel Cousens (6)
Chun Kuan Lee (6)
Casey Rodarmor (6)
jnewbery (5)
ca333 (5)
@ -78,36 +79,38 @@ sandakersmann (4)
gladcow (4)
WO (4)
Sjors Provoost (4)
Russell Yanofsky (4)
Nate Wilcox (4)
Jim Posen (4)
mruddy (3)
lpescher (3)
isle2983 (3)
elbandi (3)
Thomas Snider (3)
NikVolf (3)
Martin Ankerl (3)
Julian Fleischer (3)
Jim Posen (3)
Jason Davies (3)
Evan Klitzke (3)
Ethan Heilman (3)
Eric Lombrozo (3)
Danny Willems (3)
Ben Woosley (3)
Anthony Towns (3)
Alfie John (3)
Aditya Kulkarni (3)
whythat (2)
rofl0r (2)
ptschip (2)
noname45688@gmail.com (2)
kpcyrd (2)
kobake (2)
instagibbs (2)
hexabot (2)
face (2)
aniemerg (2)
Yuri Zhykin (2)
UdjinM6 (2)
Tim Ruffing (2)
Thomas Snider (2)
Solar Designer (2)
Sebastian Falbesoner (2)
Scott (2)
@ -121,19 +124,21 @@ Matthew King (2)
Mary Moore-Simmons (2)
Marek (2)
Joe Turgeon (2)
Jesse Cohen (2)
Jeffrey Czyz (2)
Jack Gavigan (2)
ITH4Coinomia (2)
Hennadii Stepanov (2)
Dan Raviv (2)
Dagur Valberg Johannsson (2)
Conrado Gouvea (2)
Bryant Eisenbach (2)
Brian Stafford (2)
Brad Miller (2)
Bjorn Hjortsberg (2)
Ben Woosley (2)
Amgad Abdelhafez (2)
Alex Tsankov (2)
Akio Nakamura (2)
Aditya Kulkarni (2)
ロハン ダル (1)
zathras-crypto (1)
vim88 (1)
@ -143,13 +148,13 @@ tpantin (1)
sgmoore (1)
randy-waterhouse (1)
plutoforever (1)
nathannaveen (1)
murrayn (1)
mrbandrews (1)
kirkalx (1)
kazcw (1)
jeff-liang (1)
jc (1)
instagibbs (1)
glowang (1)
ewillbefull@gmail.com (1)
emilrus (1)
@ -206,7 +211,7 @@ Karel Bilek (1)
Josh Lehan (1)
Josh Ellithorpe (1)
Jonas Nick (1)
Jesse Cohen (1)
Jon Layton (1)
Jeffrey Walton (1)
Janito Vaqueiro Ferreira Filho (1)
Jainan-Tandel (1)
@ -214,7 +219,6 @@ Igor Cota (1)
Ian T (1)
Ian Munoz (1)
Ian Kelling (1)
Hennadii Stepanov (1)
Gregory Sanders (1)
Gaurav Rana (1)
Forrest Voight (1)
@ -225,7 +229,6 @@ Dimitris Tsapakidis (1)
DesWurstes (1)
Denis Lukianov (1)
David Llop (1)
Dan Raviv (1)
Christian von Roques (1)
Chirag Davé (1)
Cameron Boehmer (1)

View File

@ -2,11 +2,13 @@
[zcashd](README.md)
- [User Documentation](user.md)
- [Platform Support](user/platform-support.md)
- [Metrics](user/metrics.md)
- [Deprecated Features](user/deprecation.md)
- [Developer Documentation](dev.md)
- [Rust in `zcashd`](dev/rust.md)
- [Regtest tips and hints](dev/regtest.md)
- [Platform Tier Policy](dev/platform-tier-policy.md)
- [Deprecation Procedure](dev/deprecation.md)
- [Design](design.md)
- [Chain state](design/chain-state.md)

View File

@ -0,0 +1,136 @@
# Platform Tier Policy
## General
ECC provides three tiers of platform support, modeled after the
[Rust Target Tier Policy](https://doc.rust-lang.org/stable/rustc/platform-tier-policy.html):
- The Zcash developers provide no guarantees about tier 3 platforms; they exist in the
codebase, but may or may not build.
- ECC's continuous integration checks that tier 2 platforms will always build, but they
may or may not pass tests.
- ECC's continuous integration checks that tier 1 platforms will always build and pass
tests.
Adding a new tier 3 platform imposes minimal requirements; we focus primarily on avoiding
disruption to other ongoing Zcash development.
Tier 2 and tier 1 platforms place work on Zcash developers as a whole, to avoid breaking
the platform. The broader Zcash community may also feel more inclined to support
higher-tier platforms in their downstream uses of `zcashd` (though they are not obligated
to do so). Thus, these tiers require commensurate and ongoing efforts from the maintainers
of the platform, to demonstrate value and to minimize any disruptions to ongoing Zcash
development.
This policy defines the requirements for accepting a proposed platform at a given level of
support.
Each tier builds on all the requirements from the previous tier, unless overridden by a
stronger requirement.
While these criteria attempt to document the policy, that policy still involves human
judgment. Platforms must fulfill the spirit of the requirements as well, as determined by
the judgment of the approving reviewers. Reviewers and team members evaluating platforms
and platform-specific patches should always use their own best judgment regarding the
quality of work, and the suitability of a platform for the Zcash project. Neither this
policy nor any decisions made regarding platforms shall create any binding agreement or
estoppel by any party.
For a list of all supported platforms and their corresponding tiers ("tier 3", "tier 2",
or "tier 1"), see [Platform Support](../user/platform-support.md).
The availability or tier of a platform in Zcash releases is not a hard stability guarantee
about the future availability or tier of that platform. Higher-level platform tiers are an
increasing commitment to the support of a platform, and we will take that commitment and
potential disruptions into account when evaluating the potential demotion or removal of a
platform that has been part of a stable release. The promotion or demotion of a platform
will not generally affect existing stable releases, only current development and future
releases.
In this policy, the words "MUST" and "MUST NOT" specify absolute requirements that a
platform must meet to qualify for a tier. The words "SHOULD" and "SHOULD NOT" specify
requirements that apply in almost all cases, but for which the approving teams may grant
an exception for good reason. The word "MAY" indicates something entirely optional, and
does not indicate guidance or recommendations. This language is based on
[IETF RFC 2119](https://tools.ietf.org/html/rfc2119).
## Tier 3 platform policy
At this tier, ECC provides no official support for a platform, so we place minimal
requirements on the introduction of platforms.
A proposed new tier 3 platform MUST be reviewed and approved by a member of the ECC core
team based on these requirements.
- The platform MUST provide documentation for the Zcash community explaining how to build
for the platform, using cross-compilation if possible. If the platform supports running
binaries, or running tests (even if they do not pass), the documentation MUST explain
how to run such binaries or tests for the platform, using emulation if possible or
dedicated hardware if necessary.
- Tier 3 platforms MUST NOT impose burden on the authors of pull requests, or other
developers in the community, to maintain the platform. In particular, do not post
comments (automated or manual) on a PR that derail or suggest a block on the PR based on
a tier 3 platform. Do not send automated messages or notifications (via any medium,
including via @) to a PR author or others involved with a PR regarding a tier 3
platform, unless they have opted into such messages.
- Patches adding or updating tier 3 platforms MUST NOT break any existing tier 2 or tier 1
platform, and MUST NOT knowingly break another tier 3 platform without approval of the
ECC core team.
If a tier 3 platform stops meeting these requirements, or the platform shows no signs of
activity and has not built for some time, or removing the platform would improve the
quality of the Zcash codebase, we MAY post a PR to remove it.
## Tier 2 platform policy
At this tier, the Zcash developers guarantee that a platform builds, and will reject
patches that fail to build for a platform. Thus, we place requirements that ensure the
platform will not block forward progress of the Zcash project.
A proposed new tier 2 platform MUST be reviewed and approved by the ECC core team based
on these requirements.
In addition, the ECC infrastructure team MUST approve the integration of the platform into
Continuous Integration (CI), and the tier 2 CI-related requirements. This review and
approval MAY take place in a PR adding the platform to CI, or simply by an infrastructure
team member reporting the outcome of a team discussion.
- A tier 2 platform MUST have value to people other than its proponents. (It MAY still be
a niche platform, but it MUST NOT be exclusively useful for an inherently closed group.)
- A tier 2 platform MUST have a designated team of developers (the "platform maintainers")
supporting it, without the need for a paid support contract.
- The platform MUST NOT place undue burden on Zcash developers not specifically concerned
with that platform. Zcash developers are expected to not gratuitously break a tier 2
platform, but are not expected to become experts in every tier 2 platform, and are not
expected to provide platform-specific implementations for every tier 2 platform.
- The platform MUST build reliably in CI, for all components that ECC's CI considers
mandatory.
- All requirements for tier 3 apply.
A tier 2 platform MAY be demoted or removed if it no longer meets these requirements.
## Tier 1 platform policy
At this tier, the Zcash developers guarantee that a platform builds and passes all tests,
and will reject patches that fail to build or pass the test suite on a platform. We hold
tier 1 platforms to our highest standard of requirements.
- Tier 1 platforms MUST have substantial, widespread interest within the Zcash community,
and MUST serve the ongoing needs of multiple production users of Zcash across multiple
organizations or projects. These requirements are subjective. A tier 1 platform MAY be
demoted or removed if it becomes obsolete or no longer meets this requirement.
- The platform MUST build and pass tests reliably in CI, for all components that ECC's CI
considers mandatory.
- Building the platform and running the test suite for the platform MUST NOT take
substantially longer than other platforms, and SHOULD NOT substantially raise the
maintenance burden of the CI infrastructure.
- Tier 1 platforms MUST NOT have a hard requirement for signed, verified, or otherwise
"approved" binaries. Developers MUST be able to build, run, and test binaries for the
platform on systems they control, or provide such binaries for others to run. (Doing so
MAY require enabling some appropriate "developer mode" on such systems, but MUST NOT
require the payment of any additional fee or other consideration, or agreement to any
onerous legal agreements.)
- All requirements for tier 2 apply.
A tier 1 platform MAY be demoted or removed if it no longer meets these requirements but
still meets the requirements for a lower tier.

View File

@ -3,6 +3,26 @@
`zcashd` is primarily a C++ codebase, but most new code is being written in Rust
where possible.
## Auditing Rust dependencies
We use [`cargo-vet`] to audit our Rust dependencies. This means that after
adding a new dependency, or updating existing dependencies with `cargo update`,
CI will fail until corresponding audits have been added.
We also have a significant number of pre-existing unaudited dependency versions
that are excluded from auditing checks. We aim to reduce this list over time.
New entries should not be added to the exclusion list without justification.
To audit a dependency, first [install `cargo-vet`] and then follow the
["Performing Audits" guide]. If you are updating a dependency then instead of
auditing the new version in its entirety, you can optionally just audit the
delta between the old and new versions - even if the old version is in the
"unaudited" exclusion list.
[`cargo-vet`]: https://github.com/mozilla/cargo-vet
[install `cargo-vet`]: https://mozilla.github.io/cargo-vet/install.html
["Performing Audits" guide]: https://mozilla.github.io/cargo-vet/performing-audits.html
## Adding new dependencies in online-Rust mode
The `zcashd` build system pins all dependencies, and in order to facilitate

View File

@ -55,6 +55,11 @@ default as of release 5.3.0.
using this metadata be updated to use the `pool` or `address_type`
attributes, which have replaced the `type` attribute, as appropriate.
### Deprecated in 5.1.0
- `wallettxvjoinsplit` - The `vjoinsplit` attribute returned by the
`gettransaction` RPC method is deprecated.
Stage 2
-------
@ -69,3 +74,10 @@ The following features are disabled by default, and will be removed in release 5
- `zcrawreceive` - The `zcrawreceive` RPC method is disabled.
- `zcrawjoinsplit` - The `zcrawjoinsplit` RPC method is disabled.
- `zcrawkeygen` - The `zcrawkeygen` RPC method is disabled.
### Disabled in 5.0.1
The following features are disabled by default, and will be removed in release 5.3.0.
- `dumpwallet` - The `dumpwallet` RPC method is disabled.

View File

@ -0,0 +1,51 @@
# Platform Support
Support for different platforms (build "targets" and operating systems) are organised into
three tiers, each with a different set of guarantees. For more information on the policies
for targets at each tier, see the [Platform Tier Policy](../dev/platform-tier-policy.md).
## Tier 1
Tier 1 platforms can be thought of as "guaranteed to work". ECC builds official binary
releases for each tier 1 platform, and automated testing ensures that each tier 1 platform
builds and passes tests after each change.
"End of Support" dates are the latest currently-known date after which the platform will
be removed from tier 1. These dates are subject to change.
| target | OS | End of Support |
| ----------------------- | ------------ | -------------- |
| `x86_64-pc-linux-gnu` | CentOS 8 | TBD |
| | Debian 10 | June 2024 |
| | Debian 11 | June 2026 |
| | Ubuntu 18.04 | April 2023 |
| | Ubuntu 20.04 | April 2025 |
## Tier 2
Tier 2 platforms can be thought of as "guaranteed to build". ECC builds official binary
releases for each tier 2 platform, and automated builds ensure that each tier 2 platform
builds after each change. Automated tests are not always run so it's not guaranteed to
produce a working build, but tier 2 platforms often work to quite a good degree, and
patches are always welcome!
"End of Support" dates are the latest currently-known date after which the platform will
be removed from tier 2. These dates are subject to change.
| target | OS | End of Support |
| ----------------------- | ------------ | -------------- |
| N/A |
## Tier 3
Tier 3 platforms are those for which the `zcashd` codebase has support, but ECC does not
require builds or tests to pass, so these may or may not work. Official builds are not
available.
| target | OS | notes |
| ----------------------- | ------------ | ----- |
| `x86_64-pc-linux-gnu` | Arch |
| `x86_64-unknown-freebsd`| FreeBSD |
| `x86_64-w64-mingw32` | Windows | 64-bit MinGW |
| `x86_64-apple-darwin16` | macOS 10.14+ |
| `aarch64-linux-gnu` | ARM64 Linux |

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASH-CLI "1" "May 2022" "zcash-cli v5.0.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
.TH ZCASH-CLI "1" "July 2022" "zcash-cli v5.2.0" "User Commands"
.SH NAME
zcash-cli \- manual page for zcash-cli v5.0.0
zcash-cli \- manual page for zcash-cli v5.2.0
.SH DESCRIPTION
Zcash RPC client version v5.0.0
Zcash RPC client version v5.2.0
.PP
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASH-TX "1" "May 2022" "zcash-tx v5.0.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
.TH ZCASH-TX "1" "July 2022" "zcash-tx v5.2.0" "User Commands"
.SH NAME
zcash-tx \- manual page for zcash-tx v5.0.0
zcash-tx \- manual page for zcash-tx v5.2.0
.SH DESCRIPTION
Zcash zcash\-tx utility version v5.0.0
Zcash zcash\-tx utility version v5.2.0
.SS "Usage:"
.TP
zcash\-tx [options] <hex\-tx> [commands]

View File

@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASHD-WALLET-TOOL "1" "May 2022" "zcashd-wallet-tool v5.0.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
.TH ZCASHD-WALLET-TOOL "1" "July 2022" "zcashd-wallet-tool v5.2.0" "User Commands"
.SH NAME
zcashd-wallet-tool \- manual page for zcashd-wallet-tool v5.0.0
zcashd-wallet-tool \- manual page for zcashd-wallet-tool v5.2.0
.SH SYNOPSIS
.B zcashd-wallet-tool
[\fI\,OPTIONS\/\fR]

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASHD "1" "May 2022" "zcashd v5.0.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
.TH ZCASHD "1" "July 2022" "zcashd v5.2.0" "User Commands"
.SH NAME
zcashd \- manual page for zcashd v5.0.0
zcashd \- manual page for zcashd v5.2.0
.SH DESCRIPTION
Zcash Daemon version v5.0.0
Zcash Daemon version v5.2.0
.PP
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.
@ -31,9 +31,10 @@ long fork (%s in cmd is replaced by message)
Explicitly allow the use of the specified deprecated feature. Multiple
instances of this parameter are permitted; values for <feature> must be
selected from among {"none", "addrtype", "getnewaddress",
"getrawchangeaddress", "legacy_privacy", "z_getbalance",
"z_getnewaddress", "z_gettotalbalance", "z_listaddresses",
"zcrawjoinsplit", "zcrawkeygen", "zcrawreceive"}
"getrawchangeaddress", "legacy_privacy", "wallettxvjoinsplit",
"z_getbalance", "z_getnewaddress", "z_gettotalbalance",
"z_listaddresses", "dumpwallet", "zcrawjoinsplit", "zcrawkeygen",
"zcrawreceive"}
.HP
\fB\-blocknotify=\fR<cmd>
.IP
@ -110,14 +111,12 @@ for block files)
.HP
\fB\-reindex\-chainstate\fR
.IP
Rebuild chain state from the currently indexed blocks (implies \fB\-rescan\fR
unless pruning or unless \fB\-rescan\fR=\fI\,0\/\fR is explicitly specified)
Rebuild chain state from the currently indexed blocks (implies \fB\-rescan\fR)
.HP
\fB\-reindex\fR
.IP
Rebuild chain state and block index from the blk*.dat files on disk
(implies \fB\-rescan\fR unless pruning or unless \fB\-rescan\fR=\fI\,0\/\fR is explicitly
specified)
(implies \fB\-rescan\fR)
.HP
\fB\-sysperms\fR
.IP
@ -579,6 +578,13 @@ output (default: 1 if running in a console, 0 otherwise)
.IP
Number of seconds between metrics refreshes (default: 1 if running in a
console, 600 otherwise)
.PP
Compatibility options:
.HP
\fB\-preferredtxversion\fR
.IP
Preferentially create transactions having the specified version when
possible (default: 4)
.SH COPYRIGHT
In order to ensure you are adequately protecting your privacy when using Zcash,

View File

@ -8,20 +8,20 @@ release, in order to follow the NU5 network upgrade.
The following ZIPs are being deployed, or have been updated, as part of this upgrade:
* [ZIP 32 : Shielded Hierarchical Deterministic Wallets (updated)](https://zips.z.cash/zip_0032)
* [ZIP 203: Transaction Expiry (updated)](https://zips.z.cash/zip_0203)
* [ZIP 209: Prohibit Negative Shielded Chain Value Pool Balances (updated)](https://zips.z.cash/zip_0209)
* [ZIP 212: Allow Recipient to Derive Ephemeral Secret from Note Plaintext (updated)](https://zips.z.cash/zip_0212)
* [ZIP 213: Shielded Coinbase (updated)](https://zips.z.cash/zip_0213)
* [ZIP 216: Require Canonical Jubjub Point Encodings](https://zips.z.cash/zip_0216)
* [ZIP 221: FlyClient - Consensus-Layer Changes (updated)](https://zips.z.cash/zip_0221)
* [ZIP 224: Orchard Shielded Protocol](https://zips.z.cash/zip_0224)
* [ZIP 225: Version 5 Transaction Format](https://zips.z.cash/zip_0225)
* [ZIP 239: Relay of Version 5 Transactions](https://zips.z.cash/zip_0239)
* [ZIP 244: Transaction Identifier Non-Malleability](https://zips.z.cash/zip_0244)
* [ZIP 252: Deployment of the NU5 Network Upgrade](https://zips.z.cash/zip_0252)
* [ZIP 316: Unified Addresses and Unified Viewing Keys](https://zips.z.cash/zip_0316)
* [ZIP 401: Addressing Mempool Denial-of-Service (clarified)](https://zips.z.cash/zip_0401)
* [ZIP 32 : Shielded Hierarchical Deterministic Wallets (updated)](https://zips.z.cash/zip-0032)
* [ZIP 203: Transaction Expiry (updated)](https://zips.z.cash/zip-0203)
* [ZIP 209: Prohibit Negative Shielded Chain Value Pool Balances (updated)](https://zips.z.cash/zip-0209)
* [ZIP 212: Allow Recipient to Derive Ephemeral Secret from Note Plaintext (updated)](https://zips.z.cash/zip-0212)
* [ZIP 213: Shielded Coinbase (updated)](https://zips.z.cash/zip-0213)
* [ZIP 216: Require Canonical Jubjub Point Encodings](https://zips.z.cash/zip-0216)
* [ZIP 221: FlyClient - Consensus-Layer Changes (updated)](https://zips.z.cash/zip-0221)
* [ZIP 224: Orchard Shielded Protocol](https://zips.z.cash/zip-0224)
* [ZIP 225: Version 5 Transaction Format](https://zips.z.cash/zip-0225)
* [ZIP 239: Relay of Version 5 Transactions](https://zips.z.cash/zip-0239)
* [ZIP 244: Transaction Identifier Non-Malleability](https://zips.z.cash/zip-0244)
* [ZIP 252: Deployment of the NU5 Network Upgrade](https://zips.z.cash/zip-0252)
* [ZIP 316: Unified Addresses and Unified Viewing Keys](https://zips.z.cash/zip-0316)
* [ZIP 401: Addressing Mempool Denial-of-Service (clarified)](https://zips.z.cash/zip-0401)
Feature Deprecation and removal
-------------------------------

View File

@ -0,0 +1,222 @@
Notable changes
===============
Faster block validation for Sapling and Orchard transactions
------------------------------------------------------------
Block validation in `zcashd` is a mostly single-threaded process, due to how the
chain update logic inherited from Bitcoin Core is written. However, certain more
computationally intensive checks are performed more efficiently than checking
everything individually:
- ECDSA signatures on transparent inputs are checked via multithreading.
- RedPallas signatures on Orchard actions are checked via batch validation.
As of this release, `zcashd` applies these techniques to more Sapling and
Orchard components:
- RedJubjub signatures on Sapling Spends are checked via batch validation.
- Groth16 proofs for Sapling Spends and Outputs are checked via batch validation
and multithreading.
- Halo 2 proofs for Orchard Actions are checked via batch validation and
multithreading.
This reduces worst-case block validation times for observed historic blocks by
around 80% on a Ryzen 9 5950X CPU.
The number of threads used for checking Groth16 and Halo 2 proofs (as well as
for creating them when spending funds) can be set via the `RAYON_NUM_THREADS`
environment variable.
Option handling
---------------
- A new `-preferredtxversion` argument allows the node to preferentially create
transactions of a specified version, if a transaction does not contain
components that necessitate creation with a specific version. For example,
setting `-preferredtxversion=4` will cause the node to create V4 transactions
whenever the transaction does not contain Orchard components. This can be
helpful if recipients of transactions are likely to be using legacy wallets
that have not yet been upgraded to support parsing V5 transactions.
RPC interface
-------------
- The `getrawtransaction` RPC method now includes details about Orchard actions
within transactions.
Deprecated
----------
As of this release, the following previously deprecated features are disabled
by default, but may be be reenabled using `-allowdeprecated=<feature>`.
- The `dumpwallet` RPC method is disabled. It may be reenabled with
`allowdeprecated=dumpwallet`. `dumpwallet` should not be used; it is
unsafe for backup purposes as it does not return any key information
for keys used to derive shielded addresses. Use `z_exportwallet` instead.
As of this release, the following features are deprecated, but remain available
by default. These features may be disabled by setting `-allowdeprecated=none`.
After at least 3 minor-version releases, these features will be disabled by
default and the following flags to `-allowdeprecated` will be required to
permit their continued use:
- `wallettxvjoinsplit` - controls availability of the deprecated `vjoinsplit`
attribute returned by the `gettransaction` RPC method.
Changelog
=========
Brian Stafford (2):
rpc: Add missing fields to getrawtransaction help text
rpc: add valueBalanceOrchard to getrawtransaction output
Chun Kuan Lee (1):
break circular dependency: random/sync -> util -> random/sync
Cory Fields (1):
threads: add a thread_local autoconf check
Daira Hopwood (4):
halo2 is now under MIT/Apache-2.0, so does not need a declaration in `contrib/debian/copyright`. fixes #5203
COPYING: Address feedback about the use of "permissive". Also refer to zcashd instead of "Zcash".
Upgrade to metrics 0.19.x and metrics-exporter-prometheus 0.10.x.
Apply cosmetic suggestions
Jack Grigg (39):
book: Add platform support information and tier policy
lint: Fix cargo patches linter when no patches are present
Shorten thread name prefix
Name currently-unnamed threads that we can rename
book: Capitalize key words in platform tier policy
book: Add FreeBSD to tier 3 platforms list
depends: Add cxx crate to dependencies
depends: Add cxxbridge command to dependencies
build: Pass `CC` etc. flags through to `cargo build`
build: Add non-verbose output for `cargo build`
depends: Add `rust/cxx.h` header as a dependency
Migrate Equihash Rust FFI to `cxx`
Migrate BLAKE2b Rust FFI to `cxx`
depends: Vendor dependencies of native_cxxbuild
Revert "Switched sync.{cpp,h} to std threading primitives."
qa: Fix sprout_sapling_migration RPC test to handle wallet RPC change
wallet: Clear witness caches on load if reindexing
Document that `-reindex` and `-salvagewallet` both imply `-rescan`
Update orchard license with current exception text
Note dependence on BOSL in COPYING
qa: `cargo vet init`
qa: Add `crypto-reviewed` and `license-reviewed` criteria for `cargo vet`
CI: Add workflow that runs `cargo vet --locked`
qa: Add audits for the crates directly maintained by the ECC core team
book: Add section about auditing Rust dependencies
qa: Fix `qa/zcash/create_benchmark_archive.py` script
qa: Generalise `extract_benchmark_data` in `performance-measurements.sh`
bench: Support multiple trees in FakeCoinsViewDB
bench: Add `ConnectBlock` benchmark using block 1708048
cargo vet fmt
Upgrade to `orchard 0.2.0`
Batch-validate Orchard proofs as well as Orchard signatures
test: Load the proof verification keys in Boost tests
bench: Add `ConnectBlock` benchmark using block 1723244
Use batch validation for Sapling proofs and signatures
qa: Reformat for latest cargo-vet
qa: Postpone dependency updates
Update release notes
qa: Add native_cxxbridge and rustcxx to update checker
Jesse Cohen (1):
Annotate AssertLockHeld() with ASSERT_CAPABILITY() for thread safety analysis
John Newbery (1):
[logging] Comment all continuing logs.
João Barbosa (1):
Remove unused fTry from push_lock
Kris Nuttycombe (27):
Fix incorrect links in 5.0.0 release notes.
Fix inconsistent caplitalization in copyright notices.
scripted-diff: Update Zcash copyrights to 2022
scripted-diff: Add 2016-2022 copyright headers for files added/modified in 2016
scripted-diff: Add 2017-2022 copyright headers for files added/modified in 2017
scripted-diff: Add 2018-2022 copyright headers for files added/modified in 2018
scripted-diff: Add 2019-2022 copyright headers for files added/modified in 2019
scripted-diff: Add 2020-2022 copyright headers for files added/modified in 2020
scripted-diff: Add 2021-2022 copyright headers for files added/modified in 2021
Ensure that anchor depth is > 0 when selecting an Orchard anchor.
Add configure~ to .gitignore
Return an error if attempting to use z_shieldcoinbase for Orchard shielding.
Only return active protocol components from z_gettreestate.
Revert "Only return active protocol components from z_gettreestate."
Only return `skipHash` for Orchard & Sapling roots at heights >= activation.
Add a CLI flag to preferentially send V4 tx.
Revert "Make `-reindex` and `-reindex-chainstate` imply `-rescan`"
Do not attempt to begin a rescan if reindexing.
Disable wallet commands that are unavailable in safe mode during -reindex
Guard map accesses.
Mark the `dumpwallet` RPC method as disabled.
Add a clock for testing with an offset from the system clock.
Apply suggestions from code review
Note that `gettransaction` doesn't provide shielded info in RPC help.
Deprecate the `vjoinsplit` field of `gettransaction` results.
Revert "Merge pull request #6037 from nuttycom/feature/clock_capability"
Replace "Disabled" Orchard AuthValidator with std::nullopt
Marco Falke (3):
qa: Initialize lockstack to prevent null pointer deref
sync: Add RecursiveMutex type alias
doc: Add comment to cs_main and mempool::cs
Matt Corallo (8):
Split CNode::cs_vSend: message processing and message sending
Make the cs_sendProcessing a LOCK instead of a TRY_LOCK
Lock cs_vSend and cs_inventory in a consistent order even in TRY
Always enforce lock strict lock ordering (try or not)
Fixup style a bit by moving { to the same line as if statements
Further-enforce lockordering by enforcing directly after TRY_LOCKs
Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost.
Fix fast-shutdown hang on ThreadImport+GenesisWait
Pieter Wuille (2):
Use a signal to continue init after genesis activation
Do diskspace check before import thread is started
Russell Yanofsky (5):
Add unit test for DEBUG_LOCKORDER code
MOVEONLY Move AnnotatedMixin declaration
Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection
Use LOCK macros for non-recursive locks
scripted-diff: Small locking rename
Sean Bowe (8):
Fix "transparent" example that should be "p2pkh"
Make shielded requirements error "debug" level rather than an error.
Introduce new Sapling verification API via cxx and switch consensus rules to use the new API.
Enable ZIP 216 for blocks prior to NU5 activation
Remove the old Sapling verification FFI APIs.
cargo fmt
Address clippy lints.
Update minimum chain work and set NU5 activation block hash for mainnet
Thomas Snider (1):
Switched sync.{cpp,h} to std threading primitives.
Marshall Gaucher (2):
add rpc parallel test group logic
Update walletbackup.py
practicalswift (3):
Remove unused code
Use -Wthread-safety-analysis if available (+ -Werror=thread-safety-analysis if --enable-werror)
Fix typos
sasha (2):
make-release.py: Versioning changes for 5.1.0-rc1.
make-release.py: Updated manpages for 5.1.0-rc1.
Ying Tong Lai (3):
Add orchard_bundle FFI.
Use orchard_bundle ffi in getrawtransaction.
Test getrawtransaction in wallet_orchard.py

View File

@ -0,0 +1,259 @@
Notable changes
===============
Faster block validation for Sapling and Orchard transactions
------------------------------------------------------------
Block validation in `zcashd` is a mostly single-threaded process, due to how the
chain update logic inherited from Bitcoin Core is written. However, certain more
computationally intensive checks are performed more efficiently than checking
everything individually:
- ECDSA signatures on transparent inputs are checked via multithreading.
- RedPallas signatures on Orchard actions are checked via batch validation.
As of this release, `zcashd` applies these techniques to more Sapling and
Orchard components:
- RedJubjub signatures on Sapling Spends are checked via batch validation.
- Groth16 proofs for Sapling Spends and Outputs are checked via batch validation
and multithreading.
- Halo 2 proofs for Orchard Actions are checked via batch validation and
multithreading.
This reduces worst-case block validation times for observed historic blocks by
around 80% on a Ryzen 9 5950X CPU.
The number of threads used for checking Groth16 and Halo 2 proofs (as well as
for creating them when spending funds) can be set via the `RAYON_NUM_THREADS`
environment variable.
Option handling
---------------
- A new `-preferredtxversion` argument allows the node to preferentially create
transactions of a specified version, if a transaction does not contain
components that necessitate creation with a specific version. For example,
setting `-preferredtxversion=4` will cause the node to create V4 transactions
whenever the transaction does not contain Orchard components. This can be
helpful if recipients of transactions are likely to be using legacy wallets
that have not yet been upgraded to support parsing V5 transactions.
RPC interface
-------------
- The `getblocktemplate` RPC method now skips proof and signature checks on
templates it creates, as these templates only include transactions that have
previously been checked when being added to the mempool.
- The `getrawtransaction` and `decoderawtransaction` RPC methods now include
details about Orchard actions within transactions.
Wallet
------
- Rescan performance of post-NU5 blocks has been slightly improved (overall
rescan time for a single-account wallet decreases by around 6% on a Ryzen 9
5950X). Further improvements will be implemented in future releases to help
mitigate the effect of blocks full of shielded outputs.
- The `CWallet::UpdatedTransaction` signal is no longer called while holding the
`cs_main` lock. This fixes an issue where RPCs could block for long periods of
time on `zcashd` nodes with large wallets. Downstream code forks that have
reconnected the `NotifyTransactionChanged` wallet signal should take note of
this change, and not rely there on access to globals protected by `cs_main`.
- Some `zcashd 5.0.0` nodes would shut down some time after start with the error
`ThreadNotifyWallets: Failed to read block X while notifying wallets of block disconnects`.
`zcashd` now attempts to rectify the situation, and otherwise will inform the
user before shutting down that a reindex is required.
- Previously, every wallet transaction stored a Merkle branch to prove its
presence in blocks. This wasn't being used for more than an expensive sanity
check. Since 5.1.0, these are no longer stored. When loading a 5.1.0 wallet
into an older version, it will automatically rescan to avoid failed checks.
Deprecated
----------
As of this release, the following previously deprecated features are disabled
by default, but may be be reenabled using `-allowdeprecated=<feature>`.
- The `dumpwallet` RPC method is disabled. It may be reenabled with
`allowdeprecated=dumpwallet`. `dumpwallet` should not be used; it is
unsafe for backup purposes as it does not return any key information
for keys used to derive shielded addresses. Use `z_exportwallet` instead.
As of this release, the following features are deprecated, but remain available
by default. These features may be disabled by setting `-allowdeprecated=none`.
After at least 3 minor-version releases, these features will be disabled by
default and the following flags to `-allowdeprecated` will be required to
permit their continued use:
- `wallettxvjoinsplit` - controls availability of the deprecated `vjoinsplit`
attribute returned by the `gettransaction` RPC method.
Changelog
=========
Brian Stafford (2):
rpc: Add missing fields to getrawtransaction help text
rpc: add valueBalanceOrchard to getrawtransaction output
Chun Kuan Lee (1):
break circular dependency: random/sync -> util -> random/sync
Cory Fields (1):
threads: add a thread_local autoconf check
Daira Hopwood (4):
halo2 is now under MIT/Apache-2.0, so does not need a declaration in `contrib/debian/copyright`. fixes #5203
COPYING: Address feedback about the use of "permissive". Also refer to zcashd instead of "Zcash".
Upgrade to metrics 0.19.x and metrics-exporter-prometheus 0.10.x.
Apply cosmetic suggestions
Jack Grigg (46):
book: Add platform support information and tier policy
lint: Fix cargo patches linter when no patches are present
Shorten thread name prefix
Name currently-unnamed threads that we can rename
book: Capitalize key words in platform tier policy
book: Add FreeBSD to tier 3 platforms list
depends: Add cxx crate to dependencies
depends: Add cxxbridge command to dependencies
build: Pass `CC` etc. flags through to `cargo build`
build: Add non-verbose output for `cargo build`
depends: Add `rust/cxx.h` header as a dependency
Migrate Equihash Rust FFI to `cxx`
Migrate BLAKE2b Rust FFI to `cxx`
depends: Vendor dependencies of native_cxxbuild
Revert "Switched sync.{cpp,h} to std threading primitives."
qa: Fix sprout_sapling_migration RPC test to handle wallet RPC change
wallet: Clear witness caches on load if reindexing
Document that `-reindex` and `-salvagewallet` both imply `-rescan`
Update orchard license with current exception text
Note dependence on BOSL in COPYING
qa: `cargo vet init`
qa: Add `crypto-reviewed` and `license-reviewed` criteria for `cargo vet`
CI: Add workflow that runs `cargo vet --locked`
qa: Add audits for the crates directly maintained by the ECC core team
book: Add section about auditing Rust dependencies
qa: Fix `qa/zcash/create_benchmark_archive.py` script
qa: Generalise `extract_benchmark_data` in `performance-measurements.sh`
bench: Support multiple trees in FakeCoinsViewDB
bench: Add `ConnectBlock` benchmark using block 1708048
cargo vet fmt
Upgrade to `orchard 0.2.0`
Batch-validate Orchard proofs as well as Orchard signatures
test: Load the proof verification keys in Boost tests
bench: Add `ConnectBlock` benchmark using block 1723244
Use batch validation for Sapling proofs and signatures
qa: Reformat for latest cargo-vet
qa: Postpone dependency updates
Update release notes
qa: Add native_cxxbridge and rustcxx to update checker
Move "previous coinbase" UI monitoring into ThreadNotifyWallets
miner: Disable proof and signature checks in CreateNewBlock
wallet: Comment out slow assertion
Add missing release note entries for 5.1.0
qa: Postpone latest `cxx` update
make-release.py: Versioning changes for 5.1.0.
make-release.py: Updated manpages for 5.1.0.
Jesse Cohen (1):
Annotate AssertLockHeld() with ASSERT_CAPABILITY() for thread safety analysis
John Newbery (1):
[logging] Comment all continuing logs.
João Barbosa (1):
Remove unused fTry from push_lock
Kris Nuttycombe (28):
Fix incorrect links in 5.0.0 release notes.
Fix inconsistent caplitalization in copyright notices.
scripted-diff: Update Zcash copyrights to 2022
scripted-diff: Add 2016-2022 copyright headers for files added/modified in 2016
scripted-diff: Add 2017-2022 copyright headers for files added/modified in 2017
scripted-diff: Add 2018-2022 copyright headers for files added/modified in 2018
scripted-diff: Add 2019-2022 copyright headers for files added/modified in 2019
scripted-diff: Add 2020-2022 copyright headers for files added/modified in 2020
scripted-diff: Add 2021-2022 copyright headers for files added/modified in 2021
Ensure that anchor depth is > 0 when selecting an Orchard anchor.
Add configure~ to .gitignore
Return an error if attempting to use z_shieldcoinbase for Orchard shielding.
Only return active protocol components from z_gettreestate.
Revert "Only return active protocol components from z_gettreestate."
Only return `skipHash` for Orchard & Sapling roots at heights >= activation.
Add a CLI flag to preferentially send V4 tx.
Revert "Make `-reindex` and `-reindex-chainstate` imply `-rescan`"
Do not attempt to begin a rescan if reindexing.
Disable wallet commands that are unavailable in safe mode during -reindex
Guard map accesses.
Mark the `dumpwallet` RPC method as disabled.
Add a clock for testing with an offset from the system clock.
Apply suggestions from code review
Note that `gettransaction` doesn't provide shielded info in RPC help.
Deprecate the `vjoinsplit` field of `gettransaction` results.
Revert "Merge pull request #6037 from nuttycom/feature/clock_capability"
Replace "Disabled" Orchard AuthValidator with std::nullopt
Ensure that the node has position information before attempting to read block data.
Marco Falke (3):
qa: Initialize lockstack to prevent null pointer deref
sync: Add RecursiveMutex type alias
doc: Add comment to cs_main and mempool::cs
Matt Corallo (8):
Split CNode::cs_vSend: message processing and message sending
Make the cs_sendProcessing a LOCK instead of a TRY_LOCK
Lock cs_vSend and cs_inventory in a consistent order even in TRY
Always enforce lock strict lock ordering (try or not)
Fixup style a bit by moving { to the same line as if statements
Further-enforce lockordering by enforcing directly after TRY_LOCKs
Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost.
Fix fast-shutdown hang on ThreadImport+GenesisWait
Pieter Wuille (2):
Use a signal to continue init after genesis activation
Do diskspace check before import thread is started
Russell Yanofsky (5):
Add unit test for DEBUG_LOCKORDER code
MOVEONLY Move AnnotatedMixin declaration
Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection
Use LOCK macros for non-recursive locks
scripted-diff: Small locking rename
Sean Bowe (8):
Fix "transparent" example that should be "p2pkh"
Make shielded requirements error "debug" level rather than an error.
Introduce new Sapling verification API via cxx and switch consensus rules to use the new API.
Enable ZIP 216 for blocks prior to NU5 activation
Remove the old Sapling verification FFI APIs.
cargo fmt
Address clippy lints.
Update minimum chain work and set NU5 activation block hash for mainnet
Thomas Snider (1):
Switched sync.{cpp,h} to std threading primitives.
Marshall Gaucher (2):
add rpc parallel test group logic
Update walletbackup.py
practicalswift (3):
Remove unused code
Use -Wthread-safety-analysis if available (+ -Werror=thread-safety-analysis if --enable-werror)
Fix typos
sasha (3):
make-release.py: Versioning changes for 5.1.0-rc1.
make-release.py: Updated manpages for 5.1.0-rc1.
make-release.py: Updated release notes and changelog for 5.1.0-rc1.
Ying Tong Lai (3):
Add orchard_bundle FFI.
Use orchard_bundle ffi in getrawtransaction.
Test getrawtransaction in wallet_orchard.py

View File

@ -0,0 +1,200 @@
Notable changes
===============
Node Performance Improvements
-----------------------------
This release makes several changes to improve the performance of node operations.
These include:
- Backported CuckooCache from upstream to improve the performance of signature
caching.
- Added caching of proof and signature validation results for Sapling and
Orchard to eliminate redundant computation.
- Backported SHA-256 assembly optimizations from upstream.
Wallet Performance Improvements
-------------------------------
This release makes several changes to improve the performance of wallet operations.
These include:
- We now parallelize and batch trial decryption of Sapling outputs.
- We now prune witness data in the wallet for notes spent more than 100 blocks
in the past, so that we can avoid unnecessarily updating those witnesses.
In order to take advantage of this performance improvement, users will need
to start their nodes with `-rescan` the first time .
- The process for incrementing the witnesses for notes the wallet is tracking
has been optimized to avoid redundant passes over the wallet.
- Removed an assertion that was causing a slowdown in wallet scanning post-NU5.
RPC Interface Changes
=====================
- A `version` field was added to the result for the `gettransaction` RPC call to
avoid the need to make an extra call to `getrawtransaction` just to retrieve
the version.
Fixes
=====
- Fixed a regression that caused an incorrect process name to appear in the
process list.
Changelog
=========
Aditya Kulkarni (1):
Add tx version
Ben Woosley (1):
build: Detect gmtime_* definitions via configure
Chun Kuan Lee (1):
Use __cpuid_count for gnu C to avoid gitian build fail.
Cory Fields (2):
time: add runtime sanity check
build: always attempt to enable targeted sse42 cxxflags
Daira Hopwood (3):
This reverts part of 1f1810c37d00cb46d00d8553e6de3c6fdb991010 in #5959. Leaving the main thread unnamed causes it to be displayed as the executable name (i.e. `zcashd`) or command line in process monitoring tools. fixes #6066
Apply doc suggestions from code review
Use crossbeam-channel instead of std::sync::mpsc.
Dan Raviv (1):
Fix header guards using reserved identifiers
Gregory Maxwell (1):
Add an explanation of quickly hashing onto a non-power of two range.
Hennadii Stepanov (1):
Use correct C++11 header for std::swap()
Jack Grigg (16):
lint: Fix include guards
wallet: Prune witnesses for notes spent more than 100 blocks ago
wallet: Make `{Increment, Decrement}NoteWitnesses`-internal helpers static
Cache Sapling and Orchard bundle validation
Add bundle kind to `BundleValidityCache` initialization log message
wallet: Throw error if `ReadBlockFromDisk` fails
wallet: Improve documentation of `SproutNotData` and `SaplingNoteData`
Move explicit instantiations for `BundleValidityCache` into `zcash/cache.cpp`
bench: Fix ConnectBlock large block benchmarks
wallet: Add `BatchScanner` interface to `CValidationInterface`
wallet: Pass `Consensus::Params` into `CWallet::FindMySaplingNotes`
wallet: Migrate `CWallet` to `CValidationInterface::InitBatchScanner`
rust: Implement multithreaded batched trial decryption for Sapling
wallet: Use batch trial decryption for Sapling outputs
wallet: Enforce an assumption about how wallet data evolves
wallet: Domain-separate batched txids with a "block tag"
Jeremy Rubin (4):
Add CuckooCache implementation and replace the sigcache map_type with it
Add unit tests for the CuckooCache
Decrease testcase sizes in cuckoocache tests
Deduplicate SignatureCacheHasher
Jim Posen (1):
scripted-diff: Move util files to separate directory.
Jon Layton (1):
doc: Doxygen-friendly CuckooCache comments
Kris Nuttycombe (15):
scripted-diff: Move utiltest to src/util
Add a clock for testing with an offset from the system clock.
Apply suggestions from code review
Add persistent Sprout test data.
Remove the temporary test that was used for setup of the cached Sprout fixtures.
Add RPC test initialization using the persisted Sprout chains.
Update sprout_sapling_migration test to use persisted sprout chains.
Update feature_zip239 test to use persisted sprout chains.
Add missing <chrono> header to util/time.h
Update finalsaplingroot test to use persisted sprout chains.
Update getblocktemplate test to use persisted sprout chain
Replace setup_clean_chain with cache_behavior in rpc test init.
qa: Postpone recent native_rust, native_cxxbridge and rustcxx updates
make-release.py: Versioning changes for 5.2.0-rc1.
make-release.py: Updated manpages for 5.2.0-rc1.
Luke Dashjr (3):
configure: Invert --enable-asm help string since default is now enabled
configure: Skip assembly support checks, when assembly is disabled
configure: Initialise assembly enable_* variables
Marshall Gaucher (2):
Update entrypoint.sh
Update contrib/docker/entrypoint.sh
Pieter Wuille (34):
Allow non-power-of-2 signature cache sizes
Do not store Merkle branches in the wallet.
Avoid duplicate CheckBlock checks
Add merkle.{h,cpp}, generic merkle root/branch algorithm
Switch blocks to a constant-space Merkle root/branch algorithm.
Add FastRandomContext::rand256() and ::randbytes()
scripted-diff: Rename cuckoo tests' local rand context
Merge test_random.h into test_bitcoin.h
Add various insecure_rand wrappers for tests
scripted-diff: use insecure_rand256/randrange more
Replace more rand() % NUM by randranges
Replace rand() & ((1 << N) - 1) with randbits(N)
Use randbits instead of ad-hoc emulation in prevector tests
scripted-diff: Use randbits/bool instead of randrange where possible
scripted-diff: Use new naming style for insecure_rand* functions
Support multi-block SHA256 transforms
Add SHA256 dispatcher
Add SSE4 based SHA256
Add selftest for SHA256 transform
Protect SSE4 code behind a compile-time flag
Benchmark Merkle root computation
Refactor SHA256 code
Specialized double sha256 for 64 byte inputs
Use SHA256D64 in Merkle root computation
4-way SSE4.1 implementation for double SHA256 on 64-byte inputs
8-way AVX2 implementation for double SHA256 on 64-byte inputs
[MOVEONLY] Move unused Merkle branch code to tests
Enable double-SHA256-for-64-byte code on 32-bit x86
Improve coverage of SHA256 SelfTest code
For AVX2 code, also check for AVX, XSAVE, and OS support
[Refactor] CPU feature detection logic for SHA256
Add SHA256 implementation using using Intel SHA intrinsics
Use immintrin.h everywhere for intrinsics
Avoid non-trivial global constants in SHA-NI code
Wladimir J. van der Laan (2):
build: Rename --enable-experimental-asm to --enable-asm and enable by default
build: Mention use of asm in summary
furszy (3):
Fix missing vector include and vector type definition
Rework Sprout and Sapling witnesses increment and cache workflow, so it does not loop over the entire wallet txs map indiscriminately.
Use references instead of pointers where possible.
instagibbs (1):
Return useful error message on ATMP failure
nathannaveen (1):
chore: Set permissions for GitHub actions
practicalswift (1):
Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion
sasha (3):
Patch smoke_tests.py to properly handle changes in minconf behavior
Improve smoke_test.py wait_for_balance message in the minconf!=1 case
Patch smoke_tests.py to require 4 confirmations for z_mergetoaddress
Jack Grigg (2):
Improve bundlecache documentation
Minor fixes to documentation
Zancas Wilcox (1):
match the actual two hyphen flag

View File

@ -0,0 +1,211 @@
Notable changes
===============
Node Performance Improvements
-----------------------------
This release makes several changes to improve the performance of node operations.
These include:
- Backported CuckooCache from upstream to improve the performance of signature
caching.
- Added caching of proof and signature validation results for Sapling and
Orchard to eliminate redundant computation.
- Backported SHA-256 assembly optimizations from upstream.
Wallet Performance Improvements
-------------------------------
This release makes several changes to improve the performance of wallet operations.
These include:
- We now parallelize and batch trial decryption of Sapling outputs.
- We now prune witness data in the wallet for notes spent more than 100 blocks
in the past, so that we can avoid unnecessarily updating those witnesses.
In order to take advantage of this performance improvement, users will need
to start their nodes with `-rescan` one time, in order to ensure that witnesses
for spent notes are in the wallet are properly pruned.
- The process for incrementing the witnesses for notes the wallet is tracking
has been optimized to avoid redundant passes over the wallet.
- Removed an assertion that was causing a slowdown in wallet scanning post-NU5.
RPC Interface Changes
=====================
- A `version` field was added to the result for the `gettransaction` RPC call to
avoid the need to make an extra call to `getrawtransaction` just to retrieve
the version.
Fixes
=====
- Fixed a regression that caused an incorrect process name to appear in the
process list.
Changelog
=========
Aditya Kulkarni (1):
Add tx version
Ben Woosley (1):
build: Detect gmtime_* definitions via configure
Chun Kuan Lee (1):
Use __cpuid_count for gnu C to avoid gitian build fail.
Cory Fields (2):
time: add runtime sanity check
build: always attempt to enable targeted sse42 cxxflags
Daira Hopwood (5):
This reverts part of 1f1810c37d00cb46d00d8553e6de3c6fdb991010 in #5959. Leaving the main thread unnamed causes it to be displayed as the executable name (i.e. `zcashd`) or command line in process monitoring tools. fixes #6066
Apply doc suggestions from code review
Use crossbeam-channel instead of std::sync::mpsc.
Update cxx to 1.0.72.
Narrow the use of `#![allow(clippy::too_many_arguments)]` in src/rust/src/sapling.rs.
Dan Raviv (1):
Fix header guards using reserved identifiers
Gregory Maxwell (1):
Add an explanation of quickly hashing onto a non-power of two range.
Hennadii Stepanov (1):
Use correct C++11 header for std::swap()
Jack Grigg (16):
lint: Fix include guards
wallet: Prune witnesses for notes spent more than 100 blocks ago
wallet: Make `{Increment, Decrement}NoteWitnesses`-internal helpers static
Cache Sapling and Orchard bundle validation
Add bundle kind to `BundleValidityCache` initialization log message
wallet: Throw error if `ReadBlockFromDisk` fails
wallet: Improve documentation of `SproutNotData` and `SaplingNoteData`
Move explicit instantiations for `BundleValidityCache` into `zcash/cache.cpp`
bench: Fix ConnectBlock large block benchmarks
wallet: Add `BatchScanner` interface to `CValidationInterface`
wallet: Pass `Consensus::Params` into `CWallet::FindMySaplingNotes`
wallet: Migrate `CWallet` to `CValidationInterface::InitBatchScanner`
rust: Implement multithreaded batched trial decryption for Sapling
wallet: Use batch trial decryption for Sapling outputs
wallet: Enforce an assumption about how wallet data evolves
wallet: Domain-separate batched txids with a "block tag"
Jeremy Rubin (4):
Add CuckooCache implementation and replace the sigcache map_type with it
Add unit tests for the CuckooCache
Decrease testcase sizes in cuckoocache tests
Deduplicate SignatureCacheHasher
Jim Posen (1):
scripted-diff: Move util files to separate directory.
Jon Layton (1):
doc: Doxygen-friendly CuckooCache comments
Kris Nuttycombe (18):
scripted-diff: Move utiltest to src/util
Add a clock for testing with an offset from the system clock.
Apply suggestions from code review
Add persistent Sprout test data.
Remove the temporary test that was used for setup of the cached Sprout fixtures.
Add RPC test initialization using the persisted Sprout chains.
Update sprout_sapling_migration test to use persisted sprout chains.
Update feature_zip239 test to use persisted sprout chains.
Add missing <chrono> header to util/time.h
Update finalsaplingroot test to use persisted sprout chains.
Update getblocktemplate test to use persisted sprout chain
Replace setup_clean_chain with cache_behavior in rpc test init.
qa: Postpone recent native_rust, native_cxxbridge and rustcxx updates
Update release notes for v5.2.0.
make-release.py: Versioning changes for 5.2.0-rc1.
make-release.py: Updated manpages for 5.2.0-rc1.
make-release.py: Updated release notes and changelog for 5.2.0-rc1.
Fix incomplete release notes for witness pruning.
Luke Dashjr (3):
configure: Invert --enable-asm help string since default is now enabled
configure: Skip assembly support checks, when assembly is disabled
configure: Initialise assembly enable_* variables
Marshall Gaucher (2):
Update entrypoint.sh
Update contrib/docker/entrypoint.sh
Pieter Wuille (34):
Allow non-power-of-2 signature cache sizes
Do not store Merkle branches in the wallet.
Avoid duplicate CheckBlock checks
Add merkle.{h,cpp}, generic merkle root/branch algorithm
Switch blocks to a constant-space Merkle root/branch algorithm.
Add FastRandomContext::rand256() and ::randbytes()
scripted-diff: Rename cuckoo tests' local rand context
Merge test_random.h into test_bitcoin.h
Add various insecure_rand wrappers for tests
scripted-diff: use insecure_rand256/randrange more
Replace more rand() % NUM by randranges
Replace rand() & ((1 << N) - 1) with randbits(N)
Use randbits instead of ad-hoc emulation in prevector tests
scripted-diff: Use randbits/bool instead of randrange where possible
scripted-diff: Use new naming style for insecure_rand* functions
Support multi-block SHA256 transforms
Add SHA256 dispatcher
Add SSE4 based SHA256
Add selftest for SHA256 transform
Protect SSE4 code behind a compile-time flag
Benchmark Merkle root computation
Refactor SHA256 code
Specialized double sha256 for 64 byte inputs
Use SHA256D64 in Merkle root computation
4-way SSE4.1 implementation for double SHA256 on 64-byte inputs
8-way AVX2 implementation for double SHA256 on 64-byte inputs
[MOVEONLY] Move unused Merkle branch code to tests
Enable double-SHA256-for-64-byte code on 32-bit x86
Improve coverage of SHA256 SelfTest code
For AVX2 code, also check for AVX, XSAVE, and OS support
[Refactor] CPU feature detection logic for SHA256
Add SHA256 implementation using using Intel SHA intrinsics
Use immintrin.h everywhere for intrinsics
Avoid non-trivial global constants in SHA-NI code
Sean Bowe (2):
make-release.py: Versioning changes for 5.2.0.
make-release.py: Updated manpages for 5.2.0.
Wladimir J. van der Laan (2):
build: Rename --enable-experimental-asm to --enable-asm and enable by default
build: Mention use of asm in summary
furszy (3):
Fix missing vector include and vector type definition
Rework Sprout and Sapling witnesses increment and cache workflow, so it does not loop over the entire wallet txs map indiscriminately.
Use references instead of pointers where possible.
instagibbs (1):
Return useful error message on ATMP failure
nathannaveen (1):
chore: Set permissions for GitHub actions
practicalswift (1):
Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion
sasha (4):
Patch smoke_tests.py to properly handle changes in minconf behavior
Improve smoke_test.py wait_for_balance message in the minconf!=1 case
Patch smoke_tests.py to require 4 confirmations for z_mergetoaddress
Add cuckoocache.h to Makefile.am
Jack Grigg (2):
Improve bundlecache documentation
Minor fixes to documentation
Zancas Wilcox (1):
match the actual two hyphen flag

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2020-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
"""
@ -146,7 +147,7 @@ BASE_SCRIPTS= [
ZMQ_SCRIPTS = [
# ZMQ test can only be run if bitcoin was built with zmq-enabled.
# call rpc_tests.py with -nozmq to explicitly exclude these tests.
# call rpc_tests.py with --nozmq to explicitly exclude these tests.
"zmq_test.py"]
EXTENDED_SCRIPTS = [
@ -189,6 +190,8 @@ def main():
parser.add_argument('--force', '-f', action='store_true', help='run tests even on platforms where they are disabled by default (e.g. windows).')
parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit')
parser.add_argument('--jobs', '-j', type=int, default=4, help='how many test scripts to run in parallel. Default=4.')
parser.add_argument('--machines', '-m', type=int, default=-1, help='how many machines to shard the tests over. must also provide individual shard index. Default=-1 (no sharding).')
parser.add_argument('--rpcgroup', '-r', type=int, default=-1, help='individual shard index. must also provide how many machines to shard the tests over. Default=-1 (no sharding).')
parser.add_argument('--nozmq', action='store_true', help='do not run the zmq tests')
args, unknown_args = parser.parse_known_args()
@ -222,7 +225,7 @@ def main():
import zmq
zmq # Silences pyflakes
except ImportError:
print("ERROR: \"import zmq\" failed. Use -nozmq to run without the ZMQ tests."
print("ERROR: \"import zmq\" failed. Use --nozmq to run without the ZMQ tests."
"To run zmq tests, see dependency info in /qa/README.md.")
raise
@ -265,7 +268,25 @@ def main():
subprocess.check_call((config["environment"]["SRCDIR"] + '/qa/rpc-tests/' + test_list[0]).split() + ['-h'])
sys.exit(0)
run_tests(test_list, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args)
if (args.rpcgroup == -1) != (args.machines == -1):
print("ERROR: Please use both -m and -r options when using parallel rpc_groups.")
sys.exit(0)
if args.machines == 0:
print("ERROR: -m/--machines must be greater than 0")
sys.exit(0)
if args.machines > 0 and (args.rpcgroup >= args.machines):
print("ERROR: -r/--rpcgroup must be less than -m/--machines")
sys.exit(0)
if args.rpcgroup != -1 and args.machines != -1 and args.machines > args.rpcgroup:
# Ceiling division using floor division, by inverting the world.
# https://stackoverflow.com/a/17511341
k = -(len(test_list) // -args.machines)
split_list = list(test_list[i*k:(i+1)*k] for i in range(args.machines))
tests_to_run = split_list[args.rpcgroup]
else:
tests_to_run = test_list
run_tests(tests_to_run, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args)
def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=False, args=[]):
BOLD = ("","")

View File

@ -1,4 +1,5 @@
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Copyright (c) 2020-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .

View File

@ -46,7 +46,7 @@ class AddressIndexTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self):
# -insightexplorer causes addressindex to be enabled (fAddressIndex = true)

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2018-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -27,7 +28,6 @@ class BlockchainTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = False
self.num_nodes = 2
def setup_network(self, split=False):

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -22,7 +22,7 @@ class CoinbaseFundingStreamsTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def start_node_with(self, index, extra_args=[]):
args = [

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Copyright (c) 2020-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -15,7 +16,7 @@ class DecodeScriptTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 1
def setup_network(self, split=False):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -15,7 +16,7 @@ class DisableWalletTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 1
def setup_network(self, split=False):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2020-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
"""Test debug logging."""
@ -13,7 +14,7 @@ from test_framework.test_framework import BitcoinTestFramework
class LoggingTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def run_test(self):
# test default log file name

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2020-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
"""Test wallet file location."""
@ -13,7 +14,7 @@ from test_framework.test_framework import BitcoinTestFramework
class WalletFileTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def run_test(self):
# test default wallet location

View File

@ -30,7 +30,7 @@ class Zip221Test(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[

View File

@ -3,6 +3,7 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from decimal import Decimal
from test_framework.mininode import (
NU5_PROTO_VERSION,
CInv,
@ -20,6 +21,7 @@ from test_framework.util import (
HEARTWOOD_BRANCH_ID,
CANOPY_BRANCH_ID,
NU5_BRANCH_ID,
DEFAULT_FEE,
assert_equal,
assert_false,
assert_true,
@ -27,7 +29,7 @@ from test_framework.util import (
hex_str_to_bytes,
nuparams,
p2p_port,
start_node,
start_nodes,
wait_and_assert_operationid_status,
)
from tx_expiry_helper import TestNode
@ -37,21 +39,19 @@ import time
# Test ZIP 239 behaviour before and after NU5.
class Zip239Test(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.cache_behavior = 'sprout'
def setup_nodes(self):
extra_args=[
# Enable Canopy at height 205 to allow shielding Sprout funds first.
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
# Enable Canopy at height 205
nuparams(BLOSSOM_BRANCH_ID, 205),
nuparams(HEARTWOOD_BRANCH_ID, 205),
nuparams(CANOPY_BRANCH_ID, 205),
nuparams(NU5_BRANCH_ID, 210),
]
nodes = []
nodes.append(start_node(0, self.options.tmpdir, extra_args))
nodes.append(start_node(1, self.options.tmpdir, extra_args))
nodes.append(start_node(2, self.options.tmpdir, extra_args))
nodes.append(start_node(3, self.options.tmpdir, extra_args))
return nodes
"-preferredtxversion=5"
]] * self.num_nodes)
def cinv_for(self, txid, authDigest=None):
if authDigest is not None:
@ -186,16 +186,12 @@ class Zip239Test(BitcoinTestFramework):
print("Node's block index is not NU5-aware, skipping remaining tests")
return
# Load funds into the Sprout address
sproutzaddr = self.nodes[0].z_getnewaddress('sprout')
result = self.nodes[2].z_shieldcoinbase("*", sproutzaddr, 0)
wait_and_assert_operationid_status(self.nodes[2], result['opid'])
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
# Look up the Sprout address that contains existing funds
sproutzaddr = self.nodes[0].listaddresses()[0]['sprout']['addresses'][0]
assert_equal(self.nodes[0].z_getbalance(sproutzaddr), Decimal('50'))
# Activate NU5. Block height after this is 210.
self.nodes[0].generate(9)
self.nodes[0].generate(10)
self.sync_all()
# Add v4 transaction to the mempool.
@ -203,7 +199,7 @@ class Zip239Test(BitcoinTestFramework):
opid = self.nodes[0].z_sendmany(sproutzaddr, [{
'address': node1_taddr,
'amount': 1,
}])
}], 1, DEFAULT_FEE, 'AllowRevealedRecipients')
v4_txid = uint256_from_str(hex_str_to_bytes(
wait_and_assert_operationid_status(self.nodes[0], opid)
)[::-1])

View File

@ -29,11 +29,12 @@ class FinalSaplingRootTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = True
self.cache_behavior = 'sprout'
def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-txindex', # Avoid JSONRPC error: No information available about transaction
'-txindex', # Avoid JSONRPC error: No information available about transaction
'-reindex', # Required due to enabling -txindex
nuparams(NU5_BRANCH_ID, 210),
'-debug',
]] * self.num_nodes)
@ -42,9 +43,6 @@ class FinalSaplingRootTest(BitcoinTestFramework):
self.sync_all()
def run_test(self):
self.nodes[0].generate(200)
self.sync_all()
# Verify genesis block contains null field for what is now called the final sapling root field.
blk = self.nodes[0].getblock("0")
assert_equal(blk["finalsaplingroot"], NULL_FIELD)
@ -78,10 +76,10 @@ class FinalSaplingRootTest(BitcoinTestFramework):
assert_equal(treestate["height"], height)
assert_equal(treestate["hash"], self.nodes[0].getblockhash(height))
assert "skipHash" not in treestate["sprout"]
assert_equal(treestate["sprout"]["commitments"]["finalRoot"], SPROUT_TREE_EMPTY_ROOT)
assert_equal(treestate["sprout"]["commitments"]["finalState"], "000000")
if height < 100:
assert "skipHash" not in treestate["sprout"]
assert_equal(treestate["sprout"]["commitments"]["finalRoot"], SPROUT_TREE_EMPTY_ROOT)
assert_equal(treestate["sprout"]["commitments"]["finalState"], "000000")
assert "skipHash" not in treestate["sapling"]
assert_equal(treestate["sapling"]["commitments"]["finalRoot"], SAPLING_TREE_EMPTY_ROOT)
@ -94,7 +92,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
taddr0 = get_coinbase_address(self.nodes[0])
saplingAddr0 = self.nodes[0].z_getnewaddress('sapling')
recipients = []
recipients.append({"address": saplingAddr0, "amount": Decimal('20')})
recipients.append({"address": saplingAddr0, "amount": Decimal('10')})
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, 0)
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
@ -142,16 +140,18 @@ class FinalSaplingRootTest(BitcoinTestFramework):
assert_equal(root, self.nodes[0].getblock("203")["finalsaplingroot"])
# Mine a block with a Sprout shielded tx and verify the final Sapling root does not change
zaddr1 = self.nodes[1].z_getnewaddress('sprout')
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr1, 0, 1)
wait_and_assert_operationid_status(self.nodes[0], result['opid'])
zaddr0 = self.nodes[0].listaddresses()[0]['sprout']['addresses'][0]
assert_equal(self.nodes[0].z_getbalance(zaddr0), Decimal('50'))
recipients = [{"address": taddr0, "amount": Decimal('12.34')}]
opid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, 0, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("204")["tx"]), 2)
assert_equal(self.nodes[1].z_getbalance(zaddr1), Decimal("10"))
assert_equal(self.nodes[0].z_getbalance(zaddr0), Decimal("37.66"))
assert_equal(root, self.nodes[0].getblock("204")["finalsaplingroot"])
new_treestate = self.nodes[0].z_gettreestate(str(-1))
@ -160,13 +160,12 @@ class FinalSaplingRootTest(BitcoinTestFramework):
assert new_treestate["sprout"]["commitments"]["finalRoot"] != treestate["sprout"]["commitments"]["finalRoot"]
assert new_treestate["sprout"]["commitments"]["finalState"] != treestate["sprout"]["commitments"]["finalState"]
assert_equal(len(new_treestate["sprout"]["commitments"]["finalRoot"]), 64)
assert_equal(len(new_treestate["sprout"]["commitments"]["finalState"]), 134)
assert_equal(len(new_treestate["sprout"]["commitments"]["finalState"]), 204)
treestate = new_treestate
# Mine a block with a Sapling shielded recipient and verify the final Sapling root changes
saplingAddr1 = self.nodes[1].z_getnewaddress("sapling")
recipients = []
recipients.append({"address": saplingAddr1, "amount": Decimal('12.34')})
recipients = [{"address": saplingAddr1, "amount": Decimal('2.34')}]
myopid = self.nodes[0].z_sendmany(saplingAddr0, recipients, 1, 0)
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
@ -175,7 +174,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
self.sync_all()
assert_equal(len(self.nodes[0].getblock("205")["tx"]), 2)
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal("12.34"))
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal("2.34"))
assert root is not self.nodes[0].getblock("205")["finalsaplingroot"]
# Verify there is a Sapling output description (its commitment was added to tree)
@ -193,7 +192,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
# Mine a block with a Sapling shielded sender and transparent recipient and verify the final Sapling root doesn't change
taddr2 = self.nodes[0].getnewaddress()
recipients = []
recipients.append({"address": taddr2, "amount": Decimal('12.34')})
recipients.append({"address": taddr2, "amount": Decimal('2.34')})
myopid = self.nodes[1].z_sendmany(saplingAddr1, recipients, 1, 0)
mytxid = wait_and_assert_operationid_status(self.nodes[1], myopid)
@ -202,7 +201,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
self.sync_all()
assert_equal(len(self.nodes[0].getblock("206")["tx"]), 2)
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("12.34"))
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("2.34"))
blk = self.nodes[0].getblock("206")
root = blk["finalsaplingroot"]

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -17,7 +18,6 @@ class ForkNotifyTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = False
alert_filename = None # Set by setup_network

View File

@ -16,7 +16,7 @@ class FrameworkTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def start_node_with(self, index, extra_args=[]):
args = []

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -16,7 +17,7 @@ class RawTransactionsTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 4
def setup_network(self, split=False):

View File

@ -34,12 +34,12 @@ class GetBlockTemplateTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = True
self.cache_behavior = 'sprout'
def setup_network(self, split=False):
args = [
nuparams(CANOPY_BRANCH_ID, 115),
nuparams(NU5_BRANCH_ID, 130),
nuparams(CANOPY_BRANCH_ID, 215),
nuparams(NU5_BRANCH_ID, 230),
]
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [args] * self.num_nodes)
self.is_network_split = False
@ -128,22 +128,14 @@ class GetBlockTemplateTest(BitcoinTestFramework):
def run_test(self):
node = self.node
# Generate Sprout funds before Canopy activates; using the Sprout address will
# force the generation of v4 transactions from NU5.
print("Generating pre-Canopy blocks to create sprout funds")
# coinbase only becomes mature after 100 blocks, so make one mature.
node.generate(105)
self.sprout_addr = node.z_getnewaddress('sprout')
myopid = node.z_shieldcoinbase('*', self.sprout_addr)['opid']
wait_and_assert_operationid_status(node, myopid)
self.sprout_addr = node.listaddresses()[0]['sprout']['addresses'][0]
self.transparent_addr = node.getnewaddress()
account = node.z_getnewaccount()['account']
self.unified_addr = node.z_getaddressforaccount(account)['address']
node.generate(15)
node.generate(20)
# at height 120, NU5 is not active
# at height 220, NU5 is not active
assert_equal(node.getblockchaininfo()['upgrades'][nustr(NU5_BRANCH_ID)]['status'], 'pending')
print("Testing getblocktemplate for pre-NU5")

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -49,11 +50,6 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
Test longpolling with getblocktemplate.
'''
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = False
def run_test(self):
print("Warning: this test will take about 70 seconds in the best case. Be patient.")
self.nodes[0].generate(10)

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -98,7 +99,6 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = False
def setup_network(self):
self.nodes = self.setup_nodes()

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2018-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -12,10 +13,6 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
class GetChainTipsTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = False
def run_test (self):

View File

@ -15,7 +15,7 @@ class GetMiningInfoTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)

View File

@ -22,7 +22,7 @@ class GetrawtransactionTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self):
# -insightexplorer causes spentindex to be enabled (fSpentIndex = true)

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -17,7 +18,6 @@ class HTTPBasicsTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
self.setup_clean_chain = False
def setup_network(self):
self.nodes = self.setup_nodes()

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -16,7 +17,7 @@ import time
class InvalidateTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 3
def setup_network(self):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .

View File

@ -19,7 +19,7 @@ class KeyImportExportTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir )

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -86,7 +87,6 @@ class KeyPoolTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = False
self.num_nodes = 1
def setup_network(self):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -31,10 +32,6 @@ def check_array_result(object_array, to_match, expected):
raise AssertionError("No objects matched %s"%(str(to_match)))
class ListTransactionsTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = False
def run_test(self):
# Simple send, 0 to 1:

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -87,7 +88,7 @@ class MaxBlocksInFlightTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 1
def setup_network(self):

View File

@ -122,12 +122,18 @@ class MaxUploadTest(BitcoinTestFramework):
initialize_chain_clean(self.options.tmpdir, 2)
def setup_network(self):
# We will start the node mocking the time otherwise things break
# because the CNode time counters can't be reset backward after
# initialization
old_time = int(time.time() - 60*60*24*9)
# Start a node with maxuploadtarget of 200 MB (/24h)
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, [
"-debug",
'-nuparams=2bb40e60:1', # Blossom
"-maxuploadtarget=2200"]))
"-maxuploadtarget=2200",
"-mocktime=%d" % old_time ]))
def mine_full_block(self, node, address):
# Want to create a full block
@ -155,12 +161,6 @@ class MaxUploadTest(BitcoinTestFramework):
node.generate(1)
def run_test(self):
# Before we connect anything, we first set the time on the node
# to be in the past, otherwise things break because the CNode
# time counters can't be reset backward after initialization
old_time = int(time.time() - 60*60*24*9)
self.nodes[0].setmocktime(old_time)
# Generate some old blocks
self.nodes[0].generate(260)

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2019-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -39,7 +40,7 @@ class MempoolLimit(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 4
def run_test(self):

View File

@ -26,7 +26,7 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self):
args = ["-checkmempool", "-debug=mempool", "-blockmaxsize=4000",

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2019-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -18,7 +19,6 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = False
alert_filename = None # Set by setup_network

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -20,7 +21,6 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = False
def setup_network(self):
# Just need one node for this test

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -25,7 +26,6 @@ class MempoolSpendCoinbaseTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = False
def setup_network(self):
# Just need one node for this test

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -18,7 +19,7 @@ class MerkleBlockTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 4
def setup_network(self):

View File

@ -26,7 +26,7 @@ class ShieldCoinbaseTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def start_node_with(self, index, extra_args=[]):
args = [

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2019-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -18,7 +19,6 @@ class HTTPBasicsTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = False
self.num_nodes = 1
def setup_chain(self):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -16,11 +17,6 @@ import urllib.parse
class NodeHandlingTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = False
def run_test(self):
###########################
# setban/listbanned tests #

View File

@ -27,7 +27,7 @@ class NuparamsTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self, split=False):
args = [[

View File

@ -28,7 +28,7 @@ class OrchardReorgTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -119,7 +120,7 @@ class AcceptBlockTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 2
def setup_network(self):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2020-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .

View File

@ -17,7 +17,7 @@ class TxExpiringSoonTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)

View File

@ -17,7 +17,7 @@ class TxExpiryDoSTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -37,8 +38,6 @@ addnode connect to generic DNS name
class ProxyTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = False
self.have_ipv6 = test_ipv6_local()
# Create two proxies on different ports

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -26,7 +27,7 @@ class PruneTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 3
self.utxo = []

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -20,7 +21,7 @@ class RawTransactionsTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 3
def setup_network(self, split=False):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -53,11 +54,6 @@ def check_array_result(object_array, to_match, expected, should_not_find = False
class ReceivedByTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = False
def run_test(self):
'''
listreceivedbyaddress Test

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -16,7 +17,7 @@ class ReindexTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 1
def setup_network(self):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -52,7 +53,7 @@ class RESTTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 3
def setup_network(self, split=False):

View File

@ -18,7 +18,7 @@ class RewindBlockIndexTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_network(self, split=False):
# Node 0 - Overwinter, then Sprout, then Overwinter again

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -28,7 +29,7 @@ class RPCBindTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 1
def setup_network(self):

View File

@ -45,7 +45,7 @@ class SaplingRewindTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
self.setup_clean_chain = True
self.cache_behavior = 'clean'
# This mirrors how the network was setup in the bash test
def setup_network(self, split=False):

View File

@ -17,7 +17,7 @@ class ShorterBlockTimes(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = True
self.cache_behavior = 'clean'
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, [[

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -12,7 +13,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.cache_behavior = 'clean'
self.num_nodes = 1
def setup_network(self, split=False):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -145,7 +146,6 @@ class EstimateFeeTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
self.setup_clean_chain = False
def setup_network(self):
'''

View File

@ -5,8 +5,8 @@
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_true, get_coinbase_address, \
start_nodes, wait_and_assert_operationid_status, \
from test_framework.util import assert_equal, assert_true, \
start_nodes, \
wait_and_assert_operationid_status_result, DEFAULT_FEE
SAPLING_ADDR = 'zregtestsapling1ssqj3f3majnl270985gqcdqedd9t4nlttjqskccwevj2v20sc25deqspv3masufnwcdy67cydyy'
@ -52,7 +52,7 @@ class SproutSaplingMigration(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = True
self.cache_behavior = 'sprout'
def setup_nodes(self):
extra_args = [[
@ -67,17 +67,17 @@ class SproutSaplingMigration(BitcoinTestFramework):
assert_equal(0, len(extra_args[1]))
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args)
def run_migration_test(self, node, sproutAddr, saplingAddr, target_height):
def run_migration_test(self, node, sproutAddr, saplingAddr, target_height, sprout_initial_balance):
# Make sure we are in a good state to run the test
assert_equal(102, node.getblockcount() % 500, "Should be at block 102 % 500")
assert_equal(node.z_getbalance(sproutAddr), Decimal('10'))
assert_equal(200, node.getblockcount() % 500, "Should be at block 200 % 500")
assert_equal(node.z_getbalance(sproutAddr), sprout_initial_balance)
assert_equal(node.z_getbalance(saplingAddr), Decimal('0'))
check_migration_status(node, saplingAddr, DISABLED_BEFORE_MIGRATION)
# Migrate
node.z_setmigration(True)
print("Mining to block 494 % 500...")
node.generate(392) # 102 % 500 -> 494 % 500
node.generate(294) # 200 % 500 -> 494 % 500
self.sync_all()
# At 494 % 500 we should have no async operations
@ -90,7 +90,7 @@ class SproutSaplingMigration(BitcoinTestFramework):
# At 495 % 500 we should have an async operation
operationstatus = node.z_getoperationstatus()
print("migration operation: {}".format(operationstatus))
assert_equal(1, len(operationstatus), "num async operations at 495 % 500")
assert_equal(1, len(operationstatus), "num async operations at 495 % 500")
assert_equal('saplingmigration', operationstatus[0]['method'])
assert_equal(target_height, operationstatus[0]['target_height'])
@ -109,7 +109,7 @@ class SproutSaplingMigration(BitcoinTestFramework):
# At 498 % 500 the mempool will be empty and no funds will have moved
assert_equal(0, len(node.getrawmempool()), "mempool size at 498 % 500")
assert_equal(node.z_getbalance(sproutAddr), Decimal('10'))
assert_equal(node.z_getbalance(sproutAddr), sprout_initial_balance)
assert_equal(node.z_getbalance(saplingAddr), Decimal('0'))
node.generate(1)
@ -125,7 +125,7 @@ class SproutSaplingMigration(BitcoinTestFramework):
# Check that unmigrated amount + unfinalized = starting balance - fee
status = node.z_getmigrationstatus()
print("status: {}".format(status))
assert_equal(Decimal('10.0') - DEFAULT_FEE, Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount']))
assert_equal(sprout_initial_balance - DEFAULT_FEE, Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount']))
# The transaction in the mempool should be the one listed in migration_txids,
# and it should expire at the next 450 % 500.
@ -142,9 +142,9 @@ class SproutSaplingMigration(BitcoinTestFramework):
sprout_balance = node.z_getbalance(sproutAddr)
sapling_balance = node.z_getbalance(saplingAddr)
print("sprout balance: {}, sapling balance: {}".format(sprout_balance, sapling_balance))
assert_true(sprout_balance < Decimal('10'), "Should have less Sprout funds")
assert_true(sprout_balance < sprout_initial_balance, "Should have less Sprout funds")
assert_true(sapling_balance > Decimal('0'), "Should have more Sapling funds")
assert_true(sprout_balance + sapling_balance, Decimal('10.0') - DEFAULT_FEE)
assert_true(sprout_balance + sapling_balance, sprout_initial_balance - DEFAULT_FEE)
check_migration_status(node, saplingAddr, DURING_MIGRATION)
# At 10 % 500 the transactions will be considered 'finalized'
@ -156,47 +156,34 @@ class SproutSaplingMigration(BitcoinTestFramework):
assert_equal(sprout_balance, Decimal(status['unmigrated_amount']))
assert_equal(sapling_balance, Decimal(status['finalized_migrated_amount']))
def send_to_sprout_zaddr(self, tAddr, sproutAddr):
# Send some ZEC to a Sprout address
result = self.nodes[0].z_shieldcoinbase(tAddr, sproutAddr, 0, 1)
wait_and_assert_operationid_status(self.nodes[0], result['opid'])
self.nodes[0].generate(1)
self.sync_all()
def run_test(self):
# Check enabling via '-migration' and disabling via rpc
check_migration_status(self.nodes[0], SAPLING_ADDR, ENABLED_NO_FUNDS)
check_migration_status(self.nodes[0], SAPLING_ADDR, ENABLED_BEFORE_MIGRATION)
self.nodes[0].z_setmigration(False)
check_migration_status(self.nodes[0], SAPLING_ADDR, DISABLED_NO_FUNDS)
check_migration_status(self.nodes[0], SAPLING_ADDR, DISABLED_BEFORE_MIGRATION)
print("Running test using '-migrationdestaddress'...")
# 1. Test using self.nodes[0] which has the parameter
print("Running test using '-migrationdestaddress'...")
print("Mining blocks...")
self.nodes[0].generate(101)
self.sync_all()
tAddr = get_coinbase_address(self.nodes[0])
# Import a previously generated key to test '-migrationdestaddress'
self.nodes[0].z_importkey(SAPLING_KEY)
sproutAddr0 = self.nodes[0].z_getnewaddress('sprout')
sproutAddr0 = self.nodes[0].listaddresses()[0]['sprout']['addresses'][0]
self.send_to_sprout_zaddr(tAddr, sproutAddr0)
self.run_migration_test(self.nodes[0], sproutAddr0, SAPLING_ADDR, 500)
self.run_migration_test(self.nodes[0], sproutAddr0, SAPLING_ADDR, 500, Decimal('50'))
# Disable migration so only self.nodes[1] has a transaction in the mempool at block 999
self.nodes[0].z_setmigration(False)
# 2. Test using self.nodes[1] which will use the default Sapling address
print("Running test using default Sapling address...")
# Mine more blocks so we start at 102 % 500
# Mine more blocks so we start at 200 % 500
print("Mining blocks...")
self.nodes[1].generate(91) # 511 -> 602
self.nodes[1].generate(190) # 510 -> 700
self.sync_all()
sproutAddr1 = self.nodes[1].z_getnewaddress('sprout')
sproutAddr1 = self.nodes[1].listaddresses()[0]['sprout']['addresses'][0]
saplingAddr1 = self.nodes[1].z_getnewaddress('sapling')
self.send_to_sprout_zaddr(tAddr, sproutAddr1)
self.run_migration_test(self.nodes[1], sproutAddr1, saplingAddr1, 1000)
self.run_migration_test(self.nodes[1], sproutAddr1, saplingAddr1, 1000, Decimal('50'))
if __name__ == '__main__':

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
# blocktools.py - utilities for manipulating blocks and transactions
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .

Some files were not shown because too many files have changed in this diff Show More