v0.1.13 release (#91)

* rm depend/zcash

* Squashed 'depend/zcash/' content from commit 00c2a2434

git-subtree-dir: depend/zcash
git-subtree-split: 00c2a2434e655d275c26986c8751793f4c98bb01

* rm depends/zcash/Cargo.toml

* updates Cargo.toml

* Updates Changelog

* add tl_expected.hpp

* Fix build

* add test-dependencies features to ecc deps

* add missing .c files from secp256k1

* chore: Release zcash_script version 0.1.13

---------

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
This commit is contained in:
Arya 2023-07-07 14:06:27 -04:00 committed by GitHub
parent 62c83941ed
commit b900ff4261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
326 changed files with 42682 additions and 8373 deletions

View File

@ -8,7 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] - ReleaseDate
## [0.1.12] - 2023-05-07
## [0.1.13] - 2023-07-05
## [0.1.13] - 2023-06-29
### Changed
- Update `depend/zcash` to version 5.6.1 which includes updated dependencies
- Update other dependencies to match Zebra
## [0.1.12] - 2023-05-03
@ -83,7 +89,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated `bindgen` to a non yanked version
<!-- next-url -->
[Unreleased]: https://github.com/ZcashFoundation/zcash_script/compare/v0.1.12...HEAD
[Unreleased]: https://github.com/ZcashFoundation/zcash_script/compare/v0.1.13...HEAD
[0.1.13]: https://github.com/ZcashFoundation/zcash_script/compare/v0.1.12...v0.1.13
[0.1.12]: https://github.com/ZcashFoundation/zcash_script/compare/v0.1.11...v0.1.12
[0.1.11]: https://github.com/ZcashFoundation/zcash_script/compare/v0.1.10...v0.1.11
[0.1.10]: https://github.com/ZcashFoundation/zcash_script/compare/v0.1.9...v0.1.10

View File

@ -1,6 +1,6 @@
[package]
name = "zcash_script"
version = "0.1.12"
version = "0.1.13"
authors = ["Tamas Blummer <tamas.blummer@gmail.com>", "Zcash Foundation <zebra@zfnd.org>"]
license = "Apache-2.0"
readme = "README.md"
@ -38,6 +38,7 @@ include = [
"/depend/zcash/src/support/cleanse.cpp",
"/depend/zcash/src/support/cleanse.h",
"/depend/zcash/src/rust/gen/",
"/depend/expected/include/",
]
[lib]
@ -55,23 +56,25 @@ blake2b_simd = "1"
bls12_381 = "0.8"
byteorder = "1"
crossbeam-channel = "0.5"
cxx = { version = "=1.0.94", features = ["c++17"] }
cxx = { version = "=1.0.95", features = ["c++17"] }
group = "0.13"
incrementalmerkletree = "0.3"
incrementalmerkletree = "0.4"
jubjub = "0.10"
libc = "0.2"
memuse = "0.2"
metrics = "0.20"
orchard = "0.4"
metrics = "0.21"
orchard = "0.5"
rand_core = "0.6"
rayon = "1.5"
subtle = "2.2"
tracing = "0.1"
zcash_address = "0.2"
zcash_address = "0.3"
zcash_encoding = "0.2"
zcash_note_encryption = "0.3"
zcash_primitives = { version = "0.11", features = ["temporary-zcashd", "transparent-inputs"] }
zcash_proofs = "0.11"
zcash_note_encryption = "0.4"
zcash_primitives = { version = "0.12", features = ["temporary-zcashd", "transparent-inputs"] }
zcash_proofs = "0.12"
bridgetree = "0.3"
rand = "0.8"
[build-dependencies]
# The `bindgen` dependency should automatically upgrade to match the version used by zebra-state's `rocksdb` dependency in:
@ -95,6 +98,8 @@ syn = { version = "1.0.109", features = ["full", "printing"] }
# Treat minor versions with a zero major version as compatible (cargo doesn't by default).
hex = ">= 0.4.3"
lazy_static = "1.4.0"
incrementalmerkletree = { version = "0.4", features = ["test-dependencies"] }
zcash_primitives = { version = "0.12", features = ["temporary-zcashd", "transparent-inputs", "test-dependencies"] }
[[package.metadata.release.pre-release-replacements]]
file = "CHANGELOG.md"

View File

@ -22,7 +22,6 @@ to include a lot of other stuff e.g. the orchard library.
### Updating this crate
1. Create a new branch batch so all the release commits can be made into a PR
2. Update `depend/zcash` with the latest tagged version of `zcashd`, using the instructions below
3. Update `Cargo.toml` versions to match the versions used by the latest tagged version of `zcashd`, and its dependencies
@ -30,9 +29,11 @@ to include a lot of other stuff e.g. the orchard library.
- use `cargo tree --invert <crate>` to see if the crate is from `zcash_script` or another dependency
- see the list in [Cargo.toml](https://github.com/ZcashFoundation/zcash_script/blob/master/Cargo.toml#L69)
5. For new dependencies with a leading zero in their version (`0.x.y`), use a `>=` dependency [to make them automatically upgrade to match Zebra's dependencies](https://doc.rust-lang.org/cargo/reference/resolver.html#semver-compatibility)
6. Check all open PRs to see if they can be merged before the release
7. Do the release, following the instructions below
8. Check the release tag was pushed to https://github.com/ZcashFoundation/zcash_script/tags
6. Test if everything works by running `cargo test`. If you get any compiling errors, see
the troubleshooting section below.
7. Check all open PRs to see if they can be merged before the release
8. Do the release, following the instructions below
9. Check the release tag was pushed to https://github.com/ZcashFoundation/zcash_script/tags
### Updating `depend/zcash`
@ -85,3 +86,23 @@ Releases for `zcash-script` are made with the help of [cargo release](https://gi
4. Publish a new release using `cargo release --execute <level>`
**NOTE**: It's important to specify the level when using cargo release because of the way it implements the substitutions. We specify a number of automatic substitutions in `Cargo.toml` but they will only be applied if `cargo release` also handles incrementing the version itself, **do not increment the version by hand and then run `cargo release` or `cargo release -- release`, or it will not correctly update all version references in the codebase.**
### Troubleshooting
#### "undefined reference to `name`"
This likely means that a `.c` file is not being included in `build.rs`.
Search for `name` in the zcashd source tree to find which file contains it,
and add it to a `file()` call inside `build.rs`.
#### "fatal error: `file`: No such file or directory"
This likely means that a `.h` file is not being found.
Seach for a file with the given name and add its folder to a `.include()`
call in `build.rs`. If the file does not exist there it's likely from
a 3rd-party dependency that is downloaded at build time. Search for
the file name on some search engine to attempt to find what project
it belongs to, cross-referencing the `depends/packages` folder
in `zcashd`. Then you may need to copy those files to a folder
inside `zcash_script` like we did in `depend/expected`.

View File

@ -133,6 +133,7 @@ fn main() -> Result<()> {
.include("depend/zcash/src/")
.include("depend/zcash/src/rust/include/")
.include("depend/zcash/src/secp256k1/include/")
.include("depend/expected/include/")
.include(&gen_path.join("include"))
.flag_if_supported("-Wno-implicit-fallthrough")
.flag_if_supported("-Wno-catch-value")
@ -226,6 +227,8 @@ fn build_secp256k1() {
build
.file("depend/zcash/src/secp256k1/src/secp256k1.c")
.file("depend/zcash/src/secp256k1/src/precomputed_ecmult.c")
.file("depend/zcash/src/secp256k1/src/precomputed_ecmult_gen.c")
.compile("libsecp256k1.a");
}

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,11 @@ jobs:
platform: Ubuntu 20.04
os: ubuntu-20.04
- name: ubuntu-22.04
tier: 3
platform: Ubuntu 22.04
os: ubuntu-22.04
- name: macos-11
tier: 3
platform: macOS Big Sur 11

View File

@ -1,45 +0,0 @@
name: Checks
on: pull_request_target
permissions:
contents: read
issues: write
pull-requests: write
jobs:
recent-base:
name: Branch base is sufficiently recent
runs-on: ubuntu-latest
steps:
- name: Check out the base branch
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check out the PR branch
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Ensure branch contains necessary commits for Tekton CI
id: tekton
# https://github.com/zcash/zcash/pull/6358
run: git merge-base --is-ancestor 267ddf8efe36cc799c4c31772a8883ea332ef55b ${{ github.head_ref }}
- name: Tell PR author if they need to rebase
if: failure() && steps.tekton.outcome == 'failure'
run: echo "::error::Branch needs to be rebased so that Tekton CI can run"
- name: Avoid running Tekton CI if it would provably fail
if: failure() && steps.tekton.outcome == 'failure'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: "safe-to-build",
})

View File

@ -44,7 +44,6 @@ confdefs.h
conftest.cpp
conftest.err
cache/
venv-mnf/
src/univalue/gen

397
depend/zcash/Cargo.lock generated
View File

@ -49,6 +49,17 @@ dependencies = [
"version_check",
]
[[package]]
name = "ahash"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
dependencies = [
"cfg-if",
"once_cell",
"version_check",
]
[[package]]
name = "aho-corasick"
version = "0.7.20"
@ -97,6 +108,12 @@ dependencies = [
"rustc-demangle",
]
[[package]]
name = "base64"
version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d"
[[package]]
name = "base64ct"
version = "1.0.1"
@ -144,6 +161,21 @@ dependencies = [
"zeroize",
]
[[package]]
name = "bit-set"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
dependencies = [
"bit-vec",
]
[[package]]
name = "bit-vec"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
[[package]]
name = "bitflags"
version = "1.3.2"
@ -216,12 +248,22 @@ dependencies = [
]
[[package]]
name = "bs58"
version = "0.4.0"
name = "bridgetree"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
checksum = "3a813dadc684e4c78a4547757debd99666282545d90e4ccc3210913ed4337ad2"
dependencies = [
"sha2 0.9.9",
"incrementalmerkletree",
]
[[package]]
name = "bs58"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896"
dependencies = [
"sha2 0.10.6",
"tinyvec",
]
[[package]]
@ -406,9 +448,9 @@ dependencies = [
[[package]]
name = "cxx"
version = "1.0.94"
version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93"
checksum = "109308c20e8445959c2792e81871054c6a17e6976489a93d2769641a2ba5839c"
dependencies = [
"cc",
"cxxbridge-flags",
@ -418,15 +460,15 @@ dependencies = [
[[package]]
name = "cxxbridge-flags"
version = "1.0.94"
version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb"
checksum = "882074421238e84fe3b4c65d0081de34e5b323bf64555d3e61991f76eb64a7bb"
[[package]]
name = "cxxbridge-macro"
version = "1.0.94"
version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5"
checksum = "4a076022ece33e7686fb76513518e219cca4fce5750a8ae6d1ce6c0f48fd1af9"
dependencies = [
"proc-macro2",
"quote",
@ -500,7 +542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6"
dependencies = [
"curve25519-dalek",
"hashbrown",
"hashbrown 0.12.3",
"hex",
"rand_core 0.6.4",
"serde",
@ -524,6 +566,27 @@ dependencies = [
"byteorder",
]
[[package]]
name = "errno"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0"
dependencies = [
"errno-dragonfly",
"libc",
"windows-sys",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "f4jumble"
version = "0.1.0"
@ -533,6 +596,15 @@ dependencies = [
"blake2b_simd",
]
[[package]]
name = "fastrand"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [
"instant",
]
[[package]]
name = "ff"
version = "0.13.0"
@ -633,7 +705,7 @@ checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4"
dependencies = [
"cfg-if",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
"wasi",
]
[[package]]
@ -720,19 +792,29 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [
"ahash",
"ahash 0.7.6",
]
[[package]]
name = "hashbrown"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
dependencies = [
"ahash 0.8.3",
]
[[package]]
name = "hdwallet"
version = "0.3.1"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cd89bf343be18dbe1e505100e48168bbd084760e842a8fed0317d2361470193"
checksum = "5a03ba7d4c9ea41552cd4351965ff96883e629693ae85005c501bb4b9e1c48a7"
dependencies = [
"lazy_static",
"rand_core 0.6.4",
"ring",
"secp256k1",
"thiserror",
]
[[package]]
@ -744,6 +826,12 @@ dependencies = [
"libc",
]
[[package]]
name = "hermit-abi"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
[[package]]
name = "hex"
version = "0.4.3"
@ -838,11 +926,12 @@ dependencies = [
[[package]]
name = "incrementalmerkletree"
version = "0.3.1"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5ad43a3f5795945459d577f6589cf62a476e92c79b75e70cd954364e14ce17b"
checksum = "2eb91780c91bfc79769006a55c49127b83e1c1a6cf2b3b149ce3f247cbe342f0"
dependencies = [
"serde",
"either",
"proptest",
]
[[package]]
@ -852,7 +941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
"hashbrown 0.12.3",
]
[[package]]
@ -864,6 +953,26 @@ dependencies = [
"generic-array",
]
[[package]]
name = "instant"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
"cfg-if",
]
[[package]]
name = "io-lifetimes"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb"
dependencies = [
"hermit-abi 0.3.1",
"libc",
"windows-sys",
]
[[package]]
name = "ipnet"
version = "2.7.2"
@ -931,6 +1040,7 @@ dependencies = [
"blake2b_simd",
"blake2s_simd",
"bls12_381",
"bridgetree",
"byteorder",
"clearscreen",
"crossbeam-channel",
@ -951,6 +1061,7 @@ dependencies = [
"metrics-util",
"nonempty",
"orchard",
"proptest",
"rand",
"rand_core 0.6.4",
"rayon",
@ -987,14 +1098,10 @@ dependencies = [
]
[[package]]
name = "lock_api"
version = "0.4.9"
name = "linux-raw-sys"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
dependencies = [
"autocfg",
"scopeguard",
]
checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
[[package]]
name = "log"
@ -1006,10 +1113,10 @@ dependencies = [
]
[[package]]
name = "mach"
version = "0.3.2"
name = "mach2"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa"
checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8"
dependencies = [
"libc",
]
@ -1059,28 +1166,27 @@ dependencies = [
[[package]]
name = "metrics"
version = "0.20.1"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b9b8653cec6897f73b519a43fba5ee3d50f62fe9af80b428accdcc093b4a849"
checksum = "aa8ebbd1a9e57bbab77b9facae7f5136aea44c356943bf9a198f647da64285d6"
dependencies = [
"ahash",
"ahash 0.8.3",
"metrics-macros",
"portable-atomic",
]
[[package]]
name = "metrics-exporter-prometheus"
version = "0.11.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8603921e1f54ef386189335f288441af761e0fc61bcb552168d9cedfe63ebc70"
checksum = "8a4964177ddfdab1e3a2b37aec7cf320e14169abb0ed73999f558136409178d5"
dependencies = [
"base64",
"hyper",
"indexmap",
"ipnet",
"metrics",
"metrics-util",
"parking_lot",
"portable-atomic",
"quanta",
"thiserror",
"tokio",
@ -1089,29 +1195,27 @@ dependencies = [
[[package]]
name = "metrics-macros"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "731f8ecebd9f3a4aa847dfe75455e4757a45da40a7793d2f0b1f9b6ed18b23f3"
checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.15",
]
[[package]]
name = "metrics-util"
version = "0.14.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7d24dc2dbae22bff6f1f9326ffce828c9f07ef9cc1e8002e5279f845432a30a"
checksum = "111cb375987443c3de8d503580b536f77dc8416d32db62d9456db5d93bd7ac47"
dependencies = [
"aho-corasick",
"crossbeam-epoch",
"crossbeam-utils",
"hashbrown",
"hashbrown 0.13.2",
"metrics",
"num_cpus",
"parking_lot",
"portable-atomic",
"quanta",
"sketches-ddsketch",
]
@ -1139,7 +1243,7 @@ checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
dependencies = [
"libc",
"log",
"wasi 0.11.0+wasi-snapshot-preview1",
"wasi",
"windows-sys",
]
@ -1209,6 +1313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
dependencies = [
"autocfg",
"libm",
]
[[package]]
@ -1217,7 +1322,7 @@ version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
dependencies = [
"hermit-abi",
"hermit-abi 0.2.6",
"libc",
]
@ -1244,9 +1349,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "orchard"
version = "0.4.0"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c6f418f2c25573923f81a091f38b4b19bc20f6c92b5070fb8f0711e64a2b998"
checksum = "5f4e7a52f510cb8c39e639e662a353adbaf86025478af89ae54a0551f8ca35e2"
dependencies = [
"aes",
"bitvec",
@ -1262,6 +1367,7 @@ dependencies = [
"memuse",
"nonempty",
"pasta_curves",
"proptest",
"rand",
"reddsa",
"serde",
@ -1287,9 +1393,9 @@ dependencies = [
[[package]]
name = "parity-scale-codec"
version = "3.4.0"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac"
checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28"
dependencies = [
"arrayvec",
"bitvec",
@ -1311,29 +1417,6 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "parking_lot"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.9.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-sys",
]
[[package]]
name = "password-hash"
version = "0.3.2"
@ -1433,9 +1516,9 @@ dependencies = [
[[package]]
name = "portable-atomic"
version = "0.3.19"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b"
checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794"
[[package]]
name = "ppv-lite86"
@ -1466,29 +1549,55 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.56"
version = "1.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quanta"
version = "0.10.1"
name = "proptest"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e31331286705f455e56cca62e0e717158474ff02b7936c1fa596d983f4ae27"
checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65"
dependencies = [
"bit-set",
"bitflags",
"byteorder",
"lazy_static",
"num-traits",
"rand",
"rand_chacha",
"rand_xorshift",
"regex-syntax",
"rusty-fork",
"tempfile",
"unarray",
]
[[package]]
name = "quanta"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab"
dependencies = [
"crossbeam-utils",
"libc",
"mach",
"mach2",
"once_cell",
"raw-cpuid",
"wasi 0.10.2+wasi-snapshot-preview1",
"wasi",
"web-sys",
"winapi",
]
[[package]]
name = "quick-error"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]]
name = "quote"
version = "1.0.26"
@ -1540,6 +1649,15 @@ dependencies = [
"getrandom",
]
[[package]]
name = "rand_xorshift"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f"
dependencies = [
"rand_core 0.6.4",
]
[[package]]
name = "raw-cpuid"
version = "10.7.0"
@ -1611,6 +1729,15 @@ dependencies = [
"bitflags",
]
[[package]]
name = "redox_syscall"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
dependencies = [
"bitflags",
]
[[package]]
name = "redox_users"
version = "0.4.3"
@ -1618,7 +1745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [
"getrandom",
"redox_syscall",
"redox_syscall 0.2.16",
"thiserror",
]
@ -1682,6 +1809,32 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6"
[[package]]
name = "rustix"
version = "0.37.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
"windows-sys",
]
[[package]]
name = "rusty-fork"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f"
dependencies = [
"fnv",
"quick-error",
"tempfile",
"wait-timeout",
]
[[package]]
name = "ryu"
version = "1.0.13"
@ -1696,18 +1849,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "secp256k1"
version = "0.21.3"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260"
checksum = "4124a35fe33ae14259c490fd70fa199a32b9ce9502f2ee6bc4f81ec06fa65894"
dependencies = [
"secp256k1-sys",
]
[[package]]
name = "secp256k1-sys"
version = "0.4.2"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036"
checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e"
dependencies = [
"cc",
]
@ -1797,12 +1950,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68a406c1882ed7f29cd5e248c9848a80e7cb6ae0fea82346d2746f2f941c07e1"
[[package]]
name = "smallvec"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]]
name = "socket2"
version = "0.4.9"
@ -1859,6 +2006,19 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tempfile"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998"
dependencies = [
"cfg-if",
"fastrand",
"redox_syscall 0.3.5",
"rustix",
"windows-sys",
]
[[package]]
name = "terminfo"
version = "0.8.0"
@ -1960,15 +2120,15 @@ dependencies = [
[[package]]
name = "toml_datetime"
version = "0.6.1"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622"
checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f"
[[package]]
name = "toml_edit"
version = "0.19.8"
version = "0.19.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13"
checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739"
dependencies = [
"indexmap",
"toml_datetime",
@ -2066,6 +2226,12 @@ dependencies = [
"static_assertions",
]
[[package]]
name = "unarray"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"
[[package]]
name = "unicode-ident"
version = "1.0.8"
@ -2109,6 +2275,15 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "wait-timeout"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
dependencies = [
"libc",
]
[[package]]
name = "want"
version = "0.3.0"
@ -2119,12 +2294,6 @@ dependencies = [
"try-lock",
]
[[package]]
name = "wasi"
version = "0.10.2+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@ -2296,9 +2465,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "winnow"
version = "0.4.1"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28"
checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699"
dependencies = [
"memchr",
]
@ -2314,9 +2483,9 @@ dependencies = [
[[package]]
name = "zcash_address"
version = "0.2.1"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52be35a205369d480378646bff9c9fedafd8efe8af1e0e54bb858f405883f2b2"
checksum = "8944af5c206cf2e37020ad54618e1825501b98548d35a638b73e0ec5762df8d5"
dependencies = [
"bech32",
"bs58",
@ -2347,9 +2516,9 @@ dependencies = [
[[package]]
name = "zcash_note_encryption"
version = "0.3.0"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb2149e6cd5fbee36c5b87c601715a8c35554602f7fe84af38b636afa2db318"
checksum = "5b4580cd6cee12e44421dac43169be8d23791650816bdb34e6ddfa70ac89c1c5"
dependencies = [
"chacha20",
"chacha20poly1305",
@ -2360,9 +2529,9 @@ dependencies = [
[[package]]
name = "zcash_primitives"
version = "0.11.0"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "914d2195a478d5b63191584dff126f552751115181857b290211ec88e68acc3e"
checksum = "de1a231e6a58d3dcdd6e21d229db33d7c10f9b54d8c170e122b267f6826bb48f"
dependencies = [
"aes",
"bip0039",
@ -2383,6 +2552,7 @@ dependencies = [
"memuse",
"nonempty",
"orchard",
"proptest",
"rand",
"rand_core 0.6.4",
"ripemd",
@ -2396,15 +2566,16 @@ dependencies = [
[[package]]
name = "zcash_proofs"
version = "0.11.0"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5c8147884952748b00aa443d36511ae2d7b49acfec74cfd39c0959fbb61ef14"
checksum = "b209661425fa780ff4fd1b5d8ef2148f569536b5071051143eede32e291e1a65"
dependencies = [
"bellman",
"blake2b_simd",
"bls12_381",
"directories",
"group",
"incrementalmerkletree",
"jubjub",
"lazy_static",
"rand_core 0.6.4",

View File

@ -1,4 +1,4 @@
Zcash 5.5.0
Zcash 5.6.1
<img align="right" width="120" height="80" src="doc/imgs/logo.png">
===========
@ -60,6 +60,7 @@ for instructions on joining the main Zcash network.
for help and more information.
* :incoming_envelope: Ask for help on the [Zcash](https://forum.z.cash/) forum.
* :speech_balloon: Join our community on [Discord](https://discordapp.com/invite/PhJY6Pm)
* 🧑‍🎓: Learn at [ZecHub](https://wiki.zechub.xyz/)
Participation in the Zcash project is subject to a
[Code of Conduct](code_of_conduct.md).

View File

@ -1,8 +1,8 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 5)
define(_CLIENT_VERSION_MINOR, 5)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_MINOR, 6)
define(_CLIENT_VERSION_REVISION, 1)
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)))
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
@ -223,9 +223,9 @@ AC_ARG_ENABLE([gprof],
# Turn warnings into errors
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--enable-werror],
[Treat all compiler warnings as errors (default is no)])],
[Treat all compiler warnings as errors (default is yes)])],
[enable_werror=$enableval],
[enable_werror=no])
[enable_werror=yes])
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-Werror],[CXXFLAG_WERROR="-Werror"],[CXXFLAG_WERROR=""])
@ -313,22 +313,100 @@ if test "x$enable_werror" = "xyes"; then
ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror"
fi
if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wall],[CXXFLAGS="$CXXFLAGS -Wall"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wextra],[CXXFLAGS="$CXXFLAGS -Wextra"],,[[$CXXFLAG_WERROR]])
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
## set the -Wno-foo case if it works.
AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[CXXFLAGS="$CXXFLAGS -Wno-unused-parameter"],,[[$CXXFLAG_WERROR]])
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]])
fi
# This enables all warnings and selectively disables some. Individual warnings should be
# 1. fixed,
# 2. locally silenced with an explanatory comment, or
# 3. globally silenced here with an explanatory comment.
#
# Justifications
# • `-Wno-aix-compat`: we dont want to maintain compatibility with IBM AIX compilers
# • `-Wno-c++-compat`: this warns about an ABI layout incompatibility between C and C++,
# but we dont need such compatibility except where we use `extern "C"`
# • `-W*c++*-compat-pedantic`: disables warnings about compatibility with older versions of C++ and
# enables warnings about compatibility with newer versions of C++ (we need the explicit enabling,
# even with `-Weverything`, because the earlier disabling of older versions removes some warnings
# that we do want)
DESIRED_WARNING_CXXFLAGS="\
--system-header-prefix=boost --system-header-prefix=crypto/ctaes --system-header-prefix=db_cxx \
--system-header-prefix=event2 --system-header-prefix=gmock --system-header-prefix=gtest \
--system-header-prefix=leveldb --system-header-prefix=rust --system-header-prefix=sodium \
--system-header-prefix=univalue --system-header-prefix=zmq \
-Weverything \
-Wno-aix-compat -Wno-c++-compat \
-Wno-c++98-compat-pedantic -Wno-c++11-compat-pedantic -Wno-c++14-compat-pedantic \
-Wc++17-compat-pedantic -Wc++20-compat-pedantic"
# This list should be incrementally pruned. Each flag should either be enabled or moved to
# `DESIRED_WARNING_CXXFLAGS` with an explanation as to why it remains disabled.
#
# Guidelines for fixing warnings:
# • fix a small number (perhaps one) at a time
# • change `-Wno-foo` to `-Wno-error=foo` locally to get the full report of the warning you enabled
# (but be careful, as re-running `make` will not recompile files that only warned).
#
# Potential justifications:
# • `-Wno-format-nonliteral`: Bitcoin i18n
# • `-Wno-old-style-cast`: do after `-W*-conversion` to avoid introducing more conversions
# • `-Wno-padded`: is this worth the noise of rearranging fields & adding anonymous bitfields?
# • `-Wno-shadow-field`: conflicts with our style of naming constructor arguments the same as fields
# • `-Wno-shadow-field-in-constructor`: conflicts with our style of naming constructor arguments the
# same as fields
# • `-Wno-string-conversion`: currently abused to `assert` on strings
# • `-Wno-tautological-type-limit-compare`: I think isnt portable because of numeric type sizing
DISABLED_WARNING_CXXFLAGS="\
-Wno-c++20-compat -Wno-cast-align -Wno-cast-qual -Wno-comma -Wno-conditional-uninitialized \
-Wno-covered-switch-default -Wno-ctad-maybe-unsupported \
-Wno-delete-non-abstract-non-virtual-dtor -Wno-deprecated-copy -Wno-deprecated-copy-dtor \
-Wno-deprecated-dynamic-exception-spec -Wno-disabled-macro-expansion -Wno-documentation \
-Wno-documentation-unknown-command -Wno-double-promotion -Wno-exit-time-destructors \
-Wno-extra-semi -Wno-extra-semi-stmt -Wno-float-conversion -Wno-float-equal \
-Wno-format-nonliteral -Wno-global-constructors -Wno-header-hygiene -Wno-ignored-qualifiers \
-Wno-implicit-fallthrough -Wno-implicit-int-conversion -Wno-implicit-int-float-conversion \
-Wno-inconsistent-missing-destructor-override -Wno-logical-op-parentheses \
-Wno-misleading-indentation -Wno-mismatched-tags -Wno-missing-noreturn -Wno-missing-prototypes \
-Wno-missing-variable-declarations -Wno-newline-eof -Wno-non-virtual-dtor -Wno-old-style-cast \
-Wno-overloaded-virtual -Wno-padded -Wno-pedantic -Wno-range-loop-construct \
-Wno-redundant-parens -Wno-reorder-ctor -Wno-reserved-id-macro -Wno-reserved-identifier \
-Wno-return-type -Wno-shadow -Wno-shadow-field -Wno-shadow-field-in-constructor \
-Wno-shift-sign-overflow -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-sign-conversion \
-Wno-string-conversion -Wno-suggest-destructor-override -Wno-suggest-override -Wno-switch-enum \
-Wno-tautological-type-limit-compare -Wno-tautological-unsigned-enum-zero-compare \
-Wno-tautological-unsigned-zero-compare -Wno-thread-safety-attributes \
-Wno-thread-safety-negative -Wno-undef -Wno-undefined-func-template -Wno-uninitialized \
-Wno-unreachable-code -Wno-unreachable-code-break -Wno-unreachable-code-return \
-Wno-unused-but-set-variable -Wno-unused-exception-parameter -Wno-unused-function \
-Wno-unused-macros -Wno-unused-member-function -Wno-unused-parameter -Wno-unused-private-field \
-Wno-unused-template -Wno-unused-variable -Wno-used-but-marked-unused -Wno-weak-vtables \
-Wno-zero-as-null-pointer-constant"
# These are sub-flags of those in `DISABLED_WARNING_CXXFLAGS` that allow us to temporarily
# re-enable pieces until the disabling flags are removed.
REENABLED_WARNING_CXXFLAGS="\
-Wbit-int-extension -Wc++11-extra-semi -Wc++11-long-long -Wc++14-attribute-extensions \
-Wc++14-binary-literal -Wc++17-attribute-extensions -Wc++20-attribute-extensions \
-Wc11-extensions -Wcomplex-component-init -Wdelimited-escape-sequence-extension \
-Wdocumentation-deprecated-sync -Wdocumentation-html -Wembedded-directive -Wempty-init-stmt \
-Wempty-translation-unit -Wfixed-enum-extension -Wflexible-array-extensions \
-Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfuture-attribute-extensions \
-Wgnu-auto-type -Wgnu-binary-literal -Wgnu-case-range -Wgnu-complex-integer \
-Wgnu-compound-literal-initializer -Wgnu-conditional-omitted-operand -Wgnu-empty-initializer \
-Wgnu-empty-struct -Wgnu-flexible-array-initializer -Wgnu-flexible-array-union-member \
-Wgnu-imaginary-constant -Wgnu-include-next -Wgnu-label-as-value -Wgnu-line-marker \
-Wgnu-null-pointer-arithmetic -Wgnu-pointer-arith -Wgnu-redeclared-enum \
-Wgnu-statement-expression -Wgnu-union-cast -Wgnu-zero-line-directive \
-Wignored-reference-qualifiers -Wimplicit-const-int-float-conversion \
-Wimplicit-fallthrough-per-function -Wimport-preprocessor-directive-pedantic -Winvalid-utf8 \
-Wkeyword-macro -Wlanguage-extension-token -Wlong-long -Wmicrosoft-charize \
-Wmicrosoft-comment-paste -Wmicrosoft-cpp-macro -Wmicrosoft-end-of-file -Wmicrosoft-enum-value \
-Wmicrosoft-fixed-enum -Wmicrosoft-flexible-array -Wmicrosoft-redeclare-static \
-Wnested-anon-types -Wnullability-extension -Wobjc-signed-char-bool-implicit-int-conversion \
-Woverlength-strings -Wpre-c++2b-compat -Wretained-language-linkage \
-Wshadow-field-in-constructor-modified -Wshadow-ivar -Wsometimes-uninitialized \
-Wstatic-self-init -Wundefined-internal-type -Wunneeded-member-function \
-Wunreachable-code-fallthrough -Wunreachable-code-generic-assoc -Wunreachable-code-loop-increment"
WARNING_CXXFLAGS="$DESIRED_WARNING_CXXFLAGS $DISABLED_WARNING_CXXFLAGS $REENABLED_WARNING_CXXFLAGS"
enable_sse42=no
enable_sse41=no
@ -696,6 +774,14 @@ if test x$use_hardening != xno; then
AX_CHECK_COMPILE_FLAG([-fPIE],[PIE_FLAGS="-fPIE"],[AC_MSG_ERROR(Cannot enable -fPIE)])
if test x$BUILD_OS = xdarwin; then
AX_CHECK_LINK_FLAG([[-Wl,-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-pie"],[AC_MSG_ERROR(Cannot enable -Wl,-pie)])
# Justifications:
# • `-Wno-return-std-move-in-c++11`: This causes failure in CI if treated as an error,
# despite not being documented to exist in any version of Clang (it does not exist on the
# Clang used by our other builds).
# • `-Wno-unknown-warning-option`: The macOS build uses Xcodes clang, which is relatively old
# and doesnt support all the warnings that other platforms do, so we ignore complaints
# about unsupported warnings.
WARNING_CXXFLAGS="$WARNING_CXXFLAGS -Wno-return-std-move-in-c++11 -Wno-unknown-warning-option"
else
AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"],[AC_MSG_ERROR(Cannot enable -pie)])
fi
@ -1139,6 +1225,7 @@ AC_SUBST(RUST_VENDORED_SOURCES)
AC_SUBST(RELDFLAGS)
AC_SUBST(DEBUG_CPPFLAGS)
AC_SUBST(DEBUG_CXXFLAGS)
AC_SUBST(WARNING_CXXFLAGS)
AC_SUBST(ERROR_CXXFLAGS)
AC_SUBST(GPROF_CXXFLAGS)
AC_SUBST(GPROF_LDFLAGS)
@ -1188,15 +1275,7 @@ LIBS_TEMP="$LIBS"
unset LIBS
LIBS="$LIBS_TEMP"
PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
unset PKG_CONFIG_PATH
PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP"
PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
unset PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --disable-openssl-tests"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery"
AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue])
AC_OUTPUT

View File

@ -1,3 +1,27 @@
zcash (5.6.1) stable; urgency=medium
* 5.6.1 release.
-- Electric Coin Company <team@electriccoin.co> Wed, 21 Jun 2023 14:41:09 -0600
zcash (5.6.0) stable; urgency=medium
* 5.6.0 release.
-- Electric Coin Company <team@electriccoin.co> Wed, 14 Jun 2023 16:01:24 -0600
zcash (5.6.0~rc1) stable; urgency=medium
* 5.6.0-rc1 release.
-- Electric Coin Company <team@electriccoin.co> Wed, 07 Jun 2023 18:36:54 -0600
zcash (5.5.1) stable; urgency=medium
* 5.5.1 release.
-- Electric Coin Company <team@electriccoin.co> Tue, 16 May 2023 11:20:05 -0600
zcash (5.5.0) stable; urgency=medium
* 5.5.0 release.

View File

@ -259,9 +259,15 @@ Copyright: 2019 Will Wray
License: Boost-Software-License-1.0
Files: src/secp256k1/*
Copyright: 2013 Pieter Wuille
Copyright: 2013-2023 Pieter Wuille, Thomas Daede, Peter Dettman, Cory Fields, Diederik Huys, Gregory Maxwell, Jonas Nick, Russell O'Connor,
Andrew Poelstra, Wladimir J. van der Laan
License: Expat
Comment: This copyright entry excludes files explicitly listed below.
Comment: This copyright entry excludes files explicitly listed below. Pieter Wuille is given as the overall copyright holder; the names
in the Copyright field are the union of those listed in files under src/secp256k1 at the commit corresponding to upstream version 0.2.0.
Files: src/secp256k1/examples/*
Copyright: 2013-2023 The Bitcoin Core developers, Elichai Turkel
License: CC0-1.0
Files: src/secp256k1/build-aux/m4/ax_jni_include_dir.m4
Copyright: 2008 Don Anderson <dda@sleepycat.com>

View File

@ -18,15 +18,15 @@ import re
import sys
import os
# Ubuntu 16.04 LTS (Xenial Xerus; End of Standard Support April 2021, EOL April 2022) has:
# Ubuntu 20.04 LTS (Focal Fossa; End of Support April 2025) has:
#
# - g++ version 4.5.3 (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=g%2B%2B)
# - libc6 version 2.23 (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=libc6)
# - g++ version 9.3.0 (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=g%2B%2B)
# - libc6 version 2.31 (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=libc6)
#
# Debian 9 (Stretch; EOL 2020-07-06, LTS EOL in 2022) has:
# Debian 10 (Buster; LTS EOL June 2024) has:
#
# - g++ version 6.3.0 (https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=g%2B%2B)
# - libc6 version 2.24 (https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=libc6)
# - g++ version 8.3.0 (https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=g%2B%2B)
# - libc6 version 2.28 (https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=libc6)
#
# RedHat Enterprise Linux 8 (EOL: long and complicated) is based on Fedora 28 (EOL 2019-05-28) and uses the same base packages:
#
@ -43,20 +43,20 @@ import os
# - g++ version 8.4.0 / 9.3.0 / 10.2.0 (https://www.archlinux.org/packages/?q=gcc)
# - libc6 version 2.32 (https://www.archlinux.org/packages/?q=glibc)
#
# We take the minimum of these as our target. In practice, if we build on Xenial without
# We take the minimum of these as our target. In practice, if we build on Buster without
# upgrading GCC or libc, then we should get a binary that works for all these systems, and
# later ones.
#
# According to the GNU ABI document (https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) this corresponds to:
# GCC 4.5.3: GCC_4.5.0, GLIBCXX_3.4.14, CXXABI_1.3.4
# libc6: GLIBC_2_23
# GCC 8.0.0: GCC_8.0.0, GLIBCXX_3.4.24, CXXABI_1.3.11
# libc6: GLIBC_2_27
# We statically link libc++ and libc++abi in our builds. Set this to allow dynamic linking to libstdc++.
ALLOW_DYNAMIC_LIBSTDCXX = False
MAX_VERSIONS = {
'GCC': (4,5,0),
'GLIBC': (2,23),
'GCC': (8,0,0),
'GLIBC': (2,27),
}
if ALLOW_DYNAMIC_LIBSTDCXX:
MAX_VERSIONS.update({

View File

@ -1,5 +1,5 @@
---
name: "zcash-5.5.0"
name: "zcash-5.6.1"
enable_cache: true
distro: "debian"
suites:

View File

@ -1,5 +1,5 @@
---
name: "zcash-5.5.0"
name: "zcash-5.6.1"
enable_cache: true
distro: "debian"
suites:

View File

@ -1,8 +1,8 @@
package=native_cmake
$(package)_version=3.26.3
$(package)_version=3.26.4
$(package)_download_path=https://github.com/Kitware/CMake/releases/download/v$($(package)_version)
$(package)_file_name=cmake-$($(package)_version).tar.gz
$(package)_sha256_hash=bbd8d39217509d163cb544a40d6428ac666ddc83e22905d3e52c925781f0f659
$(package)_sha256_hash=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
define $(package)_set_vars
$(package)_config_opts += -DCMAKE_BUILD_TYPE:STRING=Release

View File

@ -1,14 +1,14 @@
package=native_cxxbridge
# The version needs to match cxx in Cargo.toml
$(package)_version=1.0.94
$(package)_version=1.0.95
$(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=0c8d5c2fad6f2e09b04214007361e94b5e4d85200546eb67fd8885f72aa236f1
$(package)_sha256_hash=842926be773c09b4b45d1a2d82556752d5008f1d564b1a04070ec61ef94992ea
$(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.94
# $ export VERSION=1.0.95
# $ rm .cargo/config .cargo/.configured-for-offline
# $ mkdir tmp
# $ cd tmp

View File

@ -8,6 +8,12 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "anstyle"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d"
[[package]]
name = "basic-toml"
version = "0.1.2"
@ -40,28 +46,29 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clang-ast"
version = "0.1.16"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f01a8823bc658ffd6c6cc1931b0283e7daacf2299fe79faab307cc08c65c98fe"
checksum = "02c73a606ccd8c2fe7691f15c6f9b9e2eae203f8356462fe99db91840e3fb964"
dependencies = [
"serde",
]
[[package]]
name = "clap"
version = "4.2.2"
version = "4.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b802d85aaf3a1cdb02b224ba472ebdea62014fccfcb269b95a4d76443b5ee5a"
checksum = "401a4694d2bf92537b6867d94de48c4842089645fdcdf6c71865b175d836e9c2"
dependencies = [
"clap_builder",
]
[[package]]
name = "clap_builder"
version = "4.2.2"
version = "4.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14a1a858f532119338887a4b8e1af9c60de8249cd7bafd68036a489e261e37b6"
checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980"
dependencies = [
"anstyle",
"bitflags",
"clap_lex",
"strsim",
@ -69,9 +76,9 @@ dependencies = [
[[package]]
name = "clap_lex"
version = "0.4.1"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1"
checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
[[package]]
name = "codespan-reporting"
@ -94,7 +101,7 @@ dependencies = [
[[package]]
name = "cxx"
version = "1.0.94"
version = "1.0.95"
dependencies = [
"cc",
"cxx-build",
@ -109,7 +116,7 @@ dependencies = [
[[package]]
name = "cxx-build"
version = "1.0.94"
version = "1.0.95"
dependencies = [
"cc",
"codespan-reporting",
@ -125,7 +132,7 @@ dependencies = [
[[package]]
name = "cxx-gen"
version = "0.7.94"
version = "0.7.95"
dependencies = [
"codespan-reporting",
"proc-macro2",
@ -144,7 +151,7 @@ dependencies = [
[[package]]
name = "cxxbridge-cmd"
version = "1.0.94"
version = "1.0.95"
dependencies = [
"clap",
"codespan-reporting",
@ -155,11 +162,11 @@ dependencies = [
[[package]]
name = "cxxbridge-flags"
version = "1.0.94"
version = "1.0.95"
[[package]]
name = "cxxbridge-macro"
version = "1.0.94"
version = "1.0.95"
dependencies = [
"clang-ast",
"cxx",
@ -188,9 +195,9 @@ checksum = "210ec60ae7d710bed8683e333e9d2855a8a56a3e9892b38bad3bb0d4d29b0d5e"
[[package]]
name = "flate2"
version = "1.0.25"
version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841"
checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743"
dependencies = [
"crc32fast",
"miniz_oxide",
@ -219,9 +226,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.141"
version = "0.2.146"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
[[package]]
name = "link-cplusplus"
@ -244,39 +251,39 @@ dependencies = [
[[package]]
name = "miniz_oxide"
version = "0.6.2"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"
checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
dependencies = [
"adler",
]
[[package]]
name = "once_cell"
version = "1.17.1"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
[[package]]
name = "pkg-config"
version = "0.3.26"
version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
[[package]]
name = "proc-macro2"
version = "1.0.56"
version = "1.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.26"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
dependencies = [
"proc-macro2",
]
@ -301,18 +308,18 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1"
[[package]]
name = "serde"
version = "1.0.160"
version = "1.0.163"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c"
checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.160"
version = "1.0.163"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df"
checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e"
dependencies = [
"proc-macro2",
"quote",
@ -338,9 +345,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
version = "2.0.15"
version = "2.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822"
checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"
dependencies = [
"proc-macro2",
"quote",
@ -374,9 +381,9 @@ dependencies = [
[[package]]
name = "unicode-ident"
version = "1.0.8"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
[[package]]
name = "unicode-width"

View File

@ -1,18 +1,18 @@
Zcash Contributors
==================
Jack Grigg (1301)
Kris Nuttycombe (659)
Jack Grigg (1335)
Kris Nuttycombe (698)
Simon Liu (460)
Daira Hopwood (392)
Sean Bowe (390)
Sean Bowe (404)
Daira Hopwood (396)
Eirik Ogilvie-Wigley (216)
Greg Pfeil (174)
Greg Pfeil (208)
Wladimir J. van der Laan (160)
Pieter Wuille (149)
Pieter Wuille (153)
Alfredo Garcia (120)
Marshall Gaucher (119)
Taylor Hornby (118)
Marshall Gaucher (118)
Marco Falke (91)
Ying Tong Lai (90)
Jonas Schnelli (90)
@ -22,17 +22,17 @@ sasha (80)
Cory Fields (78)
Matt Corallo (62)
Nathan Wilcox (57)
Daira Emma Hopwood (47)
practicalswift (43)
Dimitris Apostolou (43)
practicalswift (42)
Kevin Gallagher (38)
Daira Emma Hopwood (38)
fanquake (36)
fanquake (37)
Carl Dong (30)
Alex Morcos (28)
Luke Dashjr (27)
Jorge Timón (25)
Gregory Maxwell (24)
John Newbery (23)
Jorge Timón (22)
Suhas Daftuar (20)
furszy (18)
Jonathan "Duke" Leto (18)
@ -43,12 +43,12 @@ Charlie O'Keefe (16)
avnish (14)
Per Grön (14)
Benjamin Winston (13)
teor (12)
Steven Smith (12)
Pavel Janík (12)
Patrick Strateman (12)
Jeremy Rubin (12)
Ariel Gabizon (12)
teor (11)
Russell Yanofsky (11)
Paige Peterson (11)
Kaz Wesley (11)
@ -61,10 +61,10 @@ Zancas Wilcox (9)
kozyilmaz (8)
Jeff Garzik (8)
James O'Beirne (8)
Hennadii Stepanov (8)
Chun Kuan Lee (8)
Ben Wilson (8)
Karl-Johan Alm (7)
Hennadii Stepanov (7)
Alex Wied (7)
David Mercer (6)
Daniel Kraft (6)
@ -86,6 +86,7 @@ Nate Wilcox (4)
Miodrag Popović (4)
Jim Posen (4)
Evan Klitzke (4)
DeckerSU (4)
Ben Woosley (4)
mruddy (3)
lpescher (3)
@ -98,7 +99,6 @@ Julian Fleischer (3)
Jason Davies (3)
Ethan Heilman (3)
Eric Lombrozo (3)
DeckerSU (3)
Danny Willems (3)
Conrado Gouvea (3)
Anthony Towns (3)
@ -113,6 +113,7 @@ kpcyrd (2)
kobake (2)
hexabot (2)
face (2)
ebfull (2)
aniemerg (2)
Yuri Zhykin (2)
UdjinM6 (2)
@ -167,6 +168,7 @@ idm (1)
glowang (1)
ewillbefull@gmail.com (1)
emilrus (1)
dismad (1)
dexX7 (1)
dependabot[bot] (1)
daniel (1)

View File

@ -15,7 +15,6 @@ include:
|``database/*`` | BDB database environment
|``db.log`` | wallet database log file
|``debug.log`` | contains debug information and general logging generated by zcashd
|``fee_estimates.dat`` | stores statistics used to estimate minimum transaction fees and priorities required for confirmation
|``peers.dat`` | peer IP address database (custom format)
|``wallet.dat`` | personal wallet (BDB) with keys and transactions (keep private, back this up!)
|``.cookie`` | session RPC authentication cookie (written at start when cookie authentication is used, deleted on shutdown)

View File

@ -17,7 +17,6 @@ be removed from tier 1. These dates are subject to change.
| ----------------------- | ------------ | -------------- |
| `x86_64-pc-linux-gnu` | Debian 10 | June 2024 |
| | Debian 11 | June 2026 |
| | Ubuntu 18.04 | April 2023 |
| | Ubuntu 20.04 | April 2025 |
## Tier 2
@ -44,6 +43,7 @@ available.
| target | OS | notes |
| ----------------------- | ------------ | ----- |
| `x86_64-pc-linux-gnu` | Arch |
| | Ubuntu 22.04 |
| `x86_64-unknown-freebsd`| FreeBSD |
| `x86_64-w64-mingw32` | Windows | 64-bit MinGW |
| `x86_64-apple-darwin16` | macOS 10.14+ |

View File

@ -42,12 +42,12 @@ time, and may shift due to changes in network solution power.
<!-- RELEASE_SCRIPT_START_MARKER - If you make changes here, check make-release.py -->
| `zcashd` version | Release date | Halt height | End of Support |
| ---------------- | ------------ | ----------- | -------------- |
| 5.4.0 | 2023-02-09 | 2106524 | 2023-06-01 |
| 5.4.1 | 2023-02-13 | 2112024 | 2023-06-05 |
| 5.3.3 | 2023-03-13 | 2121024 | 2023-06-13 |
| 5.4.2 | 2023-03-13 | 2121024 | 2023-06-13 |
| 5.5.0-rc1 | 2023-04-20 | 2188024 | 2023-08-10 |
| 5.5.0-rc2 | 2023-04-25 | 2193300 | 2023-08-15 |
| 5.5.0-rc3 | 2023-04-27 | 2195224 | 2023-08-17 |
| 5.5.0 | 2023-04-27 | 2196024 | 2023-08-17 |
| 5.5.1 | 2023-05-16 | 2217487 | 2023-09-05 |
| 5.6.0-rc1 | 2023-06-08 | 2243024 | 2023-09-28 |
| 5.6.0 | 2023-06-14 | 2250924 | 2023-10-04 |
| 5.6.1 | 2023-06-21 | 2258800 | 2023-10-11 |
<!-- RELEASE_SCRIPT_END_MARKER -->

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASH-CLI "1" "April 2023" "zcash-cli v5.5.0" "User Commands"
.TH ZCASH-CLI "1" "June 2023" "zcash-cli v5.6.1" "User Commands"
.SH NAME
zcash-cli \- manual page for zcash-cli v5.5.0
zcash-cli \- manual page for zcash-cli v5.6.1
.SH DESCRIPTION
Zcash RPC client version v5.5.0
Zcash RPC client version v5.6.1
.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" "April 2023" "zcash-tx v5.5.0" "User Commands"
.TH ZCASH-TX "1" "June 2023" "zcash-tx v5.6.1" "User Commands"
.SH NAME
zcash-tx \- manual page for zcash-tx v5.5.0
zcash-tx \- manual page for zcash-tx v5.6.1
.SH DESCRIPTION
Zcash zcash\-tx utility version v5.5.0
Zcash zcash\-tx utility version v5.6.1
.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" "April 2023" "zcashd-wallet-tool v5.5.0" "User Commands"
.TH ZCASHD-WALLET-TOOL "1" "June 2023" "zcashd-wallet-tool v5.6.1" "User Commands"
.SH NAME
zcashd-wallet-tool \- manual page for zcashd-wallet-tool v5.5.0
zcashd-wallet-tool \- manual page for zcashd-wallet-tool v5.6.1
.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" "April 2023" "zcashd v5.5.0" "User Commands"
.TH ZCASHD "1" "June 2023" "zcashd v5.6.1" "User Commands"
.SH NAME
zcashd \- manual page for zcashd v5.5.0
zcashd \- manual page for zcashd v5.6.1
.SH DESCRIPTION
Zcash Daemon version v5.5.0
Zcash Daemon version v5.6.1
.PP
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.
@ -427,7 +427,7 @@ Append comment to the user agent string
Output debugging information (default: 0, supplying <category> is
optional). If <category> is not supplied or if <category> = 1, output
all debugging information. <category> can be: addrman, alert, bench,
coindb, db, estimatefee, http, libevent, lock, mempool, mempoolrej, net,
coindb, db, http, libevent, lock, mempool, mempoolrej, net,
partitioncheck, pow, proxy, prune, rand, receiveunsafe, reindex, rpc,
selectcoins, tor, zmq, zrpc, zrpcunsafe (implies zrpc). For multiple
specific categories use \fB\-debug=\fR<category> multiple times.
@ -476,10 +476,15 @@ Node relay options:
.IP
Relay and mine data carrier transactions (default: 1)
.HP
\fB\-datacarriersize\fR
\fB\-datacarriersize=\fR<n>
.IP
Maximum size of data in data carrier transactions we relay and mine
(default: 83)
.HP
\fB\-txunpaidactionlimit=\fR<n>
.IP
Transactions with more than this number of unpaid actions will not be
accepted to the mempool or relayed (default: 50)
.PP
Block creation options:
.HP

View File

@ -44,7 +44,6 @@ with other peers, you can disable transaction relay.
Be reminded of the effects of this setting.
- Fee estimation will no longer work.
- It sets the flag "-walletbroadcast" to be "0", only if it is currently unset.
Doing so disables the automatic broadcasting of transactions from the wallet. Not
relaying other's transactions could hurt your privacy if used while the wallet

View File

@ -9,7 +9,7 @@ RPC Changes
disabled features.
- A new `end_of_service` object that contains both the block height for
end-of-service and the estimated time that the end-of-service halt is
expected to occur. Note that this height is just an approximation and
expected to occur. Note that this time is just an approximation and
will change over time as the end-of-service block height approaches,
due to the variability in block times. The
`end_of_service` object is intended to replace the `deprecationheight`

View File

@ -0,0 +1,31 @@
Notable changes
===============
Fixes
-----
Fixes an issue that could cause a node to crash if the privacy policy does not
include `AllowRevealedRecipients` when attempting to create a transaction that
results in transparent change. See
[#6662](https://github.com/zcash/zcash/pull/6662) for details.
Also corrects an underestimate of the [ZIP 317](https://zips.z.cash/zip-0317)
conventional fee when spending UTXOs, which can result in mining of the
transaction being delayed or blocked. See
[#6660](https://github.com/zcash/zcash/pull/6660) for details.
Changelog
=========
Greg Pfeil (10):
Add a test for WalletTxBuilder with legacy account
Handle errors when getting change addr for account
Test that WalletTxBuilder uses correct ZIP 317 fee
Correct fee calculation for vin in tx creation
Calculate consensusBranchId sooner
Extract fee check from test
Delay postponed dependencies
Add release notes for v5.5.1
make-release.py: Versioning changes for 5.5.1.
make-release.py: Updated manpages for 5.5.1.

View File

@ -0,0 +1,195 @@
Notable changes
===============
Change to Transaction Relay Policy
----------------------------------
Transactions paying less than the [ZIP 317](https://zips.z.cash/zip-0317)
conventional fee to the extent that they have more than `-txunpaidactionlimit`
unpaid actions (default: 50) will not be accepted to the mempool or relayed.
For the default values of `-txunpaidactionlimit` and `-blockunpaidactionlimit`,
these transactions would never be mined by the ZIP 317 block construction
algorithm. (If the transaction has been prioritised by `prioritisetransaction`,
the modified fee is used to calculate the number of unpaid actions.)
Removal of Fee Estimation
-------------------------
The `estimatefee` RPC call, which estimated the fee needed for a transaction to
be included within a target number of blocks, has been removed. The fee that
should be paid under normal circumstances is the ZIP 317 conventional fee; it
is not possible to compute that without knowing the number of logical actions
in a transaction, which was not an input to `estimatefee`. The `fee_estimates.dat`
file is no longer used.
Privacy Policy Changes
----------------------
The `AllowRevealedSenders` privacy policy no longer allows sending from
multiple taddrs in the same transaction. This now requires
`AllowLinkingAccountAddresses`. Care should be taken in using
`AllowLinkingAccountAddresses` too broadly, as it can also result in linking
UAs when transparent funds are sent from them. The practical effect is that an
explicit privacy policy is always required for `z_mergetoaddress`,
`z_sendmany`, and `z_shieldcoinbase` when sending from multiple taddrs, even
when using wildcards like `*` and `ANY_TADDR`.
Platform Support
----------------
- Ubuntu 18.04 LTS has been removed from the list of supported platforms. It
reached End of Support on May 31st 2023, and no longer satisfies our Tier 2
policy requirements.
Changelog
=========
Daira Emma Hopwood (8):
Remove fee estimation.
Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. Also remove DEFAULT_FEE_ZATS in RPC tests which was unused.
Fix a false positive duplicate-#include lint.
Avoid calling `ParseNonRFCJSONValue` for string-only parameters. Follow-up to #6617.
Transactions paying less than the ZIP 317 conventional fee to the extent that they have more than `-txunpaidactionlimit` unpaid actions, will now not be accepted to the mempool or relayed. For the default values of `-txunpaidactionlimit` and `-blockunpaidactionlimit`, these transactions would never be mined by the ZIP 317 block construction algorithm. (If the transaction has been prioritised by `prioritisetransaction`, the modified fee is used to calculate the number of unpaid actions.)
Improve handling of UAs as account proxies
Restructure InvalidFunds error message
Reformat InvalidFunds error message (this only changes indentation).
Daira Hopwood (4):
Correct "height" -> "time" in release notes
Link to ZIP 317 in the release notes
Use `DisplayMoney` to simplify constructing an error message
Change incorrect uses of "is not" to "!=".
DeckerSU (1):
txdb: remove consistency checks
Greg Pfeil (24):
Clarify `wallet_doublespend` RPC test
Replace `zec_in_zat` with pre-existing `COIN`
Reduce ZEC ⇒ ZAT conversions
Reduce the scope of some constants
Encapsulate memos
Include `memoStr` in RPC results with `memo`
Centralize ReceiverType conversions
Display pass ratio in RPC test summary
Print all invalid receivers when theres a failure
Fix macOS build on CI
Remove GitHub check for recent-enough branch
Fix missing includes on macOS build
Enable & error on all un-violated warnings
Move warning flags to configure.ac
Update comments on disabled warnings
Fix a minor bug in an error message
Document the Sprout cache used for RPC tests
Make `./configure` quieter by default
Share RPC param table between client and server
Better error for “wrong number of params” in RPC
Improve CONFIGURE_FLAGS handling in build.sh
Reword RPC error messege for wrong number of params
Strengthen AllowRevealedSenders
Have COutput carry its CTxDestination
Hennadii Stepanov (1):
Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough
Jack Grigg (34):
Squashed 'src/secp256k1/' changes from 1758a92ffd..be8d9c262f
Squashed 'src/secp256k1/' changes from be8d9c262f..0559fc6e41
Squashed 'src/secp256k1/' changes from 0559fc6e41..8746600eec
Squashed 'src/secp256k1/' changes from 8746600eec..44c2452fd3
Squashed 'src/secp256k1/' changes from 44c2452fd3..21ffe4b22a
rust: Migrate to `secp256k1 0.26`, `hdwallet 0.4`
Clear out v5.5.0 release notes
Place Sapling {Spend, Output}Description fields behind getters
Place `vShieldedSpend`, `vShieldedOutput` behind getters
Remove Ubuntu 18.04 as a supported platform
contrib: Update `contrib/devtools/symbol-check.py`
Add Ubuntu 22.04 as a Tier 3 platform
build: Consensus: Move Bitcoin script files from consensus to its own module/package
build: Use libtool for linking `librustzcash.a` to the C++ code
build: Fix `--with-libs` linking errors for MinGW cross-compilation
rust: Add `CBLAKE2bWriter` support to `CppStream`
Pass `CChainParams` into `TransactionBuilder` instead of `Consensus::Params`
Pass ExtSK into `TransactionBuilder::AddSaplingSpend` instead of ExpSK
test: Use correct transaction version for Orchard in `TxWithNullifiers`
builder: Use Rust to compute shielded signature hash for v3-v4 txs
builder: Remove `anchor` argument from `TransactionBuilder::AddSaplingSpend`
mempool: Refactor `CTxMemPool::checkNullifiers` to use a template
wallet: Introduce `libzcash::nullifier_t` typedef
builder: Move all fields in `TransactionBuilder` move constructors
rust: Add new structs and functions required for Sapling oxidation
Oxidise the Sapling bundles
Oxidise the Sapling benchmarks and remaining tests
Remove now-unused Sapling logic
test: Use `!=` instead of `is not` in `final*root` RPC tests
Remove `TransactionBuilder` default constructor
test: Some minor cleanups
test: Fix non-conflicting merge conflict
rpc: Add `z_getsubtreesbyindex` RPC method
rpc: Add `trees` field to `getblock` RPC output
Jorge Timón (3):
Build: Consensus: Move consensus files from common to its own module/package
Build: Libconsensus: Move libconsensus-ready files to the consensus package
Build: Consensus: Make libbitcoinconsensus_la_SOURCES fully dynamic and dependend on both crypto and consensus packages
Kris Nuttycombe (19):
Note when (not) to apply the "add release notes" part of the release process.
Add a useful comment about the CheckProofOfWork check in LoadBlockIndexGuts
Add golden tests for Orchard wallet state at the zcashd v5.6.0 boundary.
Persist data for wallet_golden_5_6_0 RPC test
Apply suggestions from code review
Fix a nondeterministic error in wallet tests caused by output shuffling.
Fix nondeterminism in `WalletTests.UpdatedSaplingNoteData`
Upgrade to the latest incrementalmerkletree & bridgetree versions.
Regenerate cargo-vet exemptions
Add Orchard subtree roots to the coins view.
Fix a potential null-pointer dereference.
Use a `limit` parameter instead of `end_index` for `z_getsubtreesbyindex`
Remove `depth` property from `z_getsubtreesbyindex` result & fix docs.
Update to released versions of patch dependencies.
Update audits for upgraded dependencies.
Update RPC tests to enable `-lightwalletd` flag where needed.
Update native_cmake, native_cxxbridge, and native_rust and postpone other required updates.
make-release.py: Versioning changes for 5.6.0-rc1.
make-release.py: Updated manpages for 5.6.0-rc1.
Marshall Gaucher (1):
Update performance-measurements.sh
Pieter Wuille (4):
Remove --disable-openssl-tests for libsecp256k1 configure
Adapt to libsecp256k1 API changes
Add secp256k1_selftest call
scripted-diff: rename privkey with seckey in secp256k1 interface
Sean Bowe (12):
Add support for storing Sapling/Orchard subtree roots in leveldb.
Add tests and fix bugs in implementation of CCoinsView subtree storage.
Minor improvements suggested during code review.
Minor documentation improvements suggested during review.
Minor fixes suggested from code review.
Remove unnecessary dependencies pulled in by proptest.
Store 2^16 subtree roots for the Sapling note commitment tree in the coins database.
Address comments raised during code review.
Automatically migrate old coins database to account for complete subtrees for Sapling and Orchard
Guard all subtree-related functionality behind lightwallet experimental feature flag.
Apply suggestions from code review.
Add UI messages surrounding RegenerateSubtrees.
dismad (1):
Update README.md
ebfull (2):
Simplify logic paths in `GetSubtreeData`
Minor documentation typo fixes
fanquake (1):
build: remove some no-longer-needed var unexporting from configure
practicalswift (1):
Remove unreachable code (g_rpcSignals.PostCommand)
teor (1):
Change module comment in bridge.rs to doc comment

View File

@ -0,0 +1,232 @@
Notable changes
===============
Change to Transaction Relay Policy
----------------------------------
Transactions paying less than the [ZIP 317](https://zips.z.cash/zip-0317)
conventional fee to the extent that they have more than `-txunpaidactionlimit`
unpaid actions (default: 50) will not be accepted to the mempool or relayed.
For the default values of `-txunpaidactionlimit` and `-blockunpaidactionlimit`,
these transactions would never be mined by the ZIP 317 block construction
algorithm. (If the transaction has been prioritised by `prioritisetransaction`,
the modified fee is used to calculate the number of unpaid actions.)
Removal of Fee Estimation
-------------------------
The `estimatefee` RPC call, which estimated the fee needed for a transaction to
be included within a target number of blocks, has been removed. The fee that
should be paid under normal circumstances is the ZIP 317 conventional fee; it
is not possible to compute that without knowing the number of logical actions
in a transaction, which was not an input to `estimatefee`. The `fee_estimates.dat`
file is no longer used.
RPC Changes
-----------
A new RPC method, `z_getsubtreesbyindex`, has been added to the RPC interface.
This method is only enabled when running with the `-experimentalfeatures=1` and
`-lightwalletd=1` node configuration options. This method makes available to the
caller precomputed node values within the Sapling and Orchard note commitment
trees. Wallets can make use of these precomputed values to make their existing
notes spendable without needing to fully scan the sub-trees whose roots
correspond to the returned node values.
In conjunction with this change, the `getblock` RPC method now returns an
additional `trees` field as part of its result. The value for this field is an
object that contains the final sizes of the Sapling and Orchard note commitment
trees after the block's note commitments have been appended to their respective
trees.
Error reporting has also been improved for a number of RPC methods.
Privacy Policy Changes
----------------------
The `AllowRevealedSenders` privacy policy no longer allows sending from
multiple taddrs in the same transaction. This now requires
`AllowLinkingAccountAddresses`. Care should be taken in using
`AllowLinkingAccountAddresses` too broadly, as it can also result in linking
UAs when transparent funds are sent from them. The practical effect is that an
explicit privacy policy is always required for `z_mergetoaddress`,
`z_sendmany`, and `z_shieldcoinbase` when sending from multiple taddrs, even
when using wildcards like `*` and `ANY_TADDR`.
Wallet Updates
--------------
A number of libraries that zcashd relies upon have been updated as part of this
release, including some changes that result in updates to wallet serialization
formats for Orchard note commitment tree data. As always, it is recommended
that users back up their wallets prior to upgrading to a new release to help
guarantee the continued availability of their funds.
Platform Support
----------------
- Ubuntu 18.04 LTS has been removed from the list of supported platforms. It
reached End of Support on May 31st 2023, and no longer satisfies our Tier 2
policy requirements.
Changelog
=========
Daira Emma Hopwood (9):
Remove fee estimation.
Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. Also remove DEFAULT_FEE_ZATS in RPC tests which was unused.
Fix a false positive duplicate-#include lint.
Avoid calling `ParseNonRFCJSONValue` for string-only parameters. Follow-up to #6617.
Transactions paying less than the ZIP 317 conventional fee to the extent that they have more than `-txunpaidactionlimit` unpaid actions, will now not be accepted to the mempool or relayed. For the default values of `-txunpaidactionlimit` and `-blockunpaidactionlimit`, these transactions would never be mined by the ZIP 317 block construction algorithm. (If the transaction has been prioritised by `prioritisetransaction`, the modified fee is used to calculate the number of unpaid actions.)
Improve handling of UAs as account proxies
Restructure InvalidFunds error message
Reformat InvalidFunds error message (this only changes indentation).
contrib/debian/copyright: give more precise information for src/secp256k1
Daira Hopwood (4):
Correct "height" -> "time" in release notes
Link to ZIP 317 in the release notes
Use `DisplayMoney` to simplify constructing an error message
Change incorrect uses of "is not" to "!=".
DeckerSU (1):
txdb: remove consistency checks
Greg Pfeil (24):
Clarify `wallet_doublespend` RPC test
Replace `zec_in_zat` with pre-existing `COIN`
Reduce ZEC ⇒ ZAT conversions
Reduce the scope of some constants
Encapsulate memos
Include `memoStr` in RPC results with `memo`
Centralize ReceiverType conversions
Display pass ratio in RPC test summary
Print all invalid receivers when theres a failure
Fix macOS build on CI
Remove GitHub check for recent-enough branch
Fix missing includes on macOS build
Enable & error on all un-violated warnings
Move warning flags to configure.ac
Update comments on disabled warnings
Fix a minor bug in an error message
Document the Sprout cache used for RPC tests
Make `./configure` quieter by default
Share RPC param table between client and server
Better error for “wrong number of params” in RPC
Improve CONFIGURE_FLAGS handling in build.sh
Reword RPC error messege for wrong number of params
Strengthen AllowRevealedSenders
Have COutput carry its CTxDestination
Hennadii Stepanov (1):
Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough
Jack Grigg (34):
Squashed 'src/secp256k1/' changes from 1758a92ffd..be8d9c262f
Squashed 'src/secp256k1/' changes from be8d9c262f..0559fc6e41
Squashed 'src/secp256k1/' changes from 0559fc6e41..8746600eec
Squashed 'src/secp256k1/' changes from 8746600eec..44c2452fd3
Squashed 'src/secp256k1/' changes from 44c2452fd3..21ffe4b22a
rust: Migrate to `secp256k1 0.26`, `hdwallet 0.4`
Clear out v5.5.0 release notes
Place Sapling {Spend, Output}Description fields behind getters
Place `vShieldedSpend`, `vShieldedOutput` behind getters
Remove Ubuntu 18.04 as a supported platform
contrib: Update `contrib/devtools/symbol-check.py`
Add Ubuntu 22.04 as a Tier 3 platform
build: Consensus: Move Bitcoin script files from consensus to its own module/package
build: Use libtool for linking `librustzcash.a` to the C++ code
build: Fix `--with-libs` linking errors for MinGW cross-compilation
rust: Add `CBLAKE2bWriter` support to `CppStream`
Pass `CChainParams` into `TransactionBuilder` instead of `Consensus::Params`
Pass ExtSK into `TransactionBuilder::AddSaplingSpend` instead of ExpSK
test: Use correct transaction version for Orchard in `TxWithNullifiers`
builder: Use Rust to compute shielded signature hash for v3-v4 txs
builder: Remove `anchor` argument from `TransactionBuilder::AddSaplingSpend`
mempool: Refactor `CTxMemPool::checkNullifiers` to use a template
wallet: Introduce `libzcash::nullifier_t` typedef
builder: Move all fields in `TransactionBuilder` move constructors
rust: Add new structs and functions required for Sapling oxidation
Oxidise the Sapling bundles
Oxidise the Sapling benchmarks and remaining tests
Remove now-unused Sapling logic
test: Use `!=` instead of `is not` in `final*root` RPC tests
Remove `TransactionBuilder` default constructor
test: Some minor cleanups
test: Fix non-conflicting merge conflict
rpc: Add `z_getsubtreesbyindex` RPC method
rpc: Add `trees` field to `getblock` RPC output
Jorge Timón (3):
Build: Consensus: Move consensus files from common to its own module/package
Build: Libconsensus: Move libconsensus-ready files to the consensus package
Build: Consensus: Make libbitcoinconsensus_la_SOURCES fully dynamic and dependend on both crypto and consensus packages
Kris Nuttycombe (26):
Note when (not) to apply the "add release notes" part of the release process.
Add a useful comment about the CheckProofOfWork check in LoadBlockIndexGuts
Add golden tests for Orchard wallet state at the zcashd v5.6.0 boundary.
Persist data for wallet_golden_5_6_0 RPC test
Apply suggestions from code review
Fix a nondeterministic error in wallet tests caused by output shuffling.
Fix nondeterminism in `WalletTests.UpdatedSaplingNoteData`
Upgrade to the latest incrementalmerkletree & bridgetree versions.
Regenerate cargo-vet exemptions
Add Orchard subtree roots to the coins view.
Fix a potential null-pointer dereference.
Use a `limit` parameter instead of `end_index` for `z_getsubtreesbyindex`
Remove `depth` property from `z_getsubtreesbyindex` result & fix docs.
Update to released versions of patch dependencies.
Update audits for upgraded dependencies.
Update RPC tests to enable `-lightwalletd` flag where needed.
Update native_cmake, native_cxxbridge, and native_rust and postpone other required updates.
make-release.py: Versioning changes for 5.6.0-rc1.
make-release.py: Updated manpages for 5.6.0-rc1.
make-release.py: Updated release notes and changelog for 5.6.0-rc1.
make-release.py: Updated book for 5.6.0-rc1.
Add a step for checking/updating the release notes to the release process.
Update release notes for 5.6.0 release.
Revert "Update native_rust" and postpone the upgrade.
make-release.py: Versioning changes for 5.6.0.
make-release.py: Updated manpages for 5.6.0.
Marshall Gaucher (1):
Update performance-measurements.sh
Pieter Wuille (4):
Remove --disable-openssl-tests for libsecp256k1 configure
Adapt to libsecp256k1 API changes
Add secp256k1_selftest call
scripted-diff: rename privkey with seckey in secp256k1 interface
Sean Bowe (13):
Add support for storing Sapling/Orchard subtree roots in leveldb.
Add tests and fix bugs in implementation of CCoinsView subtree storage.
Minor improvements suggested during code review.
Minor documentation improvements suggested during review.
Minor fixes suggested from code review.
Remove unnecessary dependencies pulled in by proptest.
Store 2^16 subtree roots for the Sapling note commitment tree in the coins database.
Address comments raised during code review.
Automatically migrate old coins database to account for complete subtrees for Sapling and Orchard
Guard all subtree-related functionality behind lightwallet experimental feature flag.
Apply suggestions from code review.
Add UI messages surrounding RegenerateSubtrees.
Add test for new IncrementalMerkleTree methods.
dismad (1):
Update README.md
ebfull (2):
Simplify logic paths in `GetSubtreeData`
Minor documentation typo fixes
fanquake (1):
build: remove some no-longer-needed var unexporting from configure
practicalswift (1):
Remove unreachable code (g_rpcSignals.PostCommand)
teor (1):
Change module comment in bridge.rs to doc comment

View File

@ -0,0 +1,38 @@
Notable changes
===============
Fixes
-----
Fixes an issue introduced in v5.6.0 that could cause loss of data from the
wallet's Orchard note commitment tree. Users upgrading directly from v5.5.0
should upgrade directly to v5.6.1. Wallets that were previously upgraded to
v5.6.0 whose wallets contained unspent Orchard notes at the time of the upgrade
will be automatically re-scanned on startup to repair the corrupted note
commitment tree.
Also, the `height` parameter to the `getblocksubsidy` RPC call had accidentally
been made required instead of optional as part of the v5.5.0 upgrade. This
hotfix restores `height` to being treated as an optional parameter.
Changelog
=========
Kris Nuttycombe (13):
Add `getblocksubsidy` checks to `nuparams` test.
Restore `height` parameter to being optional in `getblocksubsidy` RPC.
Re-create serialized v5.5.0 Orchard wallet state.
Remove -regtestwalletsetbestchaineveryblock after golden state generation.
Enable mining to Orchard on regtest
Add persistent example of corrupted Orchard wallet state post v5.6.0
Update wallet_golden_5_6_0 test to fail due to Orchard wallet parsing errors.
Add a test demonstrating inability to spend from the tarnished state.
Fix Orchard bridgetree parsing.
Trigger a rescan on wallet load if spend information is missing from the wallet.
Update changelog & postpone updates for v5.6.1 hotfix.
make-release.py: Versioning changes for 5.6.1.
make-release.py: Updated manpages for 5.6.1.
Sean Bowe (1):
Add sapling.h and rpc/common.h to makefile sources.

View File

@ -98,6 +98,28 @@ manager constructs the release stabilization branch as follows:
$ git checkout -b version-X.Y.0 <COMMIT_ID>
$ git push 'git@github.com:zcash/zcash' $(git rev-parse --abbrev-ref HEAD)
### Review & update the release notes
Now is the time to make sure that all of the changes since the previous release
are property represented in `doc/release-notes.md`. Determine the tag that will
be used for the `RELEASE_FROM` value by manually searching for the tag for the
latest full release in the list obtained by running
$ git tag -l --sort=-taggerdate
and then finding the most recent non-release-candidate version. If you have a
git remote for the upstream `bitcoin-core` repository, be aware that Bitcoin
tags will also appear in this list. Then, skim the full diff since the last
release and make certain that all user-visible changes are properly documented
in `doc/release-notes.md`.
$ git diff <RELEASE_FROM>..HEAD
If you make any changes to the release notes, add commits to do so as
necessary, but do NOT push these commits to the `version-X.Y.Z` branch on the
upstream repository; they will be included in the release branch that will be
created in the next step.
### Create the release candidate branch
Run the release script to create the first release candidate. This will create
@ -122,7 +144,7 @@ Push the resulting branch to github:
$ git push 'git@github.com:$YOUR_GITHUB_NAME/zcash' $(git rev-parse --abbrev-ref HEAD)
Then create the PR on github targeting the `version-X.Y.0` branch. Complete the
standard review process and wait for CI to complete.
standard review process and wait for CI to complete.
## Make a tag for the tip of the release candidate branch
@ -155,12 +177,12 @@ Remember the `v` at the beginning here:
Once CI has completed and the release candidate branch has sufficient approving
reviews, merge the release candidate branch back to the release stabilization
branch. Testing proceeds as normal. Any changes that need to be made during the
release candidate period are made by submitting PRs targeting the release
release candidate period are made by submitting PRs targeting the release
stabilization branch.
Subsequent release candidates, and the creation of the final release, follow
the same process as for release candidates, omitting the `-rcN` suffix for the
final release.
final release.
## Make and deploy deterministic builds
@ -171,6 +193,9 @@ final release.
## Add release notes to GitHub
The following part of the release process applies only to final releases, not
release candidates.
- Go to the [GitHub tags page](https://github.com/zcash/zcash/tags).
- Click "Add release notes" beside the tag for this release.
- Copy the release blog post into the release description, and edit to suit

View File

@ -62,6 +62,8 @@ BASE_SCRIPTS= [
'wallet_persistence.py',
'wallet_listnotes.py',
'wallet_listunspent.py',
'wallet_golden_5_6_0.py',
'wallet_tarnished_5_6_0.py',
# vv Tests less than 60s vv
'orchard_reorg.py',
'fundrawtransaction.py',
@ -146,6 +148,7 @@ BASE_SCRIPTS= [
'wallet_zero_value.py',
'threeofthreerestore.py',
'show_help.py',
'errors.py',
]
ZMQ_SCRIPTS = [
@ -157,8 +160,6 @@ EXTENDED_SCRIPTS = [
# These tests are not run by the travis build process.
# Longest test should go first, to favor running tests in parallel
'pruning.py',
# vv Tests less than 20m vv
'smartfees.py',
# vv Tests less than 5m vv
# vv Tests less than 2m vv
'getblocktemplate_longpoll.py',
@ -330,18 +331,18 @@ def run_tests(test_handler, test_list, src_dir, build_dir, exeext, jobs=1, enabl
subprocess.check_output([tests_dir + 'create_cache.py'] + flags)
#Run Tests
all_passed = True
time_sum = 0
time0 = time.time()
job_queue = test_handler(jobs, tests_dir, test_list, flags)
max_len_name = len(max(test_list, key=len))
total_count = 0
passed_count = 0
results = []
try:
for _ in range(len(test_list)):
(name, stdout, stderr, passed, duration) = job_queue.get_next(deterministic)
all_passed = all_passed and passed
time_sum += duration
print('\n' + BOLD[1] + name + BOLD[0] + ":")
@ -352,6 +353,9 @@ def run_tests(test_handler, test_list, src_dir, build_dir, exeext, jobs=1, enabl
print("\n", end='')
else:
print(", Duration: %s s" % (duration,))
total_count += 1
if passed:
passed_count += 1
new_result = "%s | %s" % (name.ljust(max_len_name), str(passed).ljust(6))
if not deterministic:
@ -363,8 +367,14 @@ def run_tests(test_handler, test_list, src_dir, build_dir, exeext, jobs=1, enabl
print("", j[0])
print('\n', end='')
all_passed = passed_count == total_count
if all_passed:
success_rate = "True"
else:
success_rate = "%d/%d" % (passed_count, total_count)
header = "%s | PASSED" % ("TEST".ljust(max_len_name),)
footer = "%s | %s" % ("ALL".ljust(max_len_name), str(all_passed).ljust(6))
footer = "%s | %s" % ("ALL".ljust(max_len_name), str(success_rate).ljust(6))
if not deterministic:
header += " | DURATION"
footer += " | %s s (accumulated)\nRuntime: %s s" % (time_sum, int(time.time() - time0))

View File

@ -1,2 +1 @@
*.pyc
cache

View File

@ -0,0 +1,3 @@
{
"cache_time": 1687296923.7459898
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,10 @@
# Sprout cache contents
This Sprout cache was created in 5d44ce318eb1916340e680b944b78cb5175468f9 by
`create_sprout_chains.py`, which was added in the same commit (and removed
shortly after). If changes are needed, the script can be updated and run from
that commit its no longer possible to send funds to Sprout in the master
branch.
The cache contains one Sprout address per node on nodes [0..3]. Each address
contains a single 50 ZEC note.

View File

@ -0,0 +1,3 @@
{
"cache_time": 1687307359.731706
}

Binary file not shown.

View File

@ -0,0 +1,39 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2018-2023 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
#
# Test RPC call failure cases. Tests should mostly correspond to code in rpc/server.cpp.
#
from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import start_nodes
class BlockchainTest(BitcoinTestFramework):
"""
Test RPC call failure cases.
"""
def __init__(self):
super().__init__()
self.num_nodes = 2
def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)
self.is_network_split = False
self.sync_all()
def run_test(self):
node = self.nodes[0]
try:
node.gettxoutsetinfo(1)
except JSONRPCException as e:
errorString = e.error['message']
assert("Too many parameters for method `gettxoutsetinfo`. Needed exactly 0, but received 1" in errorString)
if __name__ == '__main__':
BlockchainTest().main()

View File

@ -21,7 +21,7 @@ from test_framework.util import (
HEARTWOOD_BRANCH_ID,
CANOPY_BRANCH_ID,
NU5_BRANCH_ID,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
assert_equal,
assert_false,
assert_true,
@ -201,7 +201,7 @@ class Zip239Test(BitcoinTestFramework):
opid = self.nodes[0].z_sendmany(sproutzaddr, [{
'address': node1_taddr,
'amount': 1,
}], 1, DEFAULT_FEE, 'AllowRevealedRecipients')
}], 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
v4_txid = uint256_from_str(hex_str_to_bytes(
wait_and_assert_operationid_status(self.nodes[0], opid)
)[::-1])

View File

@ -41,6 +41,8 @@ class FinalOrchardRootTest(BitcoinTestFramework):
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
'-experimentalfeatures',
'-lightwalletd'
]] * self.num_nodes)
connect_nodes_bi(self.nodes,0,1)
self.is_network_split=False
@ -50,6 +52,7 @@ class FinalOrchardRootTest(BitcoinTestFramework):
# Verify genesis block doesn't contain the final orchard root field.
blk = self.nodes[0].getblock("0")
assert "finalorchardroot" not in blk
assert "orchard" not in blk["trees"]
treestate = self.nodes[0].z_gettreestate("0")
assert_equal(treestate["height"], 0)
assert_equal(treestate["hash"], self.nodes[0].getblockhash(0))
@ -75,6 +78,7 @@ class FinalOrchardRootTest(BitcoinTestFramework):
for height in range(1, blockcount + 1):
blk = self.nodes[0].getblock(str(height))
assert "finalorchardroot" not in blk
assert "orchard" not in blk["trees"]
treestate = self.nodes[0].z_gettreestate(str(height))
assert_equal(treestate["height"], height)
@ -102,6 +106,7 @@ class FinalOrchardRootTest(BitcoinTestFramework):
for height in range(200, 211):
blk = self.nodes[0].getblock(str(height))
assert_equal(blk["finalorchardroot"], ORCHARD_TREE_EMPTY_ROOT)
assert_equal(blk["trees"]["orchard"]["size"], 0)
treestate = self.nodes[0].z_gettreestate(str(height))
assert_equal(treestate["height"], height)
@ -120,6 +125,11 @@ class FinalOrchardRootTest(BitcoinTestFramework):
assert_equal(treestate["orchard"]["commitments"]["finalRoot"], ORCHARD_TREE_EMPTY_ROOT)
assert_equal(treestate["orchard"]["commitments"]["finalState"], "000000")
# Verify that there are no complete Orchard subtrees.
subtrees = self.nodes[0].z_getsubtreesbyindex('orchard', 0)
assert_equal(subtrees['pool'], 'orchard')
assert_equal(subtrees['start_index'], 0)
assert_equal(len(subtrees['subtrees']), 0)
# Node 0 shields some funds
taddr0 = get_coinbase_address(self.nodes[0])
@ -140,12 +150,13 @@ class FinalOrchardRootTest(BitcoinTestFramework):
# Verify the final Orchard root has changed
blk = self.nodes[0].getblock("211")
root = blk["finalorchardroot"]
assert root is not ORCHARD_TREE_EMPTY_ROOT
assert root is not NULL_FIELD
assert root != ORCHARD_TREE_EMPTY_ROOT
assert root != NULL_FIELD
# Verify there is a Orchard output description (its commitment was added to tree)
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["orchard"]["actions"]), 2)
assert_equal(blk["trees"]["orchard"]["size"], 2)
# Since there is a now orchard shielded input in the blockchain,
# the orchard values should have changed
@ -162,7 +173,9 @@ class FinalOrchardRootTest(BitcoinTestFramework):
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(root, self.nodes[0].getblock("212")["finalorchardroot"])
blk = self.nodes[0].getblock("212")
assert_equal(root, blk["finalorchardroot"])
assert_equal(blk["trees"]["orchard"]["size"], 2)
# Mine a block with a transparent tx and verify the final Orchard root does not change
taddr1 = self.nodes[1].getnewaddress()
@ -187,9 +200,11 @@ class FinalOrchardRootTest(BitcoinTestFramework):
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("214")["tx"]), 2)
blk = self.nodes[0].getblock("214")
assert_equal(len(blk["tx"]), 2)
assert_equal(self.nodes[0].z_getbalance(zaddr0), Decimal("37.66"))
assert_equal(root, self.nodes[0].getblock("214")["finalorchardroot"])
assert_equal(root, blk["finalorchardroot"])
assert_equal(blk["trees"]["orchard"]["size"], 2)
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["orchard"]["commitments"]["finalRoot"], root)
@ -210,9 +225,11 @@ class FinalOrchardRootTest(BitcoinTestFramework):
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("215")["tx"]), 2)
blk = self.nodes[0].getblock("215")
assert_equal(len(blk["tx"]), 2)
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal("2.34"))
assert_equal(root, self.nodes[0].getblock("215")["finalorchardroot"])
assert_equal(root, blk["finalorchardroot"])
assert_equal(blk["trees"]["orchard"]["size"], 2)
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["orchard"]["commitments"]["finalRoot"], root)
@ -237,13 +254,15 @@ class FinalOrchardRootTest(BitcoinTestFramework):
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("216")["tx"]), 2)
blk = self.nodes[0].getblock("216")
assert_equal(len(blk["tx"]), 2)
assert_equal(self.nodes[1].z_getbalance(orchardAddr1), Decimal("2.34"))
assert root is not self.nodes[0].getblock("216")["finalorchardroot"]
assert root != blk["finalorchardroot"]
# Verify there is a Orchard output description (its commitment was added to tree)
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["orchard"]["actions"]), 2) # there is Orchard shielded change
assert_equal(blk["trees"]["orchard"]["size"], 4)
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["sprout"], treestate["sprout"])
@ -265,13 +284,15 @@ class FinalOrchardRootTest(BitcoinTestFramework):
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("217")["tx"]), 2)
blk = self.nodes[0].getblock("217")
assert_equal(len(blk["tx"]), 2)
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("2.34"))
assert root is not self.nodes[0].getblock("217")["finalorchardroot"]
assert root != blk["finalorchardroot"]
# Verify there is a Orchard output description (its commitment was added to tree)
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["orchard"]["actions"]), 2) # there is Orchard shielded change
assert_equal(blk["trees"]["orchard"]["size"], 6)
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["sprout"], treestate["sprout"])
@ -281,6 +302,11 @@ class FinalOrchardRootTest(BitcoinTestFramework):
assert_equal(len(new_treestate["orchard"]["commitments"]["finalRoot"]), 64)
assert_equal(len(new_treestate["orchard"]["commitments"]["finalState"]), 260)
# Verify that there are still no complete subtrees (as we have not created 2^16 notes).
subtrees = self.nodes[0].z_getsubtreesbyindex('orchard', 0)
assert_equal(subtrees['pool'], 'orchard')
assert_equal(subtrees['start_index'], 0)
assert_equal(len(subtrees['subtrees']), 0)
if __name__ == '__main__':

View File

@ -41,6 +41,8 @@ class FinalSaplingRootTest(BitcoinTestFramework):
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
'-experimentalfeatures',
'-lightwalletd'
]] * self.num_nodes)
connect_nodes_bi(self.nodes,0,1)
self.is_network_split=False
@ -50,6 +52,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
# 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)
assert "sapling" not in blk["trees"]
treestate = self.nodes[0].z_gettreestate("0")
assert_equal(treestate["height"], 0)
assert_equal(treestate["hash"], self.nodes[0].getblockhash(0))
@ -75,6 +78,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
for height in range(1, blockcount + 1):
blk = self.nodes[0].getblock(str(height))
assert_equal(blk["finalsaplingroot"], SAPLING_TREE_EMPTY_ROOT)
assert_equal(blk["trees"]["sapling"]["size"], 0)
treestate = self.nodes[0].z_gettreestate(str(height))
assert_equal(treestate["height"], height)
@ -92,6 +96,12 @@ class FinalSaplingRootTest(BitcoinTestFramework):
assert "skipHash" not in treestate["orchard"]
assert_equal(treestate["orchard"]["commitments"]["finalRoot"], NULL_FIELD)
# Verify that there are no complete Sapling subtrees.
subtrees = self.nodes[0].z_getsubtreesbyindex('sapling', 0)
assert_equal(subtrees['pool'], 'sapling')
assert_equal(subtrees['start_index'], 0)
assert_equal(len(subtrees['subtrees']), 0)
# Node 0 shields some funds
taddr0 = get_coinbase_address(self.nodes[0])
saplingAddr0 = self.nodes[0].z_getnewaddress('sapling')
@ -107,12 +117,13 @@ class FinalSaplingRootTest(BitcoinTestFramework):
# Verify the final Sapling root has changed
blk = self.nodes[0].getblock("201")
root = blk["finalsaplingroot"]
assert root is not SAPLING_TREE_EMPTY_ROOT
assert root is not NULL_FIELD
assert root != SAPLING_TREE_EMPTY_ROOT
assert root != NULL_FIELD
# Verify there is a Sapling output description (its commitment was added to tree)
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["vShieldedOutput"]), 1)
assert_equal(blk["trees"]["sapling"]["size"], 1)
# Since there is a now sapling shielded input in the blockchain,
# the sapling values should have changed
@ -129,7 +140,9 @@ class FinalSaplingRootTest(BitcoinTestFramework):
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(root, self.nodes[0].getblock("202")["finalsaplingroot"])
blk = self.nodes[0].getblock("202")
assert_equal(root, blk["finalsaplingroot"])
assert_equal(blk["trees"]["sapling"]["size"], 1)
# Mine a block with a transparent tx and verify the final Sapling root does not change
taddr1 = self.nodes[1].getnewaddress()
@ -154,9 +167,11 @@ class FinalSaplingRootTest(BitcoinTestFramework):
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("204")["tx"]), 2)
blk = self.nodes[0].getblock("204")
assert_equal(len(blk["tx"]), 2)
assert_equal(self.nodes[0].z_getbalance(zaddr0), Decimal("37.66"))
assert_equal(root, self.nodes[0].getblock("204")["finalsaplingroot"])
assert_equal(root, blk["finalsaplingroot"])
assert_equal(blk["trees"]["sapling"]["size"], 1)
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["sapling"]["commitments"]["finalRoot"], root)
@ -177,13 +192,15 @@ class FinalSaplingRootTest(BitcoinTestFramework):
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("205")["tx"]), 2)
blk = self.nodes[0].getblock("205")
assert_equal(len(blk["tx"]), 2)
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal("2.34"))
assert root is not self.nodes[0].getblock("205")["finalsaplingroot"]
assert root != blk["finalsaplingroot"]
# Verify there is a Sapling output description (its commitment was added to tree)
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["vShieldedOutput"]), 2) # there is Sapling shielded change
assert_equal(blk["trees"]["sapling"]["size"], 3)
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["sprout"], treestate["sprout"])
@ -193,7 +210,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
assert_equal(len(new_treestate["sapling"]["commitments"]["finalState"]), 136)
treestate = new_treestate
# Mine a block with a Sapling shielded sender and transparent recipient and verify the final Sapling root doesn't change
# Mine a block with a Sapling shielded sender and transparent recipient.
taddr2 = self.nodes[0].getnewaddress()
recipients = []
recipients.append({"address": taddr2, "amount": Decimal('2.34')})
@ -206,14 +223,26 @@ class FinalSaplingRootTest(BitcoinTestFramework):
assert_equal(len(self.nodes[0].getblock("206")["tx"]), 2)
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("2.34"))
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), 0)
# Verify the final Sapling root changes (because the Sapling bundle was padded
# with 2 dummy outputs).
blk = self.nodes[0].getblock("206")
root = blk["finalsaplingroot"]
assert_equal(root, self.nodes[0].getblock("205")["finalsaplingroot"])
assert root != self.nodes[0].getblock("205")["finalsaplingroot"]
assert_equal(blk["trees"]["sapling"]["size"], 5)
# Verify there are two Sapling output descriptions.
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["vShieldedOutput"]), 2)
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["sprout"], treestate["sprout"])
assert_equal(new_treestate["sapling"], treestate["sapling"])
assert new_treestate["sapling"]["commitments"]["finalRoot"] != treestate["sapling"]["commitments"]["finalRoot"]
assert new_treestate["sapling"]["commitments"]["finalState"] != treestate["sapling"]["commitments"]["finalState"]
assert_equal(len(new_treestate["sapling"]["commitments"]["finalRoot"]), 64)
assert_equal(len(new_treestate["sapling"]["commitments"]["finalState"]), 138)
treestate = new_treestate
# Activate NU5; more testing should be added once we can mine orchard transactions.
self.sync_all()
@ -230,6 +259,12 @@ class FinalSaplingRootTest(BitcoinTestFramework):
assert_equal(new_treestate["orchard"]["commitments"]["finalState"], "000000")
pass
# Verify that there are still no complete subtrees (as we have not created 2^16 notes).
subtrees = self.nodes[0].z_getsubtreesbyindex('sapling', 0)
assert_equal(subtrees['pool'], 'sapling')
assert_equal(subtrees['start_index'], 0)
assert_equal(len(subtrees['subtrees']), 0)
if __name__ == '__main__':
FinalSaplingRootTest().main()

View File

@ -9,7 +9,7 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
CANOPY_BRANCH_ID,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
get_coinbase_address,
hex_str_to_bytes,
@ -52,13 +52,13 @@ class GetBlockTemplateTest(BitcoinTestFramework):
node = self.node
# sprout to transparent (v4)
recipients = [{"address": self.transparent_addr, "amount": Decimal('0.1')}]
myopid = node.z_sendmany(self.sprout_addr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
myopid = node.z_sendmany(self.sprout_addr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(node, myopid)
def add_nu5_v5_tx_to_mempool(self):
node = self.node
recipients = [{"address": self.unified_addr, "amount": Decimal('9.99999')}]
myopid = node.z_sendmany(get_coinbase_address(node), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
myopid = node.z_sendmany(get_coinbase_address(node), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(node, myopid)
def add_transparent_tx_to_mempool(self):

View File

@ -10,7 +10,7 @@
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, start_node, DEFAULT_FEE
from test_framework.util import assert_equal, start_node, LEGACY_DEFAULT_FEE
from decimal import Decimal
@ -62,7 +62,7 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
blocks = []
blocks.extend(self.nodes[0].generate(1))
spends2_raw = [ self.create_tx(txid, node0_address, Decimal('10.0') - DEFAULT_FEE) for txid in spends1_id ]
spends2_raw = [ self.create_tx(txid, node0_address, Decimal('10.0') - LEGACY_DEFAULT_FEE) for txid in spends1_id ]
spends2_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends2_raw ]
blocks.extend(self.nodes[0].generate(1))

View File

@ -11,7 +11,7 @@ from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, \
connect_nodes_bi, sync_blocks, start_nodes, \
wait_and_assert_operationid_status, DEFAULT_FEE
wait_and_assert_operationid_status, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -79,7 +79,7 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
assert_equal(set(self.nodes[2].getrawmempool()), set())
## Shield one of Alice's coinbase funds to her zaddr
res = self.nodes[0].z_shieldcoinbase("*", z_alice, DEFAULT_FEE, 1)
res = self.nodes[0].z_shieldcoinbase("*", z_alice, LEGACY_DEFAULT_FEE, 1)
wait_and_assert_operationid_status(self.nodes[0], res['opid'])
self.nodes[0].generate(1)
self.sync_all()
@ -87,7 +87,7 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
# Get balance on node 0
bal = self.nodes[0].z_gettotalbalance()
print("Balance before zsend, after shielding 10: ", bal)
assert_equal(Decimal(bal["private"]), Decimal('10.0') - DEFAULT_FEE)
assert_equal(Decimal(bal["private"]), Decimal('10.0') - LEGACY_DEFAULT_FEE)
print("Splitting network...")
self.split_network()
@ -220,7 +220,7 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
print("Ensure balance of node 0 is correct")
bal = self.nodes[0].z_gettotalbalance()
print("Balance after expire_shielded has expired: ", bal)
assert_equal(Decimal(bal["private"]), Decimal('8.0') - DEFAULT_FEE)
assert_equal(Decimal(bal["private"]), Decimal('8.0') - LEGACY_DEFAULT_FEE)
print("Splitting network...")
self.split_network()

View File

@ -10,7 +10,7 @@
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, connect_nodes_bi, fail, \
initialize_chain_clean, start_node, \
wait_and_assert_operationid_status, DEFAULT_FEE
wait_and_assert_operationid_status, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -86,7 +86,7 @@ class MergeToAddressHelper:
# Shield the coinbase
myzaddr = self.new_address(test, 0)
result = test.nodes[0].z_shieldcoinbase("*", myzaddr, 0)
result = test.nodes[0].z_shieldcoinbase("*", myzaddr, 0, None, None, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
@ -164,7 +164,7 @@ class MergeToAddressHelper:
lambda: test.nodes[0].z_mergetoaddress(["ANY_SPROUT", "ANY_SAPLING"], mytaddr))
# Merge UTXOs from node 0 of value 30, default fee
result = test.nodes[0].z_mergetoaddress([mytaddr, mytaddr2, mytaddr3], myzaddr, None, None, None, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress([mytaddr, mytaddr2, mytaddr3], myzaddr, None, None, None, None, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
@ -173,7 +173,7 @@ class MergeToAddressHelper:
# Confirm balances and that do_not_shield_taddr containing funds of 10 was left alone
assert_equal(test.nodes[0].getbalance(), Decimal('10'))
assert_equal(test.nodes[0].z_getbalance(do_not_shield_taddr), Decimal('10'))
assert_equal(test.nodes[0].z_getbalance(myzaddr), Decimal('40') - conventional_fee(4))
assert_equal(test.nodes[0].z_getbalance(myzaddr), Decimal('40') - conventional_fee(5))
assert_equal(test.nodes[1].getbalance(), Decimal('40'))
assert_equal(test.nodes[2].getbalance(), Decimal('30'))
@ -190,10 +190,10 @@ class MergeToAddressHelper:
test.sync_all()
assert_equal(test.nodes[0].z_getbalance(myzaddr), Decimal('0'))
assert_equal(test.nodes[0].z_getbalance(myzaddr2), Decimal('40') - conventional_fee(4))
assert_equal(test.nodes[0].z_getbalance(myzaddr2), Decimal('40') - conventional_fee(5))
# Shield coinbase UTXOs from any node 2 taddr, and set fee to 0
result = test.nodes[2].z_shieldcoinbase("*", myzaddr, 0)
result = test.nodes[2].z_shieldcoinbase("*", myzaddr, 0, None, None, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(test.nodes[2], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
@ -201,7 +201,7 @@ class MergeToAddressHelper:
assert_equal(test.nodes[0].getbalance(), Decimal('10'))
assert_equal(test.nodes[0].z_getbalance(myzaddr), Decimal('30'))
assert_equal(test.nodes[0].z_getbalance(myzaddr2), Decimal('40') - conventional_fee(4))
assert_equal(test.nodes[0].z_getbalance(myzaddr2), Decimal('40') - conventional_fee(5))
assert_equal(test.nodes[1].getbalance(), Decimal('60'))
assert_equal(test.nodes[2].getbalance(), Decimal('0'))
@ -212,9 +212,9 @@ class MergeToAddressHelper:
generate_and_check(test.nodes[1], 2)
test.sync_all()
assert_equal(test.nodes[0].getbalance(), Decimal('80') - conventional_fee(4))
assert_equal(test.nodes[0].getbalance(), Decimal('80') - conventional_fee(5))
assert_equal(test.nodes[0].z_getbalance(do_not_shield_taddr), Decimal('10'))
assert_equal(test.nodes[0].z_getbalance(mytaddr), Decimal('70') - conventional_fee(4))
assert_equal(test.nodes[0].z_getbalance(mytaddr), Decimal('70') - conventional_fee(5))
assert_equal(test.nodes[0].z_getbalance(myzaddr), Decimal('0'))
assert_equal(test.nodes[0].z_getbalance(myzaddr2), Decimal('0'))
assert_equal(test.nodes[1].getbalance(), Decimal('70'))
@ -223,7 +223,7 @@ class MergeToAddressHelper:
# Merge all node 0 UTXOs together into a node 1 taddr, and set fee to 0
test.nodes[1].getnewaddress() # Ensure we have an empty address
n1taddr = test.nodes[1].getnewaddress()
result = test.nodes[0].z_mergetoaddress(["ANY_TADDR"], n1taddr, 0, None, None, None, 'AllowFullyTransparent')
result = test.nodes[0].z_mergetoaddress(["ANY_TADDR"], n1taddr, 0, None, None, None, 'NoPrivacy')
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
@ -234,8 +234,8 @@ class MergeToAddressHelper:
assert_equal(test.nodes[0].z_getbalance(do_not_shield_taddr), Decimal('0'))
assert_equal(test.nodes[0].z_getbalance(mytaddr), Decimal('0'))
assert_equal(test.nodes[0].z_getbalance(myzaddr), Decimal('0'))
assert_equal(test.nodes[1].getbalance(), Decimal('160') - conventional_fee(4))
assert_equal(test.nodes[1].z_getbalance(n1taddr), Decimal('80') - conventional_fee(4))
assert_equal(test.nodes[1].getbalance(), Decimal('160') - conventional_fee(5))
assert_equal(test.nodes[1].z_getbalance(n1taddr), Decimal('80') - conventional_fee(5))
assert_equal(test.nodes[2].getbalance(), Decimal('0'))
# Generate 5 regular UTXOs on node 0, and 20 regular UTXOs on node 2.
@ -251,7 +251,7 @@ class MergeToAddressHelper:
test.sync_all()
# This z_mergetoaddress and the one below result in two notes in myzaddr.
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, DEFAULT_FEE, None, None, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, LEGACY_DEFAULT_FEE, None, None, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 5)
assert_equal(result["remainingUTXOs"], 0)
assert_equal(result["mergingNotes"], 0)
@ -259,7 +259,7 @@ class MergeToAddressHelper:
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
# Verify maximum number of UTXOs is not limited when the limit parameter is set to 0.
result = test.nodes[2].z_mergetoaddress([n2taddr], myzaddr, DEFAULT_FEE, 0, None, None, 'AllowRevealedSenders')
result = test.nodes[2].z_mergetoaddress([n2taddr], myzaddr, LEGACY_DEFAULT_FEE, 0, None, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 20)
assert_equal(result["remainingUTXOs"], 0)
assert_equal(result["mergingNotes"], 0)
@ -303,7 +303,7 @@ class MergeToAddressHelper:
# NB: We cant yet merge from UAs, so ensure were not before running these cases
if (myzaddr[0] != 'u'):
# Also check that we can set off a second merge before the first one is complete
result1 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, DEFAULT_FEE, 50, 2)
result1 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, LEGACY_DEFAULT_FEE, 50, 2)
# First merge should select from all notes
assert_equal(result1["mergingUTXOs"], 0)
@ -313,7 +313,7 @@ class MergeToAddressHelper:
assert_equal(result1["remainingNotes"], 2)
# Second merge should ignore locked notes
result2 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, DEFAULT_FEE, 50, 2)
result2 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, LEGACY_DEFAULT_FEE, 50, 2)
assert_equal(result2["mergingUTXOs"], 0)
assert_equal(result2["remainingUTXOs"], 0)
assert_equal(result2["mergingNotes"], 2)
@ -326,7 +326,7 @@ class MergeToAddressHelper:
test.sync_all()
# Shield both UTXOs and notes to a z-addr
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, LEGACY_DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 10)
assert_equal(result["remainingUTXOs"], 7)
assert_equal(result["mergingNotes"], 2)
@ -334,7 +334,7 @@ class MergeToAddressHelper:
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
else:
# Shield both UTXOs and notes to a z-addr
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, LEGACY_DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 10)
assert_equal(result["remainingUTXOs"], 7)
assert_equal(result["mergingNotes"], 2)

View File

@ -16,6 +16,7 @@ from test_framework.util import (
CANOPY_BRANCH_ID,
NU5_BRANCH_ID,
)
from decimal import Decimal
class NuparamsTest(BitcoinTestFramework):
@ -31,8 +32,9 @@ class NuparamsTest(BitcoinTestFramework):
def setup_network(self, split=False):
args = [[
nuparams(HEARTWOOD_BRANCH_ID, 3),
nuparams(NU5_BRANCH_ID, 5),
nuparams(BLOSSOM_BRANCH_ID, 3),
nuparams(CANOPY_BRANCH_ID, 5),
nuparams(NU5_BRANCH_ID, 7),
] * self.num_nodes]
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, args)
self.is_network_split = False
@ -62,7 +64,7 @@ class NuparamsTest(BitcoinTestFramework):
heartwood = upgrades[nustr(HEARTWOOD_BRANCH_ID)]
assert_equal(heartwood['name'], 'Heartwood')
assert_equal(heartwood['activationheight'], 3)
assert_equal(heartwood['activationheight'], 5)
assert_equal(heartwood['status'], 'pending')
canopy = upgrades[nustr(CANOPY_BRANCH_ID)]
@ -72,12 +74,15 @@ class NuparamsTest(BitcoinTestFramework):
nu5 = upgrades[nustr(NU5_BRANCH_ID)]
assert_equal(nu5['name'], 'NU5')
assert_equal(nu5['activationheight'], 5)
assert_equal(nu5['activationheight'], 7)
assert_equal(nu5['status'], 'pending')
# Initial subsidy at the genesis block is 12.5 ZEC
assert_equal(node.getblocksubsidy()["miner"], Decimal("12.5"))
# start_node() hardcodes Sapling and Overwinter to activate at height 1
node.generate(1)
# start_node() hardcodes Sapling and Overwinter to activate a height 1
bci = node.getblockchaininfo()
assert_equal(bci['blocks'], 1)
upgrades = bci['upgrades']
@ -99,7 +104,7 @@ class NuparamsTest(BitcoinTestFramework):
heartwood = upgrades[nustr(HEARTWOOD_BRANCH_ID)]
assert_equal(heartwood['name'], 'Heartwood')
assert_equal(heartwood['activationheight'], 3)
assert_equal(heartwood['activationheight'], 5)
assert_equal(heartwood['status'], 'pending')
canopy = upgrades[nustr(CANOPY_BRANCH_ID)]
@ -109,47 +114,17 @@ class NuparamsTest(BitcoinTestFramework):
nu5 = upgrades[nustr(NU5_BRANCH_ID)]
assert_equal(nu5['name'], 'NU5')
assert_equal(nu5['activationheight'], 5)
assert_equal(nu5['activationheight'], 7)
assert_equal(nu5['status'], 'pending')
node.generate(1)
bci = node.getblockchaininfo()
assert_equal(bci['blocks'], 2)
upgrades = bci['upgrades']
overwinter = upgrades[nustr(OVERWINTER_BRANCH_ID)]
assert_equal(overwinter['name'], 'Overwinter')
assert_equal(overwinter['activationheight'], 1)
assert_equal(overwinter['status'], 'active')
sapling = upgrades[nustr(SAPLING_BRANCH_ID)]
assert_equal(sapling['name'], 'Sapling')
assert_equal(sapling['activationheight'], 1)
assert_equal(sapling['status'], 'active')
blossom = upgrades[nustr(BLOSSOM_BRANCH_ID)]
assert_equal(blossom['name'], 'Blossom')
assert_equal(blossom['activationheight'], 3)
assert_equal(blossom['status'], 'pending')
heartwood = upgrades[nustr(HEARTWOOD_BRANCH_ID)]
assert_equal(heartwood['name'], 'Heartwood')
assert_equal(heartwood['activationheight'], 3)
assert_equal(heartwood['status'], 'pending')
canopy = upgrades[nustr(CANOPY_BRANCH_ID)]
assert_equal(canopy['name'], 'Canopy')
assert_equal(canopy['activationheight'], 5)
assert_equal(canopy['status'], 'pending')
nu5 = upgrades[nustr(NU5_BRANCH_ID)]
assert_equal(nu5['name'], 'NU5')
assert_equal(nu5['activationheight'], 5)
assert_equal(nu5['status'], 'pending')
# After the genesis block the founders' reward consumes 20% of the block
# subsidy, so the miner subsidy is 10 ZEC
assert_equal(node.getblocksubsidy()["miner"], Decimal("10"))
# Activate Blossom
node.generate(2)
bci = node.getblockchaininfo()
assert_equal(bci['blocks'], 4)
assert_equal(bci['blocks'], 3)
upgrades = bci['upgrades']
overwinter = upgrades[nustr(OVERWINTER_BRANCH_ID)]
@ -169,8 +144,8 @@ class NuparamsTest(BitcoinTestFramework):
heartwood = upgrades[nustr(HEARTWOOD_BRANCH_ID)]
assert_equal(heartwood['name'], 'Heartwood')
assert_equal(heartwood['activationheight'], 3)
assert_equal(heartwood['status'], 'active')
assert_equal(heartwood['activationheight'], 5)
assert_equal(heartwood['status'], 'pending')
canopy = upgrades[nustr(CANOPY_BRANCH_ID)]
assert_equal(canopy['name'], 'Canopy')
@ -179,10 +154,14 @@ class NuparamsTest(BitcoinTestFramework):
nu5 = upgrades[nustr(NU5_BRANCH_ID)]
assert_equal(nu5['name'], 'NU5')
assert_equal(nu5['activationheight'], 5)
assert_equal(nu5['activationheight'], 7)
assert_equal(nu5['status'], 'pending')
node.generate(1)
# Block subsidy halves at Blossom due to block time halving
assert_equal(node.getblocksubsidy()["miner"], Decimal("5"))
# Activate Heartwood & Canopy
node.generate(2)
bci = node.getblockchaininfo()
assert_equal(bci['blocks'], 5)
upgrades = bci['upgrades']
@ -204,7 +183,7 @@ class NuparamsTest(BitcoinTestFramework):
heartwood = upgrades[nustr(HEARTWOOD_BRANCH_ID)]
assert_equal(heartwood['name'], 'Heartwood')
assert_equal(heartwood['activationheight'], 3)
assert_equal(heartwood['activationheight'], 5)
assert_equal(heartwood['status'], 'active')
canopy = upgrades[nustr(CANOPY_BRANCH_ID)]
@ -214,9 +193,51 @@ class NuparamsTest(BitcoinTestFramework):
nu5 = upgrades[nustr(NU5_BRANCH_ID)]
assert_equal(nu5['name'], 'NU5')
assert_equal(nu5['activationheight'], 5)
assert_equal(nu5['activationheight'], 7)
assert_equal(nu5['status'], 'pending')
# The founders' reward ends at Canopy and there are no funding streams
# configured by default for regtest. On mainnet, the halving activated
# coincident with Canopy, but on regtest the two are independent.
assert_equal(node.getblocksubsidy()["miner"], Decimal("6.25"))
node.generate(2)
bci = node.getblockchaininfo()
assert_equal(bci['blocks'], 7)
upgrades = bci['upgrades']
overwinter = upgrades[nustr(OVERWINTER_BRANCH_ID)]
assert_equal(overwinter['name'], 'Overwinter')
assert_equal(overwinter['activationheight'], 1)
assert_equal(overwinter['status'], 'active')
sapling = upgrades[nustr(SAPLING_BRANCH_ID)]
assert_equal(sapling['name'], 'Sapling')
assert_equal(sapling['activationheight'], 1)
assert_equal(sapling['status'], 'active')
blossom = upgrades[nustr(BLOSSOM_BRANCH_ID)]
assert_equal(blossom['name'], 'Blossom')
assert_equal(blossom['activationheight'], 3)
assert_equal(blossom['status'], 'active')
heartwood = upgrades[nustr(HEARTWOOD_BRANCH_ID)]
assert_equal(heartwood['name'], 'Heartwood')
assert_equal(heartwood['activationheight'], 5)
assert_equal(heartwood['status'], 'active')
canopy = upgrades[nustr(CANOPY_BRANCH_ID)]
assert_equal(canopy['name'], 'Canopy')
assert_equal(canopy['activationheight'], 5)
assert_equal(canopy['status'], 'active')
nu5 = upgrades[nustr(NU5_BRANCH_ID)]
assert_equal(nu5['name'], 'NU5')
assert_equal(nu5['activationheight'], 7)
assert_equal(nu5['status'], 'active')
# Block subsidy remains the same after NU5
assert_equal(node.getblocksubsidy()["miner"], Decimal("6.25"))
if __name__ == '__main__':
NuparamsTest().main()

View File

@ -4,7 +4,9 @@
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, start_nodes
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_raises_message, start_nodes, \
sync_blocks, sync_mempools, wait_and_assert_operationid_status
from test_framework.mininode import COIN
from test_framework.zip317 import DEFAULT_BLOCK_UNPAID_ACTION_LIMIT, MARGINAL_FEE, ZIP_317_FEE
@ -22,12 +24,14 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
'-paytxfee=0.000001',
'-printpriority=1',
'-allowdeprecated=getnewaddress',
'-debug=mempool',
'-debug=zrpcunsafe',
]
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[
args,
args + ['-blockunpaidactionlimit=25'],
args,
args,
args + ['-txunpaidactionlimit=51'],
args + ['-txunpaidactionlimit=51', '-blockunpaidactionlimit=25'],
args + ['-txunpaidactionlimit=51'],
args + ['-txunpaidactionlimit=25'],
])
def run_test(self):
@ -36,7 +40,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
# For the first test the miner subsidy is 10 ZEC.
self.test(self.nodes[0], Decimal("10"), DEFAULT_BLOCK_UNPAID_ACTION_LIMIT)
assert_equal(152, self.nodes[0].getblockcount())
assert_equal(153, self.nodes[0].getblockcount())
# For the second test the miner subsidy is 6.25 ZEC.
# (The Founders' Reward has expired and there are no funding streams.)
@ -58,7 +62,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
return False
# Make sure we have enough mature funds on mining_node.
blocks = 100 + block_unpaid_action_limit + 1
blocks = 100 + block_unpaid_action_limit + 2
print("Mining %d blocks..." % (blocks,))
mining_node.generate(blocks)
self.sync_all()
@ -66,22 +70,35 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
node2_initial_balance = self.nodes[2].getbalance()
node3_initial_balance = self.nodes[3].getbalance()
if block_unpaid_action_limit == 50:
# Create a tx that will not be accepted to the mempool because it has
# more unpaid actions than `-txunpaidactionlimit`.
amount = miner_subsidy * (block_unpaid_action_limit + 1)
assert_equal(amount + miner_subsidy, mining_node.getbalance())
assert_raises_message(JSONRPCException, "tx unpaid action limit exceeded",
mining_node.sendtoaddress,
self.nodes[2].getnewaddress(), amount)
# Create a tx that will not be mined unless prioritised.
# We spend `block_unpaid_action_limit` mining rewards, ensuring that
# tx has exactly `block_unpaid_action_limit + 1` logical actions,
# because one extra input will be needed to pay the fee.
# Since we've set -paytxfee to pay only the relay fee rate, the fee
# Since we've set `-paytxfee` to pay only the relay fee rate, the fee
# will be less than the marginal fee, so these are all unpaid actions.
# This transaction will be relayed to nodes 1 and 2 despite being over
# the block unpaid action limit, because we set `-txunpaidactionlimit=51`
# on nodes 0, 1, and 2.
amount = miner_subsidy * block_unpaid_action_limit
assert_equal(amount + miner_subsidy, mining_node.getbalance())
assert_equal(amount + miner_subsidy*2, mining_node.getbalance())
tx = mining_node.sendtoaddress(self.nodes[2].getnewaddress(), amount)
mempool = mining_node.getrawmempool(True)
assert(tx in mempool)
assert tx in mempool, mempool
fee_zats = int(mempool[tx]['fee'] * COIN)
assert(fee_zats < MARGINAL_FEE)
assert fee_zats < MARGINAL_FEE, fee_zats
tx_verbose = mining_node.getrawtransaction(tx, 1)
assert_equal(block_unpaid_action_limit + 1, len(tx_verbose['vin']))
# TODO after #6676: assert_equal(block_unpaid_action_limit + 1, tx_verbose['unpaidActions'])
# Check that tx is not in a new block template prior to prioritisation.
block_template = mining_node.getblocktemplate()
@ -92,18 +109,35 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
# We use z_sendmany so that it will pay the conventional fee (ignoring -paytxfee)
# and not take up an unpaid action.
recipients = [{'address': self.nodes[3].getnewaddress(), 'amount': Decimal("0.1")}]
mining_node.z_sendmany('ANY_TADDR', recipients, 0, ZIP_317_FEE, 'AllowFullyTransparent')
opid = mining_node.z_sendmany('ANY_TADDR', recipients, 0, ZIP_317_FEE, 'AllowFullyTransparent')
wait_and_assert_operationid_status(mining_node, opid)
def sync_and_check():
sync_blocks(self.nodes)
sync_mempools(self.nodes[:3])
time.sleep(1)
sync_mempools(self.nodes[3:])
# tx should not have been accepted to node3's mempool because that node has
# `-txunpaidactionlimit=25`, which is less than `block_unpaid_action_limit + 1`.
assert 25 < block_unpaid_action_limit + 1
mempool = self.nodes[3].getrawmempool(True)
assert tx not in mempool, mempool
# Prioritising it on node 2 has no effect on mining_node.
self.sync_all()
sync_and_check()
priority_success = self.nodes[2].prioritisetransaction(tx, 0, MARGINAL_FEE)
assert(priority_success)
mempool = self.nodes[2].getrawmempool(True)
assert_equal(fee_zats + MARGINAL_FEE, mempool[tx]['modifiedfee'] * COIN)
self.sync_all()
sync_and_check()
send_fully_paid_transaction()
assert_equal(eventually_in_template(tx), False)
# Putting a non-zero value in the obsolete "priority" field causes an error.
assert_raises_message(JSONRPCException, "Priority is not supported",
self.nodes[2].prioritisetransaction, tx, 1, 0)
# Now prioritise it on mining_node, but short by one zatoshi.
priority_success = mining_node.prioritisetransaction(tx, 0, MARGINAL_FEE - fee_zats - 1)
assert(priority_success)
@ -113,8 +147,9 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
assert_equal(eventually_in_template(tx), False)
# Finally, prioritise it on mining_node by the one extra zatoshi (this also checks
# that prioritisation is cumulative).
priority_success = mining_node.prioritisetransaction(tx, 0, 1)
# that prioritisation is cumulative, and that null is accepted for the "priority"
# field).
priority_success = mining_node.prioritisetransaction(tx, None, 1)
assert(priority_success)
mempool = mining_node.getrawmempool(True)
assert_equal(MARGINAL_FEE, mempool[tx]['modifiedfee'] * COIN)
@ -133,7 +168,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
blk_hash = mining_node.generate(1)
block = mining_node.getblock(blk_hash[0])
assert_equal(tx in block['tx'], True)
self.sync_all()
sync_and_check()
# Check that tx was mined and that node 1 received the funds.
mempool = mining_node.getrawmempool()

View File

@ -5,7 +5,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
start_nodes,
wait_and_assert_operationid_status,
)
@ -33,7 +33,7 @@ class RegtestSignrawtransactionTest (BitcoinTestFramework):
opid = self.nodes[1].z_sendmany(
taddr,
[{'address': zaddr1, 'amount': 1}],
1, DEFAULT_FEE, 'AllowFullyTransparent')
1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
wait_and_assert_operationid_status(self.nodes[1], opid)
if __name__ == '__main__':

View File

@ -428,7 +428,7 @@ Debugging/Testing options:
Output debugging information (default: 0, supplying <category> is
optional). If <category> is not supplied or if <category> = 1, output
all debugging information. <category> can be: addrman, alert, bench,
coindb, db, estimatefee, http, libevent, lock, mempool, mempoolrej, net,
coindb, db, http, libevent, lock, mempool, mempoolrej, net,
partitioncheck, pow, proxy, prune, rand, receiveunsafe, reindex, rpc,
selectcoins, tor, zmq, zrpc, zrpcunsafe (implies zrpc). For multiple
specific categories use -debug=<category> multiple times.
@ -496,10 +496,14 @@ Node relay options:
-datacarrier
Relay and mine data carrier transactions (default: 1)
-datacarriersize
-datacarriersize=<n>
Maximum size of data in data carrier transactions we relay and mine
(default: 83)
-txunpaidactionlimit=<n>
Transactions with more than this number of unpaid actions will not be
accepted to the mempool or relayed (default: 50)
Block creation options:
-blockmaxsize=<n>

View File

@ -3,7 +3,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
BLOSSOM_BRANCH_ID,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
assert_equal,
assert_true,
initialize_chain_clean,
@ -49,7 +49,7 @@ class SignOfflineTest (BitcoinTestFramework):
create_inputs = [{'txid': txid, 'vout': 0}]
sign_inputs = [{'txid': txid, 'vout': 0, 'scriptPubKey': scriptpubkey, 'amount': 10}]
create_hex = self.nodes[0].createrawtransaction(create_inputs, {taddr: Decimal('10.0') - DEFAULT_FEE})
create_hex = self.nodes[0].createrawtransaction(create_inputs, {taddr: Decimal('10.0') - LEGACY_DEFAULT_FEE})
# An offline regtest node does not rely on the approx release height of the software
# to determine the consensus rules to be used for signing.

View File

@ -1,266 +0,0 @@
#!/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 .
#
# Test fee estimation code
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import start_node, connect_nodes, \
sync_blocks, sync_mempools
import random
from decimal import Decimal, ROUND_DOWN
# Construct 2 trivial P2SH's and the ScriptSigs that spend them
# So we can create many transactions without needing to spend
# time signing.
P2SH_1 = "2MySexEGVzZpRgNQ1JdjdP5bRETznm3roQ2" # P2SH of "OP_1 OP_DROP"
P2SH_2 = "2NBdpwq8Aoo1EEKEXPNrKvr5xQr3M9UfcZA" # P2SH of "OP_2 OP_DROP"
# Associated ScriptSig's to spend satisfy P2SH_1 and P2SH_2
# 4 bytes of OP_TRUE and push 2-byte redeem script of "OP_1 OP_DROP" or "OP_2 OP_DROP"
SCRIPT_SIG = ["0451025175", "0451025275"]
def satoshi_round(amount):
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee_increment):
'''
Create and send a transaction with a random fee.
The transaction pays to a trivial P2SH script, and assumes that its inputs
are of the same form.
The function takes a list of confirmed outputs and unconfirmed outputs
and attempts to use the confirmed list first for its inputs.
It adds the newly created outputs to the unconfirmed list.
Returns (raw transaction, fee)
'''
# It's best to exponentially distribute our random fees
# because the buckets are exponentially spaced.
# Exponentially distributed from 1-128 * fee_increment
rand_fee = float(fee_increment)*(1.1892**random.randint(0,28))
# Total fee ranges from min_fee to min_fee + 127*fee_increment
fee = min_fee - fee_increment + satoshi_round(rand_fee)
inputs = []
total_in = Decimal("0.00000000")
while total_in <= (amount + fee) and len(conflist) > 0:
t = conflist.pop(0)
total_in += t["amount"]
inputs.append({ "txid" : t["txid"], "vout" : t["vout"]} )
if total_in <= amount + fee:
while total_in <= (amount + fee) and len(unconflist) > 0:
t = unconflist.pop(0)
total_in += t["amount"]
inputs.append({ "txid" : t["txid"], "vout" : t["vout"]} )
if total_in <= amount + fee:
raise RuntimeError("Insufficient funds: need %d, have %d"%(amount+fee, total_in))
outputs = {}
outputs[P2SH_1] = total_in - amount - fee
outputs[P2SH_2] = amount
rawtx = from_node.createrawtransaction(inputs, outputs)
# Createrawtransaction constructions a transaction that is ready to be signed
# These transactions don't need to be signed, but we still have to insert the ScriptSig
# that will satisfy the ScriptPubKey.
completetx = rawtx[0:10]
inputnum = 0
for inp in inputs:
completetx += rawtx[10+82*inputnum:82+82*inputnum]
completetx += SCRIPT_SIG[inp["vout"]]
completetx += rawtx[84+82*inputnum:92+82*inputnum]
inputnum += 1
completetx += rawtx[10+82*inputnum:]
txid = from_node.sendrawtransaction(completetx, True)
unconflist.append({ "txid" : txid, "vout" : 0 , "amount" : total_in - amount - fee})
unconflist.append({ "txid" : txid, "vout" : 1 , "amount" : amount})
return (completetx, fee)
def split_inputs(from_node, txins, txouts, initial_split = False):
"""
We need to generate a lot of inputs so we can generate a ton of transactions.
This function takes an input from txins, and creates and sends a transaction
which splits the value into 2 outputs which are appended to txouts.
Previously this was designed to be small inputs so they wouldn't have
a high coin age when the notion of priority still existed.
"""
prevtxout = txins.pop()
inputs = []
outputs = {}
inputs.append({ "txid" : prevtxout["txid"], "vout" : prevtxout["vout"] })
half_change = satoshi_round(prevtxout["amount"]/2)
rem_change = prevtxout["amount"] - half_change - Decimal("0.00001000")
outputs[P2SH_1] = half_change
outputs[P2SH_2] = rem_change
rawtx = from_node.createrawtransaction(inputs, outputs)
# If this is the initial split we actually need to sign the transaction
# Otherwise we just need to insert the property ScriptSig
if (initial_split) :
completetx = from_node.signrawtransaction(rawtx)["hex"]
else :
completetx = rawtx[0:82] + SCRIPT_SIG[prevtxout["vout"]] + rawtx[84:]
txid = from_node.sendrawtransaction(completetx, True)
txouts.append({ "txid" : txid, "vout" : 0 , "amount" : half_change})
txouts.append({ "txid" : txid, "vout" : 1 , "amount" : rem_change})
def check_estimates(node, fees_seen, max_invalid, print_estimates = True):
'''
This function calls estimatefee and verifies that the estimates
meet certain invariants.
'''
all_estimates = [ node.estimatefee(i) for i in range(1,26) ]
if print_estimates:
print([str(all_estimates[e-1]) for e in [1,2,3,6,15,25]])
delta = 1.0e-6 # account for rounding error
last_e = max(fees_seen)
for e in [x for x in all_estimates if x >= 0]:
# Estimates should be within the bounds of what transactions fees actually were:
if float(e)+delta < min(fees_seen) or float(e)-delta > max(fees_seen):
raise AssertionError("Estimated fee (%f) out of range (%f,%f)"
%(float(e), min(fees_seen), max(fees_seen)))
# Estimates should be monotonically decreasing
if float(e)-delta > last_e:
raise AssertionError("Estimated fee (%f) larger than last fee (%f) for lower number of confirms"
%(float(e),float(last_e)))
last_e = e
valid_estimate = False
invalid_estimates = 0
for e in all_estimates:
if e >= 0:
valid_estimate = True
else:
invalid_estimates += 1
# Once we're at a high enough confirmation count that we can give an estimate
# We should have estimates for all higher confirmation counts
if valid_estimate and e < 0:
raise AssertionError("Invalid estimate appears at higher confirm count than valid estimate")
# Check on the expected number of different confirmation counts
# that we might not have valid estimates for
if invalid_estimates > max_invalid:
raise AssertionError("More than (%d) invalid estimates"%(max_invalid))
return all_estimates
class EstimateFeeTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
def setup_network(self):
'''
We'll setup the network to have 3 nodes that all mine with different parameters.
But first we need to use one node to create a lot of outputs
which we will use to generate our transactions.
'''
self.nodes = []
# Use node0 to mine blocks for input splitting
self.nodes.append(start_node(0, self.options.tmpdir, ["-maxorphantx=1000",
"-whitelist=127.0.0.1"]))
print("This test is time consuming, please be patient")
print("Splitting inputs so we can generate tx's")
self.txouts = []
self.txouts2 = []
# Split a coinbase into two transaction puzzle outputs
split_inputs(self.nodes[0], self.nodes[0].listunspent(0), self.txouts, True)
# Mine
while (len(self.nodes[0].getrawmempool()) > 0):
self.nodes[0].generate(1)
# Repeatedly split those 2 outputs, doubling twice for each rep
# Use txouts to monitor the available utxo, since these won't be tracked in wallet
reps = 0
while (reps < 5):
#Double txouts to txouts2
while (len(self.txouts)>0):
split_inputs(self.nodes[0], self.txouts, self.txouts2)
while (len(self.nodes[0].getrawmempool()) > 0):
self.nodes[0].generate(1)
#Double txouts2 to txouts
while (len(self.txouts2)>0):
split_inputs(self.nodes[0], self.txouts2, self.txouts)
while (len(self.nodes[0].getrawmempool()) > 0):
self.nodes[0].generate(1)
reps += 1
print("Finished splitting")
# Now we can connect the other nodes, didn't want to connect them earlier
# so the estimates would not be affected by the splitting transactions
# Node1 mines small blocks but that are bigger than the expected transaction rate.
# NOTE: the CreateNewBlock code starts counting block size at 1,000 bytes,
# (17k is room enough for 110 or so transactions)
self.nodes.append(start_node(1, self.options.tmpdir,
["-blockmaxsize=18000", "-maxorphantx=1000", "-debug=estimatefee"]))
connect_nodes(self.nodes[1], 0)
# Node2 is a stingy miner, that
# produces too small blocks (room for only 70 or so transactions)
node2args = ["-blockmaxsize=12000", "-maxorphantx=1000"]
self.nodes.append(start_node(2, self.options.tmpdir, node2args))
connect_nodes(self.nodes[0], 2)
connect_nodes(self.nodes[2], 1)
self.is_network_split = False
self.sync_all()
def transact_and_mine(self, numblocks, mining_node):
min_fee = Decimal("0.00001")
# We will now mine numblocks blocks generating on average 100 transactions between each block
# We shuffle our confirmed txout set before each set of transactions
# small_txpuzzle_randfee will use the transactions that have inputs already in the chain when possible
# resorting to tx's that depend on the mempool when those run out
for i in range(numblocks):
random.shuffle(self.confutxo)
for j in range(random.randrange(100-50,100+50)):
from_index = random.randint(1,2)
(txhex, fee) = small_txpuzzle_randfee(self.nodes[from_index], self.confutxo,
self.memutxo, Decimal("0.005"), min_fee, min_fee)
tx_kbytes = (len(txhex) // 2) / 1000.0
self.fees_per_kb.append(float(fee)/tx_kbytes)
sync_mempools(self.nodes[0:3],.1)
mined = mining_node.getblock(mining_node.generate(1)[0],True)["tx"]
sync_blocks(self.nodes[0:3],.1)
#update which txouts are confirmed
newmem = []
for utx in self.memutxo:
if utx["txid"] in mined:
self.confutxo.append(utx)
else:
newmem.append(utx)
self.memutxo = newmem
def run_test(self):
self.fees_per_kb = []
self.memutxo = []
self.confutxo = self.txouts # Start with the set of confirmed txouts after splitting
print("Checking estimates for 1/2/3/6/15/25 blocks")
print("Creating transactions and mining them with a huge block size")
# Create transactions and mine 20 big blocks with node 0 such that the mempool is always emptied
self.transact_and_mine(30, self.nodes[0])
check_estimates(self.nodes[1], self.fees_per_kb, 1)
print("Creating transactions and mining them with a block size that can't keep up")
# Create transactions and mine 30 small blocks with node 2, but create txs faster than we can mine
self.transact_and_mine(20, self.nodes[2])
check_estimates(self.nodes[1], self.fees_per_kb, 3)
print("Creating transactions and mining them at a block size that is just big enough")
# Generate transactions while mining 40 more blocks, this time with node1
# which mines blocks with capacity just above the rate that transactions are being created
self.transact_and_mine(40, self.nodes[1])
check_estimates(self.nodes[1], self.fees_per_kb, 2)
# Finish by mining a normal-sized block:
while len(self.nodes[1].getrawmempool()) > 0:
self.nodes[1].generate(1)
sync_blocks(self.nodes[0:3],.1)
print("Final estimates after emptying mempools")
check_estimates(self.nodes[1], self.fees_per_kb, 2)
if __name__ == '__main__':
EstimateFeeTest().main()

View File

@ -7,7 +7,7 @@ from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_true, \
start_nodes, \
wait_and_assert_operationid_status_result, DEFAULT_FEE
wait_and_assert_operationid_status_result, LEGACY_DEFAULT_FEE
SAPLING_ADDR = 'zregtestsapling1ssqj3f3majnl270985gqcdqedd9t4nlttjqskccwevj2v20sc25deqspv3masufnwcdy67cydyy'
SAPLING_KEY = 'secret-extended-key-regtest1qv62zt2fqyqqpqrh2qzc08h7gncf4447jh9kvnnnhjg959fkwt7mhw9j8e9at7attx8z6u3953u86vcnsujdc2ckdlcmztjt44x3uxpah5mxtncxd0mqcnz9eq8rghh5m4j44ep5d9702sdvvwawqassulktfegrcp4twxgqdxx4eww3lau0mywuaeztpla2cmvagr5nj98elt45zh6fjznadl6wz52n2uyhdwcm2wlsu8fnxstrk6s4t55t8dy6jkgx5g0cwpchh5qffp8x5'
@ -127,7 +127,7 @@ class SproutSaplingMigration(BitcoinTestFramework):
# Check that unmigrated amount + unfinalized = starting balance - fee
status = node.z_getmigrationstatus()
print("status: {}".format(status))
assert_equal(sprout_initial_balance - DEFAULT_FEE, Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount']))
assert_equal(sprout_initial_balance - LEGACY_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.
@ -146,7 +146,7 @@ class SproutSaplingMigration(BitcoinTestFramework):
print("sprout balance: {}, sapling balance: {}".format(sprout_balance, sapling_balance))
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, sprout_initial_balance - DEFAULT_FEE)
assert_true(sprout_balance + sapling_balance, sprout_initial_balance - LEGACY_DEFAULT_FEE)
check_migration_status(node, saplingAddr, DURING_MIGRATION)
# At 10 % 500 the transactions will be considered 'finalized'

View File

@ -31,8 +31,7 @@ from .authproxy import AuthServiceProxy, JSONRPCException
ZCASHD_BINARY = os.path.join('src', 'zcashd')
DEFAULT_FEE = Decimal('0.00001')
DEFAULT_FEE_ZATS = 1000
LEGACY_DEFAULT_FEE = Decimal('0.00001')
COVERAGE_DIR = None
PRE_BLOSSOM_BLOCK_TARGET_SPACING = 150
@ -315,7 +314,6 @@ def initialize_chain(test_dir, num_nodes, cachedir, cache_behavior='current'):
os.remove(node_file(cachedir, i, "debug.log"))
os.remove(node_file(cachedir, i, "db.log"))
os.remove(node_file(cachedir, i, "peers.dat"))
os.remove(node_file(cachedir, i, "fee_estimates.dat"))
def init_from_cache():
for i in range(num_nodes):
@ -329,18 +327,37 @@ def initialize_chain(test_dir, num_nodes, cachedir, cache_behavior='current'):
# overwrite port/rpcport and clock offset in zcash.conf
initialize_datadir(test_dir, i, clock_offset=offset)
def init_sprout():
def init_persistent(cache_behavior):
assert num_nodes <= 4 # only 4 nodes with Sprout funds are supported
sprout_cache_path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'cache', 'sprout')
cache_path = persistent_cache_path(cache_behavior)
if not os.path.isdir(cache_path):
raise Exception('No cache available for cache behavior %s' % cache_behavior)
chain_cache_filename = os.path.join(cache_path, "chain_cache.tar.gz")
if not os.path.exists(chain_cache_filename):
raise Exception('Chain cache missing for cache behavior %s' % cache_behavior)
for i in range(num_nodes):
to_dir = os.path.join(test_dir, "node"+str(i), "regtest")
os.makedirs(to_dir)
# Unzip the persisted Sprout config file
with tarfile.open(os.path.join(sprout_cache_path, "chain_cache.tar.gz"), "r:gz") as tgz:
tgz.extractall(path = to_dir)
with tarfile.open(os.path.join(sprout_cache_path, "node"+str(i)+"_wallet.tar.gz"), "r:gz") as tgz:
tgz.extractall(path = os.path.join(to_dir, "wallet.dat"))
with open(os.path.join(to_dir, 'cache_config.json'), "r", encoding="utf8") as cache_conf_file:
# Copy the same chain data to all nodes
with tarfile.open(chain_cache_filename, "r:gz") as chain_cache_file:
chain_cache_file.extractall(path = to_dir)
# Copy in per-node wallet data
wallet_tgz_filename = os.path.join(cache_path, "node"+str(i)+"_wallet.tar.gz")
if not os.path.exists(wallet_tgz_filename):
raise Exception('Wallet cache missing for cache behavior %s, node %d' % (cache_behavior, i))
with tarfile.open(wallet_tgz_filename, "r:gz") as wallet_tgz_file:
wallet_tgz_file.extractall(path = os.path.join(to_dir, "wallet.dat"))
# Copy in per-node wallet config and update zcash.conf to set the
# clock offsets correctly.
cache_conf_filename = os.path.join(to_dir, 'cache_config.json')
if not os.path.exists(cache_conf_filename):
raise Exception('Cache config missing for cache behavior %s, node %d' % (cache_behavior, i))
with open(cache_conf_filename, "r", encoding="utf8") as cache_conf_file:
cache_conf = json.load(cache_conf_file)
# obtain the clock offset as a negative number of seconds
offset = round(cache_conf['cache_time']) - round(time.time())
@ -360,16 +377,13 @@ def initialize_chain(test_dir, num_nodes, cachedir, cache_behavior='current'):
if cache_behavior == 'current':
if cache_rebuild_required(): rebuild_cache()
init_from_cache()
elif cache_behavior == 'sprout':
init_sprout()
elif cache_behavior == 'fresh':
rebuild_cache()
init_from_cache()
elif cache_behavior == 'clean':
initialize_chain_clean(test_dir, num_nodes)
else:
raise Exception('Cache behavior %s not recognized' % cache_behavior)
init_persistent(cache_behavior)
def initialize_chain_clean(test_dir, num_nodes):
"""
@ -379,6 +393,66 @@ def initialize_chain_clean(test_dir, num_nodes):
for i in range(num_nodes):
initialize_datadir(test_dir, i)
def persistent_cache_path(cache_behavior):
return os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'cache',
cache_behavior
)
def persistent_cache_exists(cache_behavior):
cache_path = persistent_cache_path(cache_behavior)
return os.path.isdir(cache_path)
# Clean up, zip, and persist the generated datadirs. Record the generation
# time so that we can correctly set the system clock offset in tests that
# restore their node states using the resulting files.
def persist_node_caches(tmpdir, cache_behavior, num_nodes):
cache_path = persistent_cache_path(cache_behavior)
if os.path.exists(cache_path):
raise Exception('Cache already exists for cache behavior %s' % cache_behavior)
os.mkdir(cache_path)
for i in range(num_nodes):
node_path = os.path.join(tmpdir, 'node' + str(i), 'regtest')
# Clean up the files that we don't want to persist
os.remove(os.path.join(node_path, 'debug.log'))
os.remove(os.path.join(node_path, 'db.log'))
os.remove(os.path.join(node_path, 'peers.dat'))
# Persist the wallet file for the node to the cache
wallet_tgz_filename = os.path.join(cache_path, 'node' + str(i) + '_wallet.tar.gz')
with tarfile.open(wallet_tgz_filename, "w:gz") as wallet_tgz_file:
wallet_tgz_file.add(os.path.join(node_path, 'wallet.dat'), arcname="")
# Persist the chain data and cache config just once; it will be reused
# for all of the nodes when loading from the cache.
if i == 0:
# Move the wallet.dat file out of the way so that it doesn't
# pollute the chain cache tarfile
shutil.move(
os.path.join(node_path, 'wallet.dat'),
os.path.join(tmpdir, 'wallet.dat.0'))
# Store the current time so that we can correctly set the clock
# offset when restoring from the cache.
cache_config = { "cache_time": time.time() }
cache_conf_filename = os.path.join(cache_path, 'cache_config.json')
with open(cache_conf_filename, "w", encoding="utf8") as cache_conf_file:
cache_conf_json = json.dumps(cache_config, indent=4)
cache_conf_file.write(cache_conf_json)
# Persist the chain data.
chain_cache_filename = os.path.join(cache_path, 'chain_cache.tar.gz')
with tarfile.open(chain_cache_filename, "w:gz") as chain_cache_file:
chain_cache_file.add(node_path, arcname="")
# Move the wallet file back into place
shutil.move(
os.path.join(tmpdir, 'wallet.dat.0'),
os.path.join(node_path, 'wallet.dat'))
def _rpchost_to_args(rpchost):
'''Convert optional IP:port spec to rpcconnect/rpcport args'''

View File

@ -9,7 +9,7 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, \
initialize_datadir, start_nodes, start_node, connect_nodes_bi, \
bitcoind_processes, wait_and_assert_operationid_status, \
get_coinbase_address, DEFAULT_FEE
get_coinbase_address, LEGACY_DEFAULT_FEE
from decimal import Decimal
@ -68,8 +68,8 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
# Send 10 coins to our zaddr.
recipients = []
recipients.append({"address":myzaddr, "amount":Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address":myzaddr, "amount":Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.nodes[0].generate(1)
@ -82,7 +82,7 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
# Confirm the balance on node 0.
resp = self.nodes[0].z_getbalance(myzaddr)
assert_equal(Decimal(resp), Decimal('10.0') - DEFAULT_FEE)
assert_equal(Decimal(resp), Decimal('10.0') - LEGACY_DEFAULT_FEE)
# Export the key for the zaddr from node 0.
key = self.nodes[0].z_exportkey(myzaddr)
@ -109,7 +109,7 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
# Confirm that the balance on node 1 is valid now (node 1 must
# have rescanned)
resp = self.nodes[1].z_getbalance(myzaddr)
assert_equal(Decimal(resp), Decimal('10.0') - DEFAULT_FEE)
assert_equal(Decimal(resp), Decimal('10.0') - LEGACY_DEFAULT_FEE)
if __name__ == '__main__':

View File

@ -7,7 +7,7 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, \
start_nodes, stop_nodes, connect_nodes_bi, \
wait_and_assert_operationid_status, wait_bitcoinds, get_coinbase_address, \
sync_blocks, sync_mempools, DEFAULT_FEE
sync_blocks, sync_mempools, LEGACY_DEFAULT_FEE
from decimal import Decimal
class WalletAnchorForkTest (BitcoinTestFramework):
@ -52,8 +52,8 @@ class WalletAnchorForkTest (BitcoinTestFramework):
mytaddr0 = get_coinbase_address(self.nodes[0])
myzaddr0 = self.nodes[0].z_getnewaddress()
recipients = []
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Sync up mempools and mine the transaction. All nodes have the same anchor.
@ -76,8 +76,8 @@ class WalletAnchorForkTest (BitcoinTestFramework):
# Partition A, node 0 creates a joinsplit transaction
recipients = []
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
txid = wait_and_assert_operationid_status(self.nodes[0], myopid)
rawhex = self.nodes[0].getrawtransaction(txid)

View File

@ -6,6 +6,7 @@
import shutil
import os.path
from test_framework.mininode import COIN
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
NU5_BRANCH_ID,
@ -44,7 +45,9 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
ua1 = addrRes1['address']
# Create a note matching recipient_type on node 1
recipients = [{"address": ua1, "amount": 10}]
original_zec_amount = 10
recipients = [{"address": ua1, "amount": original_zec_amount}]
original_amount = original_zec_amount * COIN
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
@ -54,7 +57,7 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# Check the value sent to ua1 was received
assert_equal(
{'pools': {recipient_type: {'valueZat': 1000000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': original_amount}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
# Shut down the nodes
@ -64,7 +67,7 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# Copy node 1's wallet to node 2
tmpdir = self.options.tmpdir
shutil.copyfile(
os.path.join(tmpdir, "node1", "regtest", "wallet.dat"),
os.path.join(tmpdir, "node1", "regtest", "wallet.dat"),
os.path.join(tmpdir, "node2", "regtest", "wallet.dat"))
# Restart with the network split
@ -72,21 +75,27 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# Verify the balance on node 1
assert_equal(
{'pools': {recipient_type: {'valueZat': 1000000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': original_amount}},
'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
# Verify the balance on node 2, on the other side of the split
assert_equal(
{'pools': {recipient_type: {'valueZat': 1000000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': original_amount}},
'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct1))
# Spend the note from node 1
recipients = [{"address": ua0a, "amount": 1}]
node1_zec_spend_amount = 1
recipients = [{"address": ua0a, "amount": node1_zec_spend_amount}]
node1_spend_amount = node1_zec_spend_amount * COIN
myopid = self.nodes[1].z_sendmany(ua1, recipients, 1, 0)
txa_id = wait_and_assert_operationid_status(self.nodes[1], myopid)
# Spend the note from node 2
recipients = [{"address": ua0b, "amount": 2}]
node2_zec_spend_amount = 2
recipients = [{"address": ua0b, "amount": node2_zec_spend_amount}]
node2_spend_amount = node2_zec_spend_amount * COIN
myopid = self.nodes[2].z_sendmany(ua1, recipients, 1, 0)
txb_id = wait_and_assert_operationid_status(self.nodes[2], myopid)
@ -98,11 +107,13 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# the remaining balance is visible on both sides of the split
assert_equal(
{'pools': {recipient_type: {'valueZat': 900000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': original_amount - node1_spend_amount}},
'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
assert_equal(
{'pools': {recipient_type: {'valueZat': 800000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': original_amount - node2_spend_amount}},
'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct1))
# before re-joining the network, there is no recognition of the conflict
@ -115,7 +126,7 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# acct0a will have received the transaction; it can't see node 2's send
assert_equal(
{'pools': {recipient_type: {'valueZat': 100000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': node1_spend_amount}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0a))
self.join_network()
@ -128,19 +139,22 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
assert_equal([txb_id], txa['walletconflicts']);
assert_equal([txa_id], txb['walletconflicts']);
# After the reorg, node 2 wins, so its balance is the consensus for
# After the reorg, node 2 wins, so its balance is the consensus for
# both wallets
assert_equal(
{'pools': {recipient_type: {'valueZat': 800000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': original_amount - node2_spend_amount}},
'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
assert_equal(
{'pools': {recipient_type: {'valueZat': 800000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': original_amount - node2_spend_amount}},
'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct1))
# acct0b will have received the transaction
assert_equal(
{'pools': {recipient_type: {'valueZat': 200000000}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': node2_spend_amount}},
'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0b))
# acct0a's note was un-mined

View File

@ -0,0 +1,253 @@
#!/usr/bin/env python3
#
# Copyright (c) 2023 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
NU5_BRANCH_ID,
assert_equal,
get_coinbase_address,
nuparams,
start_nodes,
stop_nodes,
wait_bitcoinds,
wait_and_assert_operationid_status,
persistent_cache_exists,
persist_node_caches,
)
from decimal import Decimal
class WalletGoldenV5_6_0Test(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
# Start from the cache if it exists
if persistent_cache_exists('golden-v5.6.0'):
self.cache_behavior = 'golden-v5.6.0'
def setup_nodes(self):
default_extra_args = [
nuparams(NU5_BRANCH_ID, 201),
# The following was required for correct persistence of updated wallet state,
# but not required for subsequent test runs.
#"-regtestwalletsetbestchaineveryblock",
]
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[
default_extra_args,
default_extra_args,
default_extra_args,
default_extra_args + ["-mineraddress=uregtest124msndx0mcxnjx7l9vxjswqeear2nvp3sg8u6uuvmxxnfmvmxkyjnx4qkxasfszez8m5z9trsgva0s6rzxn4fx96wf0lphfj0yu9s63w",
"-minetolocalwallet=0"] # this address doesn't exist in node 3's wallet at the time of node start
])
def run_test(self):
# Establish the persistent cache state before running the main behavior
# of the test.
if self.cache_behavior != 'golden-v5.6.0':
# Sanity-check the test harness
assert_equal(self.nodes[0].getblockcount(), 200)
# Activate nu5
self.nodes[0].generate(1)
self.sync_all()
# Set up an Orchard account on node 0
n0account0 = self.nodes[0].z_getnewaccount()['account']
assert(n0account0 == 0)
n0ua0_0 = self.nodes[0].z_getaddressforaccount(n0account0, ['orchard'], 0)['address']
assert_equal(
{'pools': {}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(n0account0))
# Fund the Orchard wallet on node 0 from Node 2 coinbase
n2taddr = get_coinbase_address(self.nodes[2])
recipients = [{"address": n0ua0_0, 'amount': Decimal('9.99985')}]
# TODO: since we can't have transparent change, this should only require
# `AllowRevealedSenders`
opid = self.nodes[2].z_sendmany(n2taddr, recipients, 1, None, 'AllowFullyTransparent')
wait_and_assert_operationid_status(self.nodes[2], opid)
self.nodes[2].generate(1)
self.sync_all()
assert_equal(
{
'pools': {'orchard': {'valueZat': Decimal('999985000')}},
'minimum_confirmations': 1
},
self.nodes[0].z_getbalanceforaccount(n0account0))
# Send funds from Orchard on node 0 to Orchard on node 2
n2account0 = self.nodes[2].z_getnewaccount()['account']
assert(n2account0 == 0)
n2ua0_0 = self.nodes[2].z_getaddressforaccount(n2account0, ['orchard'], 0)['address']
assert_equal(
{'pools': {}, 'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(n2account0))
recipients = [{"address":n2ua0_0, "amount": Decimal('5.0')}]
opid = self.nodes[0].z_sendmany(n0ua0_0, recipients, 1)
wait_and_assert_operationid_status(self.nodes[0], opid)
self.nodes[0].generate(1)
self.sync_all()
assert_equal(
{
'pools': {'orchard': {'valueZat': Decimal('499975000')}},
'minimum_confirmations': 1
},
self.nodes[0].z_getbalanceforaccount(n0account0))
# Set up a second account and a couple more addresses on node 0 &
# send the funds back and forth to establish more note commitment
# tree structure.
n0ua0_1 = self.nodes[0].z_getaddressforaccount(n0account0, ['orchard'], 1)['address']
n0account1 = self.nodes[0].z_getnewaccount()['account']
assert(n0account1 == 1)
n0ua1_0 = self.nodes[0].z_getaddressforaccount(n0account1, ['orchard'], 0)['address']
# We space out transactions at 15 block increments so that some of the
# oldest checkpoints get dropped.
for i in range(10):
if i % 2 == 0:
recipients = [
{"address": n0ua0_0, "amount": Decimal('0.1')},
{"address": n0ua0_1, "amount": Decimal('0.2')},
{"address": n0ua1_0, "amount": Decimal('0.3')},
]
opid = self.nodes[2].z_sendmany(n2ua0_0, recipients, 1)
wait_and_assert_operationid_status(self.nodes[2], opid)
self.nodes[2].generate(15)
self.sync_all()
else:
recipients = [{"address": n2ua0_0, "amount": Decimal('0.7')}]
opid = self.nodes[0].z_sendmany(n0ua0_0, recipients, 1)
wait_and_assert_operationid_status(self.nodes[0], opid)
self.nodes[0].generate(15)
self.sync_all()
# Shut down the nodes
stop_nodes(self.nodes)
wait_bitcoinds()
# persist the node state to the cache
persist_node_caches(self.options.tmpdir, 'golden-v5.6.0', 4)
# Restart the network
self.setup_network()
tarnish = False
if tarnish:
# We need to add another Orchard note to the note commitment tree. The mineraddress used when starting
# node 3 is the default address for account 0, so here we just mine a block to shielded coinbase to
# add another Orchard note commitment.
n3account0 = self.nodes[3].z_getnewaccount()['account']
n3ua0_0 = self.nodes[3].z_getaddressforaccount(n3account0, ['orchard'], 0)['address']
assert_equal(n3ua0_0, "uregtest124msndx0mcxnjx7l9vxjswqeear2nvp3sg8u6uuvmxxnfmvmxkyjnx4qkxasfszez8m5z9trsgva0s6rzxn4fx96wf0lphfj0yu9s63w");
self.nodes[3].generate(1)
self.sync_all()
# Shut down the nodes
stop_nodes(self.nodes)
wait_bitcoinds()
# persist the node state to the cache
persist_node_caches(self.options.tmpdir, 'tarnished-v5.6.0', 4)
else:
golden_check_spendability(self, 0)
def golden_check_spendability(test_instance, block_offset):
# Since the cache has already been loaded, reproduce the previously-derived
# addresses.
n0account0 = 0
n0ua0_0 = test_instance.nodes[0].z_getaddressforaccount(n0account0, ['orchard'], 0)['address']
n0ua0_1 = test_instance.nodes[0].z_getaddressforaccount(n0account0, ['orchard'], 1)['address']
n0account1 = 1
n0ua1_0 = test_instance.nodes[0].z_getaddressforaccount(n0account1, ['orchard'], 0)['address']
n2account0 = 0
n2ua0_0 = test_instance.nodes[2].z_getaddressforaccount(n2account0, ['orchard'], 0)['address']
# Sanity-check the test harness
assert_equal(test_instance.nodes[0].getblockcount(), 353 + block_offset)
assert_equal(
{
'pools': {'orchard': {'valueZat': Decimal(499975000 + (5 * 30000000) - (5 * 70010000))}},
'minimum_confirmations': 1
},
test_instance.nodes[0].z_getbalanceforaccount(n0account0))
assert_equal(
{
'pools': {'orchard': {'valueZat': Decimal(5 * 30000000)}},
'minimum_confirmations': 1
},
test_instance.nodes[0].z_getbalanceforaccount(n0account1))
assert_equal(
{
'pools': {'orchard': {'valueZat': Decimal(500000000 + (5 * 70000000) - (5 * 60020000))}},
'minimum_confirmations': 1
},
test_instance.nodes[2].z_getbalanceforaccount(n2account0))
# Send a bunch of notes back and forth again.
for i in range(10):
if i % 2 == 0:
recipients = [
{"address": n0ua0_0, "amount": Decimal('0.1')},
{"address": n0ua0_1, "amount": Decimal('0.2')},
{"address": n0ua1_0, "amount": Decimal('0.3')},
]
opid = test_instance.nodes[2].z_sendmany(n2ua0_0, recipients, 1)
wait_and_assert_operationid_status(test_instance.nodes[2], opid)
test_instance.nodes[2].generate(1)
test_instance.sync_all()
else:
recipients = [{"address": n2ua0_0, "amount": Decimal('0.1')}]
opid = test_instance.nodes[0].z_sendmany(n0ua0_0, recipients, 1)
wait_and_assert_operationid_status(test_instance.nodes[0], opid)
test_instance.nodes[0].generate(1)
test_instance.sync_all()
assert_equal(test_instance.nodes[0].getblockcount(), 363 + block_offset)
recipients = [{"address": n0ua0_0, "amount": Decimal('2.9')}]
opid = test_instance.nodes[0].z_sendmany(n0ua1_0, recipients, 1)
wait_and_assert_operationid_status(test_instance.nodes[0], opid)
test_instance.nodes[0].generate(1)
test_instance.sync_all()
assert_equal(
{
'pools': {'orchard': {'valueZat': Decimal(299925000 + (5 * 30000000) - (5 * 10010000) + 290000000)}},
'minimum_confirmations': 1
},
test_instance.nodes[0].z_getbalanceforaccount(n0account0))
assert_equal(
{
'pools': {'orchard': {'valueZat': Decimal(150000000 + (5 * 30000000) - 290050000)}},
'minimum_confirmations': 1
},
test_instance.nodes[0].z_getbalanceforaccount(n0account1))
assert_equal(
{
'pools': {'orchard': {'valueZat': Decimal(549900000 + (5 * 10000000) - (5 * 60020000))}},
'minimum_confirmations': 1
},
test_instance.nodes[2].z_getbalanceforaccount(n2account0))
if __name__ == '__main__':
WalletGoldenV5_6_0Test().main()

View File

@ -12,7 +12,7 @@ from test_framework.util import (
nuparams,
start_nodes,
wait_and_assert_operationid_status,
DEFAULT_FEE
LEGACY_DEFAULT_FEE
)
from decimal import Decimal
@ -46,10 +46,10 @@ class WalletListNotes(BitcoinTestFramework):
# Send 1.0 minus default fee from sproutzaddr to a new Sapling zaddr
saplingzaddr = self.nodes[0].z_getnewaddress('sapling')
receive_amount_2 = Decimal('1.0')
change_amount_2 = receive_amount_1 - receive_amount_2 - DEFAULT_FEE
change_amount_2 = receive_amount_1 - receive_amount_2 - LEGACY_DEFAULT_FEE
assert_equal('sapling', self.nodes[0].z_validateaddress(saplingzaddr)['address_type'])
recipients = [{"address": saplingzaddr, "amount":receive_amount_2}]
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedAmounts')
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedAmounts')
txid_2 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -86,9 +86,9 @@ class WalletListNotes(BitcoinTestFramework):
# Send 2.0 minus default fee to a new sapling zaddr
saplingzaddr2 = self.nodes[0].z_getnewaddress('sapling')
receive_amount_3 = Decimal('2.0')
change_amount_3 = change_amount_2 - receive_amount_3 - DEFAULT_FEE
change_amount_3 = change_amount_2 - receive_amount_3 - LEGACY_DEFAULT_FEE
recipients = [{"address": saplingzaddr2, "amount":receive_amount_3}]
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedAmounts')
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedAmounts')
txid_3 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
unspent_tx = self.nodes[0].z_listunspent(0)

View File

@ -12,7 +12,7 @@ from test_framework.util import (
assert_raises_message,
connect_nodes_bi,
nuparams,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
)
from test_framework.util import wait_and_assert_operationid_status, start_nodes
@ -66,7 +66,7 @@ class ListReceivedTest (BitcoinTestFramework):
opid = self.nodes[1].z_sendmany(taddr, [
{'address': zaddr1, 'amount': 1, 'memo': my_memo},
{'address': zaddrExt, 'amount': 2},
], 1, DEFAULT_FEE, 'AllowFullyTransparent')
], 1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
txid = wait_and_assert_operationid_status(self.nodes[1], opid)
self.sync_all()
@ -77,13 +77,13 @@ class ListReceivedTest (BitcoinTestFramework):
assert_equal(len(pt['spends']), 0)
assert_equal(len(pt['outputs']), 2)
# Outputs are not returned in a defined order but the amounts are deterministic
# Outputs are shuffled during transaction building, but the amounts are deterministic
outputs = sorted(pt['outputs'], key=lambda x: x['valueZat'])
assert_equal(outputs[0]['pool'], 'sapling')
assert_equal(outputs[0]['address'], zaddr1)
assert_equal(outputs[0]['value'], Decimal('1'))
assert_equal(outputs[0]['valueZat'], 100000000)
assert_equal(outputs[0]['output'], 0)
output_1zec = outputs[0]['output']
assert_equal(outputs[0]['outgoing'], False)
assert_equal(outputs[0]['memo'], my_memo)
assert_equal(outputs[0]['memoStr'], my_memo_str)
@ -92,7 +92,6 @@ class ListReceivedTest (BitcoinTestFramework):
assert_equal(outputs[1]['address'], zaddrExt)
assert_equal(outputs[1]['value'], Decimal('2'))
assert_equal(outputs[1]['valueZat'], 200000000)
assert_equal(outputs[1]['output'], 1)
assert_equal(outputs[1]['outgoing'], True)
assert_equal(outputs[1]['memo'], no_memo)
assert 'memoStr' not in outputs[1]
@ -147,18 +146,17 @@ class ListReceivedTest (BitcoinTestFramework):
assert_equal(pt['spends'][0]['pool'], 'sapling')
assert_equal(pt['spends'][0]['txidPrev'], txidPrev)
assert_equal(pt['spends'][0]['spend'], 0)
assert_equal(pt['spends'][0]['outputPrev'], 0)
assert_equal(pt['spends'][0]['outputPrev'], output_1zec)
assert_equal(pt['spends'][0]['address'], zaddr1)
assert_equal(pt['spends'][0]['value'], Decimal('1.0'))
assert_equal(pt['spends'][0]['valueZat'], 100000000)
# Outputs are not returned in a defined order but the amounts are deterministic
# Outputs are shuffled during transaction building, but the amounts are deterministic
outputs = sorted(pt['outputs'], key=lambda x: x['valueZat'])
assert_equal(outputs[0]['pool'], 'sapling')
assert_equal(outputs[0]['address'], zaddr1)
assert_equal(outputs[0]['value'], Decimal('0.4') - conventional_fee(2))
assert_equal(outputs[0]['valueZat'], 40000000 - conventional_fee_zats(2))
assert_equal(outputs[0]['output'], 1)
assert_equal(outputs[0]['outgoing'], False)
assert_equal(outputs[0]['memo'], no_memo)
assert 'memoStr' not in outputs[0]
@ -167,7 +165,6 @@ class ListReceivedTest (BitcoinTestFramework):
assert_equal(outputs[1]['address'], zaddr2)
assert_equal(outputs[1]['value'], Decimal('0.6'))
assert_equal(outputs[1]['valueZat'], 60000000)
assert_equal(outputs[1]['output'], 0)
assert_equal(outputs[1]['outgoing'], False)
assert_equal(outputs[1]['memo'], no_memo)
assert 'memoStr' not in outputs[1]
@ -179,7 +176,7 @@ class ListReceivedTest (BitcoinTestFramework):
assert_equal(txid, r[0]['txid'])
assert_equal(Decimal('0.4')-conventional_fee(2), r[0]['amount'])
assert_equal(40000000-conventional_fee_zats(2), r[0]['amountZat'])
assert_equal(r[0]['change'], True, "Note valued at (0.4-"+str(DEFAULT_FEE)+") should be change")
assert_equal(r[0]['change'], True, "Note valued at (0.4-"+str(LEGACY_DEFAULT_FEE)+") should be change")
assert_equal(no_memo, r[0]['memo'])
# The old note still exists (it's immutable), even though it is spent

View File

@ -6,7 +6,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_true, bitcoind_processes, \
connect_nodes_bi, start_node, start_nodes, wait_and_assert_operationid_status, \
get_coinbase_address, DEFAULT_FEE
get_coinbase_address, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -32,11 +32,11 @@ class WalletNullifiersTest (BitcoinTestFramework):
# Tests using the default cached chain have one address per coinbase output
mytaddr = get_coinbase_address(self.nodes[0])
recipients = []
recipients.append({"address": myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE}) # utxo amount less fee
recipients.append({"address": myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE}) # utxo amount less fee
wait_and_assert_operationid_status(
self.nodes[0],
self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders'),
self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'),
timeout=120)
self.sync_all()
@ -109,7 +109,7 @@ class WalletNullifiersTest (BitcoinTestFramework):
wait_and_assert_operationid_status(
self.nodes[1],
self.nodes[1].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients'),
self.nodes[1].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients'),
timeout=120)
self.sync_all()
@ -118,7 +118,7 @@ class WalletNullifiersTest (BitcoinTestFramework):
# check zaddr balance
zsendmany3notevalue = Decimal('1.0')
zaddrremaining2 = zaddrremaining - zsendmany3notevalue - DEFAULT_FEE
zaddrremaining2 = zaddrremaining - zsendmany3notevalue - LEGACY_DEFAULT_FEE
assert_equal(self.nodes[1].z_getbalance(myzaddr), zaddrremaining2)
assert_equal(self.nodes[2].z_getbalance(myzaddr), zaddrremaining2)

View File

@ -11,7 +11,7 @@ from test_framework.util import (
get_coinbase_address,
start_nodes,
wait_and_assert_operationid_status,
DEFAULT_FEE
LEGACY_DEFAULT_FEE
)
from test_framework.authproxy import JSONRPCException
@ -70,12 +70,12 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Node 2 sends the zero-confirmation transparent funds to Node 1 using z_sendmany
recipients = []
recipients.append({"address":taddr1, "amount": Decimal('0.5')})
myopid = self.nodes[2].z_sendmany(taddr2, recipients, 0, DEFAULT_FEE, 'AllowFullyTransparent')
myopid = self.nodes[2].z_sendmany(taddr2, recipients, 0, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
txid_zsendmany = wait_and_assert_operationid_status(self.nodes[2], myopid)
# Node 0 shields to Node 2, a coinbase utxo of value 10.0 less default fee
zsendamount = Decimal('10.0') - DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr2, DEFAULT_FEE, 1)
zsendamount = Decimal('10.0') - LEGACY_DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr2, LEGACY_DEFAULT_FEE, 1)
txid_shielded = wait_and_assert_operationid_status(self.nodes[0], result['opid'])
# Skip over the three blocks prior to activation; no transactions can be mined
@ -86,7 +86,7 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Verify balance
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('0.5'))
assert_equal(self.nodes[2].getbalance(), Decimal('0.5') - DEFAULT_FEE)
assert_equal(self.nodes[2].getbalance(), Decimal('0.5') - LEGACY_DEFAULT_FEE)
assert_equal(self.nodes[2].z_getbalance(zaddr2), zsendamount)
# Verify transaction version is 4 (intended for Sapling+)
@ -139,12 +139,12 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Node 3 sends the zero-confirmation transparent funds to Node 1 using z_sendmany
recipients = []
recipients.append({"address":taddr1, "amount": Decimal('0.5')})
myopid = self.nodes[3].z_sendmany(taddr3, recipients, 0, DEFAULT_FEE, 'AllowFullyTransparent')
myopid = self.nodes[3].z_sendmany(taddr3, recipients, 0, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
txid_zsendmany = wait_and_assert_operationid_status(self.nodes[3], myopid)
# Node 0 shields to Node 3, a coinbase utxo of value 10.0 less default fee
zsendamount = Decimal('10.0') - DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr3, DEFAULT_FEE, 1)
zsendamount = Decimal('10.0') - LEGACY_DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr3, LEGACY_DEFAULT_FEE, 1)
txid_shielded = wait_and_assert_operationid_status(self.nodes[0], result['opid'])
# Mine the first Blossom block
@ -162,7 +162,7 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Verify balance
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('1.0'))
assert_equal(self.nodes[3].getbalance(), Decimal('0.5') - DEFAULT_FEE)
assert_equal(self.nodes[3].getbalance(), Decimal('0.5') - LEGACY_DEFAULT_FEE)
assert_equal(self.nodes[3].z_getbalance(zaddr3), zsendamount)
# Verify transaction version is 4 (intended for Sapling+)

View File

@ -9,7 +9,7 @@ from test_framework.util import (
get_coinbase_address,
start_nodes,
wait_and_assert_operationid_status,
DEFAULT_FEE
LEGACY_DEFAULT_FEE
)
from decimal import Decimal
@ -159,8 +159,8 @@ class WalletSaplingTest(BitcoinTestFramework):
myopid = self.nodes[1].z_sendmany(
taddr1,
[{'address': node4_sproutaddr, 'amount': Decimal('2.5')},
{'address': node4_saplingaddr, 'amount': Decimal('2.5') - DEFAULT_FEE}],
1, DEFAULT_FEE, 'AllowRevealedSenders'
{'address': node4_saplingaddr, 'amount': Decimal('2.5') - LEGACY_DEFAULT_FEE}],
1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'
)
wait_and_assert_operationid_status(self.nodes[1], myopid, "failed", "Sending funds into the Sprout pool is no longer supported.")

View File

@ -5,13 +5,15 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
assert_equal,
assert_raises_message,
connect_nodes_bi,
start_nodes,
sync_blocks,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import ZIP_317_FEE
TX_EXPIRY_DELTA = 10
TX_EXPIRING_SOON_THRESHOLD = 3
@ -25,6 +27,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
'-debug=mempool',
]] * self.num_nodes)
def run_test(self):
@ -42,7 +45,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
# Prepare some non-coinbase UTXOs
wait_and_assert_operationid_status(
self.nodes[3],
self.nodes[3].z_shieldcoinbase("*", node3zaddr, 0)['opid'],
self.nodes[3].z_shieldcoinbase("*", node3zaddr, 0, None, None, 'AllowLinkingAccountAddresses')['opid'],
)
self.sync_all()
self.nodes[0].generate(1)
@ -58,7 +61,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
{'address': node3taddr2, 'amount': 75},
],
1,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
'AllowRevealedRecipients',
),
)
@ -77,7 +80,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 100}],
1, DEFAULT_FEE, 'AllowFullyTransparent'),
1, LEGACY_DEFAULT_FEE, 'NoPrivacy'),
)
self.sync_all()
@ -97,7 +100,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 20}],
1, DEFAULT_FEE, 'AllowFullyTransparent'),
1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent'),
)
self.sync_all()
@ -111,7 +114,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
myopid = self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 20}],
1, DEFAULT_FEE, 'AllowRevealedSenders')
1, LEGACY_DEFAULT_FEE, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(self.nodes[3], myopid, "failed", "Insufficient funds: have 14.99998, need 20.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
# Create an expired transaction on node 3.
@ -130,9 +133,14 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
# Ensure that node 2 has no transparent funds.
self.nodes[2].generate(100) # To ensure node 2's pending coinbase is spendable
self.sync_all()
assert_raises_message(AssertionError, "tx unpaid action limit exceeded",
wait_and_assert_operationid_status,
self.nodes[2],
self.nodes[2].z_shieldcoinbase("*", node2zaddr, 0, None, None, 'AllowLinkingAccountAddresses')['opid'],
)
wait_and_assert_operationid_status(
self.nodes[2],
self.nodes[2].z_shieldcoinbase("*", node2zaddr, 0)['opid'],
self.nodes[2].z_shieldcoinbase("*", node2zaddr, ZIP_317_FEE, None, None, 'AllowLinkingAccountAddresses')['opid'],
)
self.sync_all()
assert_equal(0, self.nodes[2].getbalance())
@ -143,8 +151,8 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
self.nodes[2].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 13}],
1, DEFAULT_FEE, 'AllowRevealedSenders'),
"failed", "Insufficient funds: have 0.00, need 13.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'),
"failed", "Insufficient funds: have 0.00, need 13.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker. (This transaction may require selecting transparent coins that were sent to multiple addresses, which is not enabled by default because it would create a public link between those addresses. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowLinkingAccountAddresses` or weaker if you wish to allow this transaction to proceed anyway.)")
if __name__ == '__main__':
WalletSendManyAnyTaddr().main()

View File

@ -7,9 +7,9 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, initialize_chain_clean, \
start_node, connect_nodes_bi, sync_blocks, sync_mempools, \
wait_and_assert_operationid_status, get_coinbase_address, DEFAULT_FEE, \
wait_and_assert_operationid_status, get_coinbase_address, \
NU5_BRANCH_ID, nuparams
from test_framework.zip317 import conventional_fee
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
@ -26,6 +26,7 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
nuparams(NU5_BRANCH_ID, self.nu5_activation),
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
'-debug=mempool',
]
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, args))
@ -111,19 +112,19 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
# Confirm balances and that do_not_shield_taddr containing funds of 10 was left alone
assert_equal(self.nodes[0].getbalance(), 10)
assert_equal(self.nodes[0].z_getbalance(do_not_shield_taddr), Decimal('10.0'))
self.test_check_balance_zaddr(self.nodes[0], Decimal('40.0') - conventional_fee(4))
self.test_check_balance_zaddr(self.nodes[0], Decimal('40.0') - conventional_fee(6))
assert_equal(self.nodes[1].getbalance(), 20)
assert_equal(self.nodes[2].getbalance(), 30)
# Shield coinbase utxos from any node 2 taddr, and set fee to 0
result = self.nodes[2].z_shieldcoinbase("*", myzaddr, 0)
result = self.nodes[2].z_shieldcoinbase("*", myzaddr, 0, None, None, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(self.nodes[2], result['opid'])
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
assert_equal(self.nodes[0].getbalance(), 10)
self.test_check_balance_zaddr(self.nodes[0], Decimal('70.0') - conventional_fee(4))
self.test_check_balance_zaddr(self.nodes[0], Decimal('70.0') - conventional_fee(6))
assert_equal(self.nodes[1].getbalance(), 30)
assert_equal(self.nodes[2].getbalance(), 0)
@ -137,14 +138,14 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
mytaddr = get_coinbase_address(self.nodes[0], 800)
def verify_locking(first, second, limit):
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, 0, limit)
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, ZIP_317_FEE, limit)
assert_equal(result["shieldingUTXOs"], Decimal(first))
assert_equal(result["remainingUTXOs"], Decimal(second))
remainingValue = result["remainingValue"]
opid1 = result['opid']
# Verify that utxos are locked (not available for selection) by queuing up another shielding operation
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, 0, 0)
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, ZIP_317_FEE, 0)
assert_equal(result["shieldingValue"], Decimal(remainingValue))
assert_equal(result["shieldingUTXOs"], Decimal(second))
assert_equal(result["remainingValue"], Decimal('0'))
@ -170,13 +171,13 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
self.nodes[0].generate(200)
self.sync_all()
mytaddr = get_coinbase_address(self.nodes[0], 100)
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, DEFAULT_FEE, None, 'DEADBEEF')
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, ZIP_317_FEE, None, 'DEADBEEF')
assert_equal(result["shieldingUTXOs"], Decimal('50'))
assert_equal(result["remainingUTXOs"], Decimal('50'))
wait_and_assert_operationid_status(self.nodes[0], result['opid'])
# Verify maximum number of utxos which node 0 can shield can be set by the limit parameter
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, DEFAULT_FEE, 33, None)
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, ZIP_317_FEE, 33, None)
assert_equal(result["shieldingUTXOs"], Decimal('33'))
assert_equal(result["remainingUTXOs"], Decimal('17'))
wait_and_assert_operationid_status(self.nodes[0], result['opid'])

View File

@ -9,7 +9,7 @@ from test_framework.mininode import COIN
from test_framework.util import assert_equal, initialize_chain_clean, \
start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \
wait_and_assert_operationid_status_result, get_coinbase_address, \
check_node_log, DEFAULT_FEE
check_node_log, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee, WEIGHT_RATIO_CAP, ZIP_317_FEE
import sys
@ -106,7 +106,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
recipients = []
recipients.append({"address":myzaddr, "amount":Decimal('1.23456789')})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, DEFAULT_FEE, 'AllowFullyTransparent')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
error_result = wait_and_assert_operationid_status_result(
self.nodes[0],
myopid, "failed",
@ -116,7 +116,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# Test that the returned status object contains a params field with the operation's input parameters
assert_equal(error_result["method"], "z_sendmany")
params = error_result["params"]
assert_equal(params["fee"], DEFAULT_FEE) # default
assert_equal(params["fee"], LEGACY_DEFAULT_FEE) # default
assert_equal(params["minconf"], Decimal('10')) # default
assert_equal(params["fromaddress"], mytaddr)
assert_equal(params["amounts"][0]["address"], myzaddr)
@ -128,10 +128,10 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# This send will succeed. We send two coinbase utxos totalling 20.0 less a default fee, with no change.
# (This tx fits within the block unpaid action limit.)
shieldvalue = Decimal('20.0') - DEFAULT_FEE
shieldvalue = Decimal('20.0') - LEGACY_DEFAULT_FEE
recipients = []
recipients.append({"address":myzaddr, "amount": shieldvalue})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, DEFAULT_FEE, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -210,7 +210,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
unshieldvalue = Decimal('10.0')
recipients = []
recipients.append({"address":mytaddr, "amount": unshieldvalue})
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
assert(mytxid is not None)
@ -219,7 +219,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
self.sync_all()
# check balances
saplingvalue -= unshieldvalue + DEFAULT_FEE
saplingvalue -= unshieldvalue + LEGACY_DEFAULT_FEE
resp = self.nodes[0].z_gettotalbalance()
assert_equal(Decimal(resp["transparent"]), Decimal('30.0'))
assert_equal(Decimal(resp["private"]), saplingvalue)
@ -248,7 +248,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
recipients.append({"address":self.nodes[1].getnewaddress(), "amount":Decimal('10000.0')})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1)
wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient funds: have 10.00, need 10000.0001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient funds: have 9.99998, need 10000.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
# Send will fail because of insufficient funds unless sender uses coinbase utxos

View File

@ -0,0 +1,32 @@
#!/usr/bin/env python3
#
# Copyright (c) 2023 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
NU5_BRANCH_ID,
nuparams,
start_nodes,
)
from wallet_golden_5_6_0 import golden_check_spendability
class WalletTarnishedV5_6_0Test(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.cache_behavior = 'tarnished-v5.6.0'
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
nuparams(NU5_BRANCH_ID, 201),
]] * self.num_nodes)
def run_test(self):
golden_check_spendability(self, 1)
if __name__ == '__main__':
WalletTarnishedV5_6_0Test().main()

View File

@ -6,7 +6,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, \
start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \
get_coinbase_address, DEFAULT_FEE
get_coinbase_address, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
import time
@ -46,18 +46,18 @@ class WalletTreeStateTest (BitcoinTestFramework):
# Spend coinbase utxos to create three notes of 10 ZEC minus default fee each
recipients = []
recipients.append({"address": myzaddr, "amount": Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address": myzaddr, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
@ -65,7 +65,7 @@ class WalletTreeStateTest (BitcoinTestFramework):
# Check balance
resp = self.nodes[0].z_getbalance(myzaddr)
assert_equal(Decimal(resp), (Decimal('10.0') - DEFAULT_FEE) * 3)
assert_equal(Decimal(resp), (Decimal('10.0') - LEGACY_DEFAULT_FEE) * 3)
# We want to test a real-world situation where during the time spent creating a transaction
# with joinsplits, other transactions containing joinsplits have been mined into new blocks,
@ -73,8 +73,8 @@ class WalletTreeStateTest (BitcoinTestFramework):
# Tx 1 will change the treestate while Tx 2 containing chained joinsplits is still being generated
recipients = []
recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Tx 2 will consume all three notes, which must take at least two joinsplits. This is regardless of

View File

@ -6,7 +6,7 @@
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
assert_equal,
get_coinbase_address,
@ -43,11 +43,11 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
# Fund both of ua0_sapling and ua0_orchard
recipients = [{'address': ua0_sapling, 'amount': Decimal('9.99999000')}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
recipients = [{'address': ua0_orchard, 'amount': Decimal('9.99999000')}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
@ -62,11 +62,11 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
# in account1 having both Sapling and Orchard balances.
recipients = [{'address': ua1_sapling, 'amount': 5}]
opid = self.nodes[0].z_sendmany(ua0_sapling, recipients, 1, DEFAULT_FEE)
opid = self.nodes[0].z_sendmany(ua0_sapling, recipients, 1, LEGACY_DEFAULT_FEE)
txid_sapling = wait_and_assert_operationid_status(self.nodes[0], opid)
recipients = [{'address': ua1, 'amount': 5}]
opid = self.nodes[0].z_sendmany(ua0_orchard, recipients, 1, DEFAULT_FEE)
opid = self.nodes[0].z_sendmany(ua0_orchard, recipients, 1, LEGACY_DEFAULT_FEE)
txid_orchard = wait_and_assert_operationid_status(self.nodes[0], opid)
assert_equal(set([txid_sapling, txid_orchard]), set(self.nodes[0].getrawmempool()))

View File

@ -5,7 +5,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
assert_equal,
assert_greater_than,
@ -107,14 +107,14 @@ class WalletZSendmanyTest(BitcoinTestFramework):
# send node 2 taddr to zaddr
recipients = []
recipients.append({"address":myzaddr, "amount":7})
opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowFullyTransparent')
opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
mytxid = wait_and_assert_operationid_status(self.nodes[2], opid)
self.sync_all()
# check balances
zsendmanynotevalue = Decimal('7.0')
zsendmanyfee = DEFAULT_FEE
zsendmanyfee = LEGACY_DEFAULT_FEE
node2sproutbalance = Decimal('50.00000000')
node2utxobalance = Decimal('210.00000000') - zsendmanynotevalue - zsendmanyfee
@ -160,14 +160,14 @@ class WalletZSendmanyTest(BitcoinTestFramework):
# try sending with a memo to a taddr, which should fail
recipients = [{"address":self.nodes[0].getnewaddress(), "amount":1, "memo":"DEADBEEF"}]
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[2], opid, 'failed', 'Failed to build transaction: Memos cannot be sent to transparent addresses.')
recipients = []
recipients.append({"address":self.nodes[0].getnewaddress(), "amount":1})
recipients.append({"address":self.nodes[2].getnewaddress(), "amount":1.0})
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[2], opid)
zbalance -= Decimal('2.0') + zsendmanyfee
@ -333,8 +333,8 @@ class WalletZSendmanyTest(BitcoinTestFramework):
# If we try to send 3 ZEC from n1ua0, it will fail with too-few funds.
recipients = [{"address":n0ua0, "amount":3}]
linked_addrs_with_coinbase_note_msg = 'Insufficient funds: have 2.00, need 3.00; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker. (This transaction may require selecting transparent coins that were sent to multiple Unified Addresses, which is not enabled by default because it would create a public link between the transparent receivers of these addresses. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowLinkingAccountAddresses` or weaker if you wish to allow this transaction to proceed anyway.)'
linked_addrs_without_coinbase_note_msg = 'Insufficient funds: have 2.00, need 3.00. (This transaction may require selecting transparent coins that were sent to multiple Unified Addresses, which is not enabled by default because it would create a public link between the transparent receivers of these addresses. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowLinkingAccountAddresses` or weaker if you wish to allow this transaction to proceed anyway.)'
linked_addrs_with_coinbase_note_msg = 'Insufficient funds: have 0.00, need 3.00; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker. (This transaction may require selecting transparent coins that were sent to multiple addresses, which is not enabled by default because it would create a public link between those addresses. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowLinkingAccountAddresses` or weaker if you wish to allow this transaction to proceed anyway.)'
linked_addrs_without_coinbase_note_msg = 'Insufficient funds: have 2.00, need 3.00. (This transaction may require selecting transparent coins that were sent to multiple addresses, which is not enabled by default because it would create a public link between those addresses. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowLinkingAccountAddresses` or weaker if you wish to allow this transaction to proceed anyway.)'
revealed_amounts_msg = 'Could not send to a shielded receiver of a unified address without spending funds from a different pool, which would reveal transaction amounts. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowRevealedAmounts` or weaker if you wish to allow this transaction to proceed anyway.'
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, 0)
wait_and_assert_operationid_status(self.nodes[1], opid, 'failed', revealed_amounts_msg)

View File

@ -7,14 +7,14 @@ from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_greater_than, start_nodes,\
initialize_chain_clean, connect_nodes_bi, wait_and_assert_operationid_status, \
DEFAULT_FEE
LEGACY_DEFAULT_FEE
from functools import reduce
import logging
import sys
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO, stream=sys.stdout)
fee = DEFAULT_FEE # constant (but can be changed within reason)
fee = LEGACY_DEFAULT_FEE # constant (but can be changed within reason)
class ZkeyImportExportTest (BitcoinTestFramework):

View File

@ -101,6 +101,12 @@ criteria = "safe-to-deploy"
delta = "0.7.1 -> 0.8.0"
notes = "I previously reviewed the crypto-sensitive portions of these changes as well."
[[audits.bridgetree]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
version = "0.3.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.bumpalo]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -634,6 +640,11 @@ The ECC core team maintains this crate, and we have reviewed every line.
The crate has `deny(unsafe_code)`.
"""
[[audits.hdwallet]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "0.3.1 -> 0.4.1"
[[audits.http]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
@ -659,6 +670,12 @@ criteria = "safe-to-deploy"
delta = "0.3.0 -> 0.3.1"
notes = "Fixes bug in calculating altitudes from tree positions on 32-bit platforms."
[[audits.incrementalmerkletree]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.3.1 -> 0.4.0"
notes = "Removes `bridgetree` to a separate crate & updates Frontier representation."
[[audits.indexmap]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -871,6 +888,12 @@ criteria = ["safe-to-deploy", "crypto-reviewed"]
delta = "0.3.0 -> 0.4.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.orchard]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = ["safe-to-deploy", "crypto-reviewed"]
delta = "0.4.0 -> 0.5.0"
notes = "Updated to use incrementalmerkletree version 0.4.0."
[[audits.pairing]]
who = "Sean Bowe <ewillbefull@gmail.com>"
criteria = "safe-to-deploy"
@ -1006,6 +1029,11 @@ who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.23 -> 1.0.26"
[[audits.rand_xorshift]]
who = "Sean Bowe <ewillbefull@gmail.com>"
criteria = "safe-to-deploy"
version = "0.3.0"
[[audits.raw-cpuid]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -1466,6 +1494,12 @@ criteria = "safe-to-deploy"
delta = "0.2.0 -> 0.2.1"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_address]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.2.1 -> 0.3.0"
notes = "Updates the bs58 dependency to version 0.5."
[[audits.zcash_encoding]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -1500,6 +1534,12 @@ criteria = ["safe-to-deploy", "crypto-reviewed"]
delta = "0.2.0 -> 0.3.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_note_encryption]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = ["safe-to-deploy", "crypto-reviewed"]
delta = "0.3.0 -> 0.4.0"
notes = "A minor API change that removes some unused parameters."
[[audits.zcash_primitives]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
@ -1553,6 +1593,12 @@ criteria = ["safe-to-deploy", "crypto-reviewed"]
delta = "0.10.2 -> 0.11.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_primitives]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = ["safe-to-deploy", "crypto-reviewed"]
delta = "0.11.0 -> 0.12.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_proofs]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
@ -1593,6 +1639,12 @@ criteria = ["safe-to-deploy", "crypto-reviewed"]
delta = "0.10.0 -> 0.11.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_proofs]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = ["safe-to-deploy", "crypto-reviewed"]
delta = "0.11.0 -> 0.12.0"
notes = "The only change is that the zcash_primitives dependency has been updated to version 0.12."
[[audits.zeroize]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"

View File

@ -19,6 +19,39 @@ url = "https://raw.githubusercontent.com/divviup/libprio-rs/main/supply-chain/au
[imports.mozilla]
url = "https://raw.githubusercontent.com/mozilla/supply-chain/main/audits.toml"
[policy.bridgetree]
audit-as-crates-io = false
[policy.equihash]
audit-as-crates-io = false
[policy.f4jumble]
audit-as-crates-io = false
[policy.incrementalmerkletree]
audit-as-crates-io = false
[policy.orchard]
audit-as-crates-io = false
[policy.zcash_address]
audit-as-crates-io = false
[policy.zcash_encoding]
audit-as-crates-io = false
[policy.zcash_history]
audit-as-crates-io = false
[policy.zcash_note_encryption]
audit-as-crates-io = false
[policy.zcash_primitives]
audit-as-crates-io = false
[policy.zcash_proofs]
audit-as-crates-io = false
[[exemptions.addr2line]]
version = "0.17.0"
criteria = "safe-to-deploy"
@ -39,6 +72,10 @@ criteria = "safe-to-deploy"
version = "0.7.6"
criteria = "safe-to-deploy"
[[exemptions.ahash]]
version = "0.8.3"
criteria = "safe-to-deploy"
[[exemptions.aho-corasick]]
version = "0.7.18"
criteria = "safe-to-deploy"
@ -84,7 +121,7 @@ version = "0.7.0"
criteria = "safe-to-deploy"
[[exemptions.bs58]]
version = "0.4.0"
version = "0.5.0"
criteria = "safe-to-deploy"
[[exemptions.byte-slice-cast]]
@ -148,11 +185,15 @@ version = "3.2.0"
criteria = "safe-to-deploy"
[[exemptions.cxx]]
version = "1.0.68"
version = "1.0.95"
criteria = "safe-to-deploy"
[[exemptions.cxxbridge-flags]]
version = "1.0.95"
criteria = "safe-to-deploy"
[[exemptions.cxxbridge-macro]]
version = "1.0.68"
version = "1.0.95"
criteria = "safe-to-deploy"
[[exemptions.digest]]
@ -175,6 +216,10 @@ criteria = "safe-to-deploy"
version = "3.0.0"
criteria = "safe-to-deploy"
[[exemptions.errno-dragonfly]]
version = "0.1.2"
criteria = "safe-to-deploy"
[[exemptions.ff]]
version = "0.12.0"
criteria = "safe-to-deploy"
@ -231,6 +276,10 @@ criteria = "safe-to-deploy"
version = "0.2.6"
criteria = "safe-to-deploy"
[[exemptions.hermit-abi]]
version = "0.3.1"
criteria = "safe-to-deploy"
[[exemptions.hmac]]
version = "0.12.1"
criteria = "safe-to-deploy"
@ -267,6 +316,14 @@ criteria = "safe-to-deploy"
version = "1.8.1"
criteria = "safe-to-deploy"
[[exemptions.instant]]
version = "0.1.12"
criteria = "safe-to-deploy"
[[exemptions.io-lifetimes]]
version = "1.0.9"
criteria = "safe-to-deploy"
[[exemptions.ipnet]]
version = "2.5.0"
criteria = "safe-to-deploy"
@ -295,16 +352,8 @@ criteria = "safe-to-deploy"
version = "1.0.6"
criteria = "safe-to-deploy"
[[exemptions.lock_api]]
version = "0.4.7"
criteria = "safe-to-deploy"
[[exemptions.mach]]
version = "0.3.2"
criteria = "safe-to-deploy"
[[exemptions.matchers]]
version = "0.1.0"
[[exemptions.linux-raw-sys]]
version = "0.3.8"
criteria = "safe-to-deploy"
[[exemptions.memchr]]
@ -320,19 +369,19 @@ version = "0.2.0"
criteria = "safe-to-deploy"
[[exemptions.metrics]]
version = "0.19.0"
version = "0.21.0"
criteria = "safe-to-deploy"
[[exemptions.metrics-exporter-prometheus]]
version = "0.10.0"
version = "0.12.1"
criteria = "safe-to-deploy"
[[exemptions.metrics-macros]]
version = "0.5.1"
version = "0.7.0"
criteria = "safe-to-deploy"
[[exemptions.metrics-util]]
version = "0.13.0"
version = "0.15.0"
criteria = "safe-to-deploy"
[[exemptions.minimal-lexical]]
@ -384,21 +433,13 @@ version = "0.22.0"
criteria = "safe-to-deploy"
[[exemptions.parity-scale-codec]]
version = "3.2.1"
version = "3.5.0"
criteria = "safe-to-deploy"
[[exemptions.parity-scale-codec-derive]]
version = "3.1.3"
criteria = "safe-to-deploy"
[[exemptions.parking_lot]]
version = "0.11.2"
criteria = "safe-to-deploy"
[[exemptions.parking_lot_core]]
version = "0.9.5"
criteria = "safe-to-deploy"
[[exemptions.password-hash]]
version = "0.3.2"
criteria = "safe-to-deploy"
@ -436,7 +477,7 @@ version = "0.7.2"
criteria = "safe-to-deploy"
[[exemptions.portable-atomic]]
version = "0.3.19"
version = "1.3.3"
criteria = "safe-to-deploy"
[[exemptions.ppv-lite86]]
@ -451,8 +492,16 @@ criteria = "safe-to-deploy"
version = "1.2.1"
criteria = "safe-to-deploy"
[[exemptions.proptest]]
version = "1.2.0"
criteria = "safe-to-deploy"
[[exemptions.quanta]]
version = "0.9.3"
version = "0.11.1"
criteria = "safe-to-deploy"
[[exemptions.quick-error]]
version = "1.2.3"
criteria = "safe-to-deploy"
[[exemptions.radium]]
@ -487,6 +536,10 @@ criteria = "safe-to-deploy"
version = "0.2.16"
criteria = "safe-to-deploy"
[[exemptions.redox_syscall]]
version = "0.3.5"
criteria = "safe-to-deploy"
[[exemptions.redox_users]]
version = "0.4.3"
criteria = "safe-to-deploy"
@ -515,6 +568,14 @@ criteria = "safe-to-deploy"
version = "2.1.0"
criteria = "safe-to-deploy"
[[exemptions.rustix]]
version = "0.37.7"
criteria = "safe-to-deploy"
[[exemptions.rusty-fork]]
version = "0.3.0"
criteria = "safe-to-deploy"
[[exemptions.ryu]]
version = "1.0.11"
criteria = "safe-to-deploy"
@ -524,11 +585,11 @@ version = "1.1.0"
criteria = "safe-to-deploy"
[[exemptions.secp256k1]]
version = "0.21.3"
version = "0.26.0"
criteria = "safe-to-deploy"
[[exemptions.secp256k1-sys]]
version = "0.4.2"
version = "0.8.1"
criteria = "safe-to-deploy"
[[exemptions.secrecy]]
@ -563,10 +624,6 @@ criteria = "safe-to-deploy"
version = "0.1.3"
criteria = "safe-to-deploy"
[[exemptions.smallvec]]
version = "1.10.0"
criteria = "safe-to-deploy"
[[exemptions.socket2]]
version = "0.4.9"
criteria = "safe-to-deploy"
@ -587,22 +644,14 @@ criteria = "safe-to-deploy"
version = "1.0.102"
criteria = "safe-to-deploy"
[[exemptions.tap]]
version = "1.0.1"
[[exemptions.tempfile]]
version = "3.3.0"
criteria = "safe-to-deploy"
[[exemptions.terminfo]]
version = "0.8.0"
criteria = "safe-to-deploy"
[[exemptions.thiserror]]
version = "1.0.30"
criteria = "safe-to-deploy"
[[exemptions.thiserror-impl]]
version = "1.0.30"
criteria = "safe-to-deploy"
[[exemptions.thread_local]]
version = "1.1.4"
criteria = "safe-to-deploy"
@ -624,7 +673,7 @@ version = "1.27.0"
criteria = "safe-to-deploy"
[[exemptions.toml_edit]]
version = "0.19.7"
version = "0.19.10"
criteria = "safe-to-deploy"
[[exemptions.tower-service]]
@ -659,12 +708,12 @@ criteria = "safe-to-deploy"
version = "0.9.4"
criteria = "safe-to-deploy"
[[exemptions.valuable]]
version = "0.1.0"
[[exemptions.unarray]]
version = "0.1.4"
criteria = "safe-to-deploy"
[[exemptions.wasi]]
version = "0.10.2+wasi-snapshot-preview1"
[[exemptions.wait-timeout]]
version = "0.2.0"
criteria = "safe-to-deploy"
[[exemptions.wasi]]
@ -708,7 +757,7 @@ version = "0.4.0"
criteria = "safe-to-deploy"
[[exemptions.winnow]]
version = "0.4.1"
version = "0.4.6"
criteria = "safe-to-deploy"
[[exemptions.wyz]]

View File

@ -19,6 +19,12 @@ Well documented invariants, good assertions for those invariants in unsafe code,
and tested with MIRI to boot. LGTM.
"""
[[audits.bytecode-alliance.audits.base64]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.21.0"
notes = "This crate has no dependencies, no build.rs, and contains no unsafe code."
[[audits.bytecode-alliance.audits.block-buffer]]
who = "Benjamin Bouvier <public@benj.me>"
criteria = "safe-to-deploy"
@ -52,6 +58,12 @@ who = "Benjamin Bouvier <public@benj.me>"
criteria = "safe-to-deploy"
delta = "0.9.0 -> 0.10.3"
[[audits.bytecode-alliance.audits.errno]]
who = "Dan Gohman <dev@sunfishcode.online>"
criteria = "safe-to-deploy"
version = "0.3.0"
notes = "This crate uses libc and windows-sys APIs to get and set the raw OS error value."
[[audits.bytecode-alliance.audits.futures-channel]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
@ -64,12 +76,29 @@ criteria = "safe-to-deploy"
version = "0.3.27"
notes = "Unsafe used to implement a concurrency primitive AtomicWaker. Well-commented and not obviously incorrect. Like my other audits of these concurrency primitives inside the futures family, I couldn't certify that it is correct without formal methods, but that is out of scope for this vetting."
[[audits.bytecode-alliance.audits.hashbrown]]
who = "Chris Fallin <chris@cfallin.org>"
criteria = "safe-to-deploy"
delta = "0.12.3 -> 0.13.1"
notes = "The diff looks plausible. Much of it is low-level memory-layout code and I can't be 100% certain without a deeper dive into the implementation logic, but nothing looks actively malicious."
[[audits.bytecode-alliance.audits.hashbrown]]
who = "Trevor Elliott <telliott@fastly.com>"
criteria = "safe-to-deploy"
delta = "0.13.1 -> 0.13.2"
notes = "I read through the diff between v0.13.1 and v0.13.2, and verified that the changes made matched up with the changelog entries. There were very few changes between these two releases, and it was easy to verify what they did."
[[audits.bytecode-alliance.audits.httpdate]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "1.0.2"
notes = "No unsafety, no io"
[[audits.bytecode-alliance.audits.matchers]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.1.0"
[[audits.bytecode-alliance.audits.memoffset]]
who = "Alex Crichton <alex@alexcrichton.com>"
criteria = "safe-to-deploy"
@ -81,6 +110,11 @@ who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.1.0"
[[audits.bytecode-alliance.audits.proc-macro2]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
delta = "1.0.51 -> 1.0.57"
[[audits.bytecode-alliance.audits.rustc-demangle]]
who = "Alex Crichton <alex@alexcrichton.com>"
criteria = "safe-to-deploy"
@ -93,6 +127,11 @@ criteria = "safe-to-deploy"
delta = "0.9.9 -> 0.10.2"
notes = "This upgrade is mostly a code refactor, as far as I can tell. No new uses of unsafe nor any new ambient capabilities usage."
[[audits.bytecode-alliance.audits.tempfile]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
delta = "3.3.0 -> 3.5.0"
[[audits.bytecode-alliance.audits.tinyvec]]
who = "Alex Crichton <alex@alexcrichton.com>"
criteria = "safe-to-deploy"
@ -201,10 +240,50 @@ who = "Johan Andersson <opensource@embark-studios.com>"
criteria = "safe-to-deploy"
version = "1.0.58"
[[audits.google.audits.cxxbridge-flags]]
[[audits.embark-studios.audits.epaint]]
who = "Johan Andersson <opensource@embark-studios.com>"
criteria = "safe-to-deploy"
violation = "<0.20.0"
notes = "Specified crate license does not include licenses of embedded fonts if using default features or the `default_fonts` feature. Tracked in: https://github.com/emilk/egui/issues/2321"
[[audits.embark-studios.audits.tap]]
who = "Johan Andersson <opensource@embark-studios.com>"
criteria = "safe-to-deploy"
version = "1.0.1"
notes = "No unsafe usage or ambient capabilities"
[[audits.embark-studios.audits.thiserror]]
who = "Johan Andersson <opensource@embark-studios.com>"
criteria = "safe-to-deploy"
version = "1.0.40"
notes = "Wrapper over implementation crate, found no unsafe or ambient capabilities used"
[[audits.embark-studios.audits.thiserror-impl]]
who = "Johan Andersson <opensource@embark-studios.com>"
criteria = "safe-to-deploy"
version = "1.0.40"
notes = "Found no unsafe or ambient capabilities used"
[[audits.embark-studios.audits.toml_datetime]]
who = "Johan Andersson <opensource@embark-studios.com>"
criteria = "safe-to-deploy"
delta = "0.6.1 -> 0.6.2"
notes = "No notable changes"
[[audits.embark-studios.audits.valuable]]
who = "Johan Andersson <opensource@embark-studios.com>"
criteria = "safe-to-deploy"
version = "0.1.0"
notes = "No unsafe usage or ambient capabilities, sane build script"
[[audits.google.audits.fastrand]]
who = "George Burgess IV <gbiv@google.com>"
criteria = "safe-to-deploy"
version = "1.0.92"
version = "1.9.0"
notes = """
`does-not-implement-crypto` is certified because this crate explicitly says
that the RNG here is not cryptographically secure.
"""
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.version_check]]
@ -213,6 +292,16 @@ criteria = "safe-to-deploy"
version = "0.9.4"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.isrg.audits.base64]]
who = "Tim Geoghegan <timg@letsencrypt.org>"
criteria = "safe-to-deploy"
delta = "0.21.0 -> 0.21.1"
[[audits.isrg.audits.base64]]
who = "Brandon Pitman <bran@bran.land>"
criteria = "safe-to-deploy"
delta = "0.21.1 -> 0.21.2"
[[audits.isrg.audits.block-buffer]]
who = "David Cook <dcook@divviup.org>"
criteria = "safe-to-deploy"
@ -233,11 +322,6 @@ who = "David Cook <dcook@divviup.org>"
criteria = "safe-to-deploy"
version = "0.3.0"
[[audits.isrg.audits.proc-macro2]]
who = "Brandon Pitman <bran@bran.land>"
criteria = "safe-to-deploy"
delta = "1.0.52 -> 1.0.54"
[[audits.isrg.audits.rayon]]
who = "Brandon Pitman <bran@bran.land>"
criteria = "safe-to-deploy"
@ -303,26 +387,6 @@ who = "Brandon Pitman <bran@bran.land>"
criteria = "safe-to-deploy"
delta = "1.0.104 -> 2.0.11"
[[audits.isrg.audits.thiserror]]
who = "Brandon Pitman <bran@bran.land>"
criteria = "safe-to-deploy"
delta = "1.0.38 -> 1.0.39"
[[audits.isrg.audits.thiserror]]
who = "Brandon Pitman <bran@bran.land>"
criteria = "safe-to-deploy"
delta = "1.0.39 -> 1.0.40"
[[audits.isrg.audits.thiserror-impl]]
who = "Brandon Pitman <bran@bran.land>"
criteria = "safe-to-deploy"
delta = "1.0.38 -> 1.0.39"
[[audits.isrg.audits.thiserror-impl]]
who = "Brandon Pitman <bran@bran.land>"
criteria = "safe-to-deploy"
delta = "1.0.39 -> 1.0.40"
[[audits.isrg.audits.unicode-ident]]
who = "David Cook <dcook@divviup.org>"
criteria = "safe-to-deploy"
@ -381,6 +445,26 @@ version = "1.1.0"
notes = "All code written or reviewed by Josh Stone."
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.bit-set]]
who = "Aria Beingessner <a.beingessner@gmail.com>"
criteria = "safe-to-deploy"
version = "0.5.2"
notes = "Another crate I own via contain-rs that is ancient and maintenance mode, no known issues."
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.bit-set]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.5.2 -> 0.5.3"
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.bit-vec]]
who = "Aria Beingessner <a.beingessner@gmail.com>"
criteria = "safe-to-deploy"
version = "0.6.3"
notes = "Another crate I own via contain-rs that is ancient and in maintenance mode but otherwise perfectly fine."
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.block-buffer]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
@ -511,6 +595,12 @@ criteria = "safe-to-deploy"
version = "0.4.17"
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.mach2]]
who = "Gabriele Svelto <gsvelto@mozilla.com>"
criteria = "safe-to-deploy"
version = "0.4.1"
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.memoffset]]
who = "Gabriele Svelto <gsvelto@mozilla.com>"
criteria = "safe-to-deploy"
@ -604,6 +694,13 @@ criteria = "safe-to-deploy"
delta = "1.0.43 -> 1.0.49"
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.proc-macro2]]
who = "Jan-Erik Rediger <jrediger@mozilla.com>"
criteria = "safe-to-deploy"
delta = "1.0.57 -> 1.0.59"
notes = "Enabled on Wasm"
aggregated-from = "https://raw.githubusercontent.com/mozilla/glean/main/supply-chain/audits.toml"
[[audits.mozilla.audits.quote]]
who = "Nika Layzell <nika@thelayzells.com>"
criteria = "safe-to-deploy"
@ -748,18 +845,6 @@ criteria = "safe-to-deploy"
delta = "0.10.2 -> 0.10.6"
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.thiserror]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "1.0.32 -> 1.0.38"
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.thiserror-impl]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "1.0.32 -> 1.0.38"
aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
[[audits.mozilla.audits.typenum]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"

View File

@ -87,14 +87,17 @@ function zcashd_stop {
}
function zcashd_heaptrack_start {
TEST_NAME="$1"
case "$1" in
sendtoaddress|loadwallet|listunspent)
case "$2" in
200k-recv)
use_200k_benchmark 0
TEST_NAME="${TEST_NAME}-200k-recv"
;;
200k-send)
use_200k_benchmark 1
TEST_NAME="${TEST_NAME}-200k-send"
;;
*)
echo "Bad arguments to zcashd_heaptrack_start."
@ -106,7 +109,7 @@ function zcashd_heaptrack_start {
mkdir -p "$DATADIR/regtest"
touch "$DATADIR/zcash.conf"
esac
heaptrack ./src/zcashd -regtest -datadir="$DATADIR" -rpcuser=user -rpcpassword=password -rpcport=5983 -showmetrics=0 &
heaptrack -o "${TEST_NAME}" ./src/zcashd -regtest -datadir="$DATADIR" -rpcuser=user -rpcpassword=password -rpcport=5983 -showmetrics=0 &
ZCASHD_PID=$!
zcash_rpc_wait_for_start
}

View File

@ -6,26 +6,42 @@
# CCache 4.7 appears to drop support for Ubuntu 18.04.
# We will drop Ubuntu 18.04 no later than May 2023.
native_ccache 4.7 2023-05-01
native_ccache 4.7.1 2023-05-01
native_ccache 4.7.2 2023-05-01
native_ccache 4.7.3 2023-05-01
native_ccache 4.7.4 2023-05-01
native_ccache 4.7.5 2023-05-01
native_ccache 4.8 2023-05-01
native_ccache 4.7 2023-07-15
native_ccache 4.7.1 2023-07-15
native_ccache 4.7.2 2023-07-15
native_ccache 4.7.3 2023-07-15
native_ccache 4.7.4 2023-07-15
native_ccache 4.7.5 2023-07-15
native_ccache 4.8 2023-07-15
native_ccache 4.8.1 2023-07-15
native_ccache 4.8.2 2023-07-15
# Clang and Rust are currently pinned to LLVM 15
libcxx 15.0.7 2023-04-30
libcxx 16.0.0 2023-04-30
libcxx 16.0.1 2023-04-30
libcxx 16.0.2 2023-04-30
native_clang 15.0.7 2023-04-30
native_clang 16.0.0 2023-04-30
native_clang 16.0.1 2023-04-30
native_clang 16.0.2 2023-04-30
libcxx 15.0.7 2023-07-15
libcxx 16.0.0 2023-07-15
libcxx 16.0.1 2023-07-15
libcxx 16.0.2 2023-07-15
libcxx 16.0.2 2023-07-15
libcxx 16.0.3 2023-07-15
libcxx 16.0.4 2023-07-15
libcxx 16.0.5 2023-07-15
libcxx 16.0.6 2023-07-15
native_clang 15.0.7 2023-07-15
native_clang 16.0.0 2023-07-15
native_clang 16.0.1 2023-07-15
native_clang 16.0.2 2023-07-15
native_clang 16.0.3 2023-07-15
native_clang 16.0.4 2023-07-15
native_clang 16.0.5 2023-07-15
native_clang 16.0.6 2023-07-15
native_cxxbridge 1.0.96 2023-07-15
native_cxxbridge 1.0.97 2023-07-15
native_rust 1.70.0 2023-07-15
rustcxx 1.0.96 2023-07-15
rustcxx 1.0.97 2023-07-15
# We follow upstream Bitcoin Core's LevelDB updates
leveldb 1.23 2023-06-01
leveldb 1.23 2023-07-15
# We're never updating to this version
bdb 18.1.40 2024-03-01

View File

@ -7,7 +7,7 @@
DIST_SUBDIRS = secp256k1 univalue
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS)
AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS)
AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) $(WARNING_CXXFLAGS)
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS)
EXTRA_LIBRARIES =
@ -23,13 +23,15 @@ BITCOIN_INCLUDES += -I$(srcdir)/univalue/include
LIBBITCOIN_SERVER=libbitcoin_server.a
LIBBITCOIN_COMMON=libbitcoin_common.a
LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a
LIBBITCOIN_CLI=libbitcoin_cli.a
LIBBITCOIN_SCRIPT=libbitcoin_script.a
LIBBITCOIN_UTIL=libbitcoin_util.a
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
LIBBITCOIN_CRYPTO_SSE41=crypto/libbitcoin_crypto_sse41.a
LIBBITCOIN_CRYPTO_AVX2=crypto/libbitcoin_crypto_avx2.a
LIBCXXBRIDGE=libcxxbridge.a
LIBRUSTZCASH=$(top_builddir)/target/$(RUST_TARGET)/release/librustzcash.a
LIBRUSTZCASH=$(top_builddir)/target/$(RUST_TARGET)/release/librustzcash.la
LIBSECP256K1=secp256k1/libsecp256k1.la
LIBUNIVALUE=univalue/libunivalue.la
LIBZCASH=libzcash.a
@ -143,6 +145,15 @@ $(WALLET_TOOL_BIN): cargo-build-bins
$(AM_V_at)cp $(WALLET_TOOL_BUILD) $@
$(LIBRUSTZCASH): cargo-build-lib
$(AM_V_at)$(MKDIR_P) $(@D)/.libs
$(AM_V_at)echo '# $(@F) - a libtool library file' >$@
$(AM_V_at)echo "# Generated by src/Makefile.am for libtool" >>$@
$(AM_V_at)echo "dlname=''" >>$@
$(AM_V_at)echo "library_names=''" >>$@
$(AM_V_at)echo "old_library='../$(basename $(@F)).a'" >>$@
$(AM_V_at)echo "inherited_linker_flags=''" >>$@
$(AM_V_at)echo "installed=no" >>$@
$(AM_V_at)echo "shouldnotlink=no" >>$@
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
@ -156,6 +167,8 @@ EXTRA_LIBRARIES += \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_SCRIPT) \
$(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_SERVER) \
$(LIBBITCOIN_CLI) \
$(LIBBITCOIN_WALLET) \
@ -191,9 +204,9 @@ LIBZCASH_H = \
zcash/address/sprout.hpp \
zcash/address/unified.h \
zcash/address/zip32.h \
zcash/cache.h \
zcash/History.hpp \
zcash/JoinSplit.hpp \
zcash/memo.h \
zcash/Note.hpp \
zcash/prf.h \
zcash/Proof.hpp \
@ -207,8 +220,6 @@ BITCOIN_CORE_H = \
addressindex.h \
addrman.h \
alert.h \
amount.h \
arith_uint256.h \
asyncrpcoperation.h \
asyncrpcqueue.h \
base58.h \
@ -229,18 +240,12 @@ BITCOIN_CORE_H = \
compat/sanity.h \
compressor.h \
consensus/consensus.h \
consensus/funding.h \
consensus/merkle.h \
consensus/params.h \
consensus/upgrades.h \
consensus/validation.h \
core_io.h \
core_memusage.h \
cuckoocache.h \
deprecation.h \
experimental_features.h \
fs.h \
hash.h \
httprpc.h \
httpserver.h \
init.h \
@ -260,35 +265,25 @@ BITCOIN_CORE_H = \
net.h \
netbase.h \
noui.h \
policy/fees.h \
policy/policy.h \
pow.h \
prevector.h \
primitives/block.h \
primitives/orchard.h \
primitives/transaction.h \
proof_verifier.h \
protocol.h \
pubkey.h \
random.h \
reverse_iterator.h \
reverselock.h \
rpc/client.h \
rpc/common.h \
rpc/protocol.h \
rpc/server.h \
rpc/register.h \
scheduler.h \
script/interpreter.h \
script/script.h \
script/script_error.h \
script/sigcache.h \
script/sign.h \
script/standard.h \
script/ismine.h \
serialize.h \
spentindex.h \
streams.h \
streams_rust.h \
support/allocators/secure.h \
support/allocators/zeroafterfree.h \
support/cleanse.h \
@ -298,7 +293,6 @@ BITCOIN_CORE_H = \
threadsafety.h \
timedata.h \
timestampindex.h \
tinyformat.h \
torcontrol.h \
transaction_builder.h \
txdb.h \
@ -311,11 +305,10 @@ BITCOIN_CORE_H = \
util/system.h \
util/match.h \
util/moneystr.h \
util/strencodings.h \
util/string.h \
util/test.h \
util/time.h \
validationinterface.h \
version.h \
wallet/asyncrpcoperation_common.h \
wallet/asyncrpcoperation_mergetoaddress.h \
wallet/asyncrpcoperation_saplingmigration.h \
@ -324,7 +317,6 @@ BITCOIN_CORE_H = \
wallet/wallet_tx_builder.h \
wallet/crypter.h \
wallet/db.h \
wallet/memo.h \
wallet/orchard.h \
wallet/paymentdisclosure.h \
wallet/paymentdisclosuredb.h \
@ -373,7 +365,6 @@ libbitcoin_server_a_SOURCES = \
miner.cpp \
net.cpp \
noui.cpp \
policy/fees.cpp \
policy/policy.cpp \
pow.cpp \
rest.cpp \
@ -398,7 +389,9 @@ libcxxbridge_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) $(E
libcxxbridge_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libcxxbridge_a_SOURCES = \
$(CXXBRIDGE_CPP) \
$(CXXBRIDGE_H)
$(CXXBRIDGE_H) \
zcash/cache.cpp \
zcash/cache.h
if ENABLE_ZMQ
libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS)
@ -499,45 +492,79 @@ crypto_libbitcoin_crypto_shani_a_CXXFLAGS += $(SHANI_CXXFLAGS)
crypto_libbitcoin_crypto_shani_a_CPPFLAGS += -DENABLE_SHANI
crypto_libbitcoin_crypto_shani_a_SOURCES = crypto/sha256_shani.cpp
# script: shared between all executables that validate any Bitcoin-style scripts.
libbitcoin_script_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_script_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_script_a_SOURCES = \
amount.cpp \
amount.h \
hash.cpp \
hash.h \
prevector.h \
primitives/orchard.h \
primitives/sapling.h \
primitives/transaction.cpp \
primitives/transaction.h \
pubkey.cpp \
pubkey.h \
script/interpreter.cpp \
script/interpreter.h \
script/script.cpp \
script/script.h \
script/script_error.cpp \
script/script_error.h \
script/zcash_script.cpp \
serialize.h \
streams_rust.cpp \
streams_rust.h \
tinyformat.h \
util/strencodings.cpp \
util/strencodings.h \
version.h \
zip317.cpp
# consensus: shared between all executables that validate any consensus rules.
libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_consensus_a_SOURCES = \
arith_uint256.cpp \
arith_uint256.h \
consensus/funding.cpp \
consensus/funding.h \
consensus/merkle.cpp \
consensus/merkle.h \
consensus/params.cpp \
consensus/params.h \
consensus/upgrades.cpp \
consensus/upgrades.h \
consensus/validation.h \
primitives/block.cpp \
primitives/block.h
# common: shared between zcashd and non-server tools
libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_common_a_SOURCES = \
amount.cpp \
arith_uint256.cpp \
base58.cpp \
bech32.cpp \
chainparams.cpp \
coins.cpp \
compressor.cpp \
consensus/funding.cpp \
consensus/merkle.cpp \
consensus/params.cpp \
consensus/upgrades.cpp \
core_read.cpp \
core_write.cpp \
hash.cpp \
key.cpp \
key_io.cpp \
keystore.cpp \
netbase.cpp \
primitives/block.cpp \
primitives/transaction.cpp \
primitives/tx_version_info.cpp \
proof_verifier.cpp \
protocol.cpp \
pubkey.cpp \
scheduler.cpp \
script/interpreter.cpp \
script/script.cpp \
script/script_error.cpp \
script/sign.cpp \
script/standard.cpp \
streams_rust.cpp \
transaction_builder.cpp \
util/test.cpp \
warnings.cpp \
zip317.cpp \
$(BITCOIN_CORE_H) \
$(LIBZCASH_H)
@ -600,6 +627,8 @@ zcashd_LDADD = \
$(LIBUNIVALUE) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_ZMQ) \
$(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_SCRIPT) \
$(LIBBITCOIN_CRYPTO) \
$(LIBRUSTZCASH) \
$(LIBZCASH) \
@ -655,6 +684,8 @@ zcash_tx_LDADD = \
$(LIBUNIVALUE) \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_SCRIPT) \
$(LIBCXXBRIDGE) \
$(LIBSECP256K1) \
$(LIBRUSTZCASH) \
@ -677,9 +708,9 @@ libzcash_a_SOURCES = \
zcash/address/sprout.cpp \
zcash/address/unified.cpp \
zcash/address/zip32.cpp \
zcash/cache.cpp \
zcash/History.cpp \
zcash/JoinSplit.cpp \
zcash/memo.cpp \
zcash/Note.cpp \
zcash/prf.cpp \
zcash/util.cpp
@ -691,28 +722,18 @@ libzcash_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
if BUILD_BITCOIN_LIBS
include_HEADERS = script/zcash_script.h
libzcash_script_la_SOURCES = \
crypto/hmac_sha512.cpp \
crypto/ripemd160.cpp \
crypto/sha1.cpp \
crypto/sha256.cpp \
crypto/sha512.cpp \
hash.cpp \
primitives/transaction.cpp \
primitives/tx_version_info.cpp \
pubkey.cpp \
script/zcash_script.cpp \
script/interpreter.cpp \
script/script.cpp \
uint256.cpp \
util/strencodings.cpp \
zip317.cpp
$(crypto_libbitcoin_crypto_a_SOURCES) \
$(libbitcoin_script_a_SOURCES) \
$(libcxxbridge_a_SOURCES) \
support/cleanse.cpp \
uint256.cpp
if GLIBC_BACK_COMPAT
libzcash_script_la_SOURCES += compat/glibc_compat.cpp
endif
libzcash_script_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libzcash_script_la_LIBADD = $(LIBSECP256K1)
libzcash_script_la_LIBADD = $(LIBRUSTZCASH) $(LIBSECP256K1)
libzcash_script_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/rust/include -I$(srcdir)/rust/gen/include -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
libzcash_script_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

View File

@ -31,6 +31,8 @@ bench_bench_bitcoin_LDADD = \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UNIVALUE) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_SCRIPT) \
$(LIBBITCOIN_CRYPTO) \
$(LIBCXXBRIDGE) \
$(LIBLEVELDB) \

View File

@ -36,7 +36,7 @@ CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=0
endif
crc32c_libcrc32c_a_CPPFLAGS = $(AM_CPPFLAGS) $(CRC32C_CPPFLAGS_INT) $(CRC32C_CPPFLAGS)
crc32c_libcrc32c_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
crc32c_libcrc32c_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -Wno-error
crc32c_libcrc32c_a_SOURCES =
crc32c_libcrc32c_a_SOURCES += crc32c/include/crc32c/crc32c.h

View File

@ -50,6 +50,7 @@ zcash_gtest_SOURCES = \
gtest/test_transaction_builder.h \
gtest/test_txid.cpp \
gtest/test_upgrades.cpp \
gtest/test_util_string.cpp \
gtest/test_validation.cpp \
gtest/test_weightedmap.cpp \
gtest/test_zip32.cpp \
@ -75,6 +76,8 @@ zcash_gtest_LDADD = \
$(LIBBITCOIN_WALLET) \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_SCRIPT) \
$(LIBBITCOIN_ZMQ) \
$(LIBBITCOIN_PROTON) \
$(LIBBITCOIN_CRYPTO) \

View File

@ -23,6 +23,7 @@ LEVELDB_CPPFLAGS_INT += -DHAVE_SNAPPY=0 -DHAVE_CRC32C=1
LEVELDB_CPPFLAGS_INT += -DHAVE_FDATASYNC=@HAVE_FDATASYNC@
LEVELDB_CPPFLAGS_INT += -DHAVE_FULLFSYNC=@HAVE_FULLFSYNC@
LEVELDB_CPPFLAGS_INT += -DHAVE_O_CLOEXEC=@HAVE_O_CLOEXEC@
LEVELDB_CPPFLAGS_INT += -DFALLTHROUGH_INTENDED=[[fallthrough]]
if WORDS_BIGENDIAN
LEVELDB_CPPFLAGS_INT += -DLEVELDB_IS_BIG_ENDIAN=1
@ -37,7 +38,7 @@ LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_POSIX
endif
leveldb_libleveldb_a_CPPFLAGS = $(AM_CPPFLAGS) $(LEVELDB_CPPFLAGS_INT) $(LEVELDB_CPPFLAGS)
leveldb_libleveldb_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
leveldb_libleveldb_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -Wno-error
leveldb_libleveldb_a_SOURCES=
leveldb_libleveldb_a_SOURCES += leveldb/port/port_stdcxx.h

View File

@ -90,7 +90,6 @@ BITCOIN_TESTS =\
test/net_tests.cpp \
test/netbase_tests.cpp \
test/pmt_tests.cpp \
test/policyestimator_tests.cpp \
test/pow_tests.cpp \
test/prevector_tests.cpp \
test/raii_event_tests.cpp \
@ -138,7 +137,7 @@ if ENABLE_WALLET
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
endif
test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBCXXBRIDGE) $(LIBUNIVALUE) \
test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_SCRIPT) $(LIBBITCOIN_CRYPTO) $(LIBCXXBRIDGE) $(LIBUNIVALUE) \
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

View File

@ -6,7 +6,6 @@
#include "amount.h"
#include "consensus/consensus.h"
#include "policy/fees.h"
#include "tinyformat.h"
@ -24,7 +23,7 @@ CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)
CAmount CFeeRate::GetFeeForRelay(size_t nSize) const
{
return std::min(GetFee(nSize), DEFAULT_FEE);
return std::min(GetFee(nSize), LEGACY_DEFAULT_FEE);
}
CAmount CFeeRate::GetFee(size_t nSize) const

View File

@ -32,6 +32,9 @@ extern const std::string MINOR_CURRENCY_UNIT;
static const CAmount MAX_MONEY = 21000000 * COIN;
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
/** The legacy default fee that was defined in ZIP 313. */
static const CAmount LEGACY_DEFAULT_FEE = 1000;
/** Type-safe wrapper class to for fee rates
* (how much to pay based on transaction size)
*/

View File

@ -20,7 +20,6 @@ main(int argc, char** argv)
{
SHA256AutoDetect();
ECC_Start();
auto globalVerifyHandle = new ECCVerifyHandle();
SetupEnvironment();
fPrintToDebugLog = false; // don't want to write to debug log file

View File

@ -99,24 +99,20 @@ static void JoinSplitSig(benchmark::State& state)
static void SaplingSpend(benchmark::State& state)
{
SpendDescription spend;
CDataStream ss(
ParseHex("8c6cf86bbb83bf0d075e5bd9bb4b5cd56141577be69f032880b11e26aa32aa5ef09fd00899e4b469fb11f38e9d09dc0379f0b11c23b5fe541765f76695120a03f0261d32af5d2a2b1e5c9a04200cd87d574dc42349de9790012ce560406a8a876a1e54cfcdc0eb74998abec2a9778330eeb2a0ac0e41d0c9ed5824fbd0dbf7da930ab299966ce333fd7bc1321dada0817aac5444e02c754069e218746bf879d5f2a20a8b028324fb2c73171e63336686aa5ec2e6e9a08eb18b87c14758c572f4531ccf6b55d09f44beb8b47563be4eff7a52598d80959dd9c9fee5ac4783d8370cb7d55d460053d3e067b5f9fe75ff2722623fb1825fcba5e9593d4205b38d1f502ff03035463043bd393a5ee039ce75a5d54f21b395255df6627ef96751566326f7d4a77d828aa21b1827282829fcbc42aad59cdb521e1a3aaa08b99ea8fe7fff0a04da31a52260fc6daeccd79bb877bdd8506614282258e15b3fe74bf71a93f4be3b770119edf99a317b205eea7d5ab800362b97384273888106c77d633600"),
SER_NETWORK,
PROTOCOL_VERSION);
ss >> spend;
auto spendBytes = ParseHex("8c6cf86bbb83bf0d075e5bd9bb4b5cd56141577be69f032880b11e26aa32aa5ef09fd00899e4b469fb11f38e9d09dc0379f0b11c23b5fe541765f76695120a03f0261d32af5d2a2b1e5c9a04200cd87d574dc42349de9790012ce560406a8a876a1e54cfcdc0eb74998abec2a9778330eeb2a0ac0e41d0c9ed5824fbd0dbf7da930ab299966ce333fd7bc1321dada0817aac5444e02c754069e218746bf879d5f2a20a8b028324fb2c73171e63336686aa5ec2e6e9a08eb18b87c14758c572f4531ccf6b55d09f44beb8b47563be4eff7a52598d80959dd9c9fee5ac4783d8370cb7d55d460053d3e067b5f9fe75ff2722623fb1825fcba5e9593d4205b38d1f502ff03035463043bd393a5ee039ce75a5d54f21b395255df6627ef96751566326f7d4a77d828aa21b1827282829fcbc42aad59cdb521e1a3aaa08b99ea8fe7fff0a04da31a52260fc6daeccd79bb877bdd8506614282258e15b3fe74bf71a93f4be3b770119edf99a317b205eea7d5ab800362b97384273888106c77d633600");
auto spend = sapling::parse_v4_spend({spendBytes.data(), spendBytes.size()});
uint256 dataToBeSigned = uint256S("0x2dbf83fe7b88a7cbd80fac0c719483906bb9a0c4fc69071e4780d5f2c76e592c");
auto ctx = sapling::init_verifier();
while (state.KeepRunning()) {
ctx->check_spend(
spend.cv.GetRawBytes(),
spend.anchor.GetRawBytes(),
spend.nullifier.GetRawBytes(),
spend.rk.GetRawBytes(),
spend.zkproof,
spend.spendAuthSig,
spend->cv(),
spend->anchor(),
spend->nullifier(),
spend->rk(),
spend->zkproof(),
spend->spend_auth_sig(),
dataToBeSigned.GetRawBytes()
);
}
@ -124,21 +120,17 @@ static void SaplingSpend(benchmark::State& state)
static void SaplingOutput(benchmark::State& state)
{
OutputDescription output;
CDataStream ss(
ParseHex("edd742af18857e5ec2d71d346a7fe2ac97c137339bd5268eea86d32e0ff4f38f76213fa8cfed3347ac4e8572dd88aff395c0c10a59f8b3f49d2bc539ed6c726667e29d4763f914ddd0abf1cdfa84e44de87c233434c7e69b8b5b8f4623c8aa444163425bae5cef842972fed66046c1c6ce65c866ad894d02e6e6dcaae7a962d9f2ef95757a09c486928e61f0f7aed90ad0a542b0d3dc5fe140dfa7626b9315c77e03b055f19cbacd21a866e46f06c00e0c7792b2a590a611439b510a9aaffcf1073bad23e712a9268b36888e3727033eee2ab4d869f54a843f93b36ef489fb177bf74b41a9644e5d2a0a417c6ac1c8869bc9b83273d453f878ed6fd96b82a5939903f7b64ecaf68ea16e255a7fb7cc0b6d8b5608a1c6b0ed3024cc62c2f0f9c5cfc7b431ae6e9d40815557aa1d010523f9e1960de77b2274cb6710d229d475c87ae900183206ba90cb5bbc8ec0df98341b82726c705e0308ca5dc08db4db609993a1046dfb43dfd8c760be506c0bed799bb2205fc29dc2e654dce731034a23b0aaf6da0199248702ee0523c159f41f4cbfff6c35ace4dd9ae834e44e09c76a0cbdda1d3f6a2c75ad71212daf9575ab5f09ca148718e667f29ddf18c8a330a86ace18a86e89454653902aa393c84c6b694f27d0d42e24e7ac9fe34733de5ec15f5066081ce912c62c1a804a2bb4dedcef7cc80274f6bb9e89e2fce91dc50d6a73c8aefb9872f1cf3524a92626a0b8f39bbf7bf7d96ca2f770fc04d7f457021c536a506a187a93b2245471ddbfb254a71bc4a0d72c8d639a31c7b1920087ffca05c24214157e2e7b28184e91989ef0b14f9b34c3dc3cc0ac64226b9e337095870cb0885737992e120346e630a416a9b217679ce5a778fb15779c136bcecca5efe79012013d77d90b4e99dd22c8f35bc77121716e160d05bd30d288ee8886390ee436f85bdc9029df888a3a3326d9d4ddba5cb5318b3274928829d662e96fea1d601f7a306251ed8c6cc4e5a3a7a98c35a3650482a0eee08f3b4c2da9b22947c96138f1505c2f081f8972d429f3871f32bef4aaa51aa6945df8e9c9760531ac6f627d17c1518202818a91ca304fb4037875c666060597976144fcbbc48a776a2c61beb9515fa8f3ae6d3a041d320a38a8ac75cb47bb9c866ee497fc3cd13299970c4b369c1c2ceb4220af082fbecdd8114492a8e4d713b5a73396fd224b36c1185bd5e20d683e6c8db35346c47ae7401988255da7cfffdced5801067d4d296688ee8fe424b4a8a69309ce257eefb9345ebfda3f6de46bb11ec94133e1f72cd7ac54934d6cf17b3440800e70b80ebc7c7bfc6fb0fc2c"),
SER_NETWORK,
PROTOCOL_VERSION);
ss >> output;
auto outputBytes = ParseHex("edd742af18857e5ec2d71d346a7fe2ac97c137339bd5268eea86d32e0ff4f38f76213fa8cfed3347ac4e8572dd88aff395c0c10a59f8b3f49d2bc539ed6c726667e29d4763f914ddd0abf1cdfa84e44de87c233434c7e69b8b5b8f4623c8aa444163425bae5cef842972fed66046c1c6ce65c866ad894d02e6e6dcaae7a962d9f2ef95757a09c486928e61f0f7aed90ad0a542b0d3dc5fe140dfa7626b9315c77e03b055f19cbacd21a866e46f06c00e0c7792b2a590a611439b510a9aaffcf1073bad23e712a9268b36888e3727033eee2ab4d869f54a843f93b36ef489fb177bf74b41a9644e5d2a0a417c6ac1c8869bc9b83273d453f878ed6fd96b82a5939903f7b64ecaf68ea16e255a7fb7cc0b6d8b5608a1c6b0ed3024cc62c2f0f9c5cfc7b431ae6e9d40815557aa1d010523f9e1960de77b2274cb6710d229d475c87ae900183206ba90cb5bbc8ec0df98341b82726c705e0308ca5dc08db4db609993a1046dfb43dfd8c760be506c0bed799bb2205fc29dc2e654dce731034a23b0aaf6da0199248702ee0523c159f41f4cbfff6c35ace4dd9ae834e44e09c76a0cbdda1d3f6a2c75ad71212daf9575ab5f09ca148718e667f29ddf18c8a330a86ace18a86e89454653902aa393c84c6b694f27d0d42e24e7ac9fe34733de5ec15f5066081ce912c62c1a804a2bb4dedcef7cc80274f6bb9e89e2fce91dc50d6a73c8aefb9872f1cf3524a92626a0b8f39bbf7bf7d96ca2f770fc04d7f457021c536a506a187a93b2245471ddbfb254a71bc4a0d72c8d639a31c7b1920087ffca05c24214157e2e7b28184e91989ef0b14f9b34c3dc3cc0ac64226b9e337095870cb0885737992e120346e630a416a9b217679ce5a778fb15779c136bcecca5efe79012013d77d90b4e99dd22c8f35bc77121716e160d05bd30d288ee8886390ee436f85bdc9029df888a3a3326d9d4ddba5cb5318b3274928829d662e96fea1d601f7a306251ed8c6cc4e5a3a7a98c35a3650482a0eee08f3b4c2da9b22947c96138f1505c2f081f8972d429f3871f32bef4aaa51aa6945df8e9c9760531ac6f627d17c1518202818a91ca304fb4037875c666060597976144fcbbc48a776a2c61beb9515fa8f3ae6d3a041d320a38a8ac75cb47bb9c866ee497fc3cd13299970c4b369c1c2ceb4220af082fbecdd8114492a8e4d713b5a73396fd224b36c1185bd5e20d683e6c8db35346c47ae7401988255da7cfffdced5801067d4d296688ee8fe424b4a8a69309ce257eefb9345ebfda3f6de46bb11ec94133e1f72cd7ac54934d6cf17b3440800e70b80ebc7c7bfc6fb0fc2c");
auto output = sapling::parse_v4_output({outputBytes.data(), outputBytes.size()});
auto ctx = sapling::init_verifier();
while (state.KeepRunning()) {
ctx->check_output(
output.cv.GetRawBytes(),
output.cmu.GetRawBytes(),
output.ephemeralKey.GetRawBytes(),
output.zkproof
output->cv(),
output->cmu(),
output->ephemeral_key(),
output->zkproof()
);
}
}

View File

@ -499,8 +499,6 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& strInput)
class Secp256k1Init
{
ECCVerifyHandle globalVerifyHandle;
public:
Secp256k1Init() {
ECC_Start();

View File

@ -16,8 +16,8 @@
//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 5
#define CLIENT_VERSION_MINOR 5
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_MINOR 6
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 50
//! Set to true for release, false for prerelease or test build

View File

@ -8,7 +8,6 @@
#include "memusage.h"
#include "random.h"
#include "version.h"
#include "policy/fees.h"
#include <assert.h>
@ -59,6 +58,8 @@ uint256 CCoinsViewBacked::GetBestAnchor(ShieldedType type) const { return base->
HistoryIndex CCoinsViewBacked::GetHistoryLength(uint32_t epochId) const { return base->GetHistoryLength(epochId); }
HistoryNode CCoinsViewBacked::GetHistoryAt(uint32_t epochId, HistoryIndex index) const { return base->GetHistoryAt(epochId, index); }
uint256 CCoinsViewBacked::GetHistoryRoot(uint32_t epochId) const { return base->GetHistoryRoot(epochId); }
std::optional<libzcash::LatestSubtree> CCoinsViewBacked::GetLatestSubtree(ShieldedType type) const { return base->GetLatestSubtree(type); }
std::optional<libzcash::SubtreeData> CCoinsViewBacked::GetSubtreeData(ShieldedType type, libzcash::SubtreeIndex index) const { return base->GetSubtreeData(type, index); }
void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; }
bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins,
const uint256 &hashBlock,
@ -71,12 +72,14 @@ bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins,
CNullifiersMap &mapSproutNullifiers,
CNullifiersMap &mapSaplingNullifiers,
CNullifiersMap &mapOrchardNullifiers,
CHistoryCacheMap &historyCacheMap) {
CHistoryCacheMap &historyCacheMap,
SubtreeCache &cacheSaplingSubtrees,
SubtreeCache &cacheOrchardSubtrees) {
return base->BatchWrite(mapCoins, hashBlock,
hashSproutAnchor, hashSaplingAnchor, hashOrchardAnchor,
mapSproutAnchors, mapSaplingAnchors, mapOrchardAnchors,
mapSproutNullifiers, mapSaplingNullifiers, mapOrchardNullifiers,
historyCacheMap);
historyCacheMap, cacheSaplingSubtrees, cacheOrchardSubtrees);
}
bool CCoinsViewBacked::GetStats(CCoinsStats &stats) const { return base->GetStats(stats); }
@ -98,6 +101,8 @@ size_t CCoinsViewCache::DynamicMemoryUsage() const {
memusage::DynamicUsage(cacheSaplingNullifiers) +
memusage::DynamicUsage(cacheOrchardNullifiers) +
memusage::DynamicUsage(historyCacheMap) +
memusage::DynamicUsage(cacheSaplingSubtrees) +
memusage::DynamicUsage(cacheOrchardSubtrees) +
cachedCoinsUsage;
}
@ -242,6 +247,31 @@ uint256 CCoinsViewCache::GetHistoryRoot(uint32_t epochId) const {
return SelectHistoryCache(epochId).root;
}
std::optional<libzcash::LatestSubtree> CCoinsViewCache::GetLatestSubtree(ShieldedType type) const {
switch (type) {
case SAPLING:
return cacheSaplingSubtrees.GetLatestSubtree(base);
case ORCHARD:
return cacheOrchardSubtrees.GetLatestSubtree(base);
default:
throw std::runtime_error("GetLatestSubtree: unsupported shielded type");
}
}
std::optional<libzcash::SubtreeData> CCoinsViewCache::GetSubtreeData(
ShieldedType type,
libzcash::SubtreeIndex index) const
{
switch (type) {
case SAPLING:
return cacheSaplingSubtrees.GetSubtreeData(base, index);
case ORCHARD:
return cacheOrchardSubtrees.GetSubtreeData(base, index);
default:
throw std::runtime_error("GetSubtreeData: unsupported shielded type");
}
}
template<typename Tree, typename Cache, typename CacheIterator, typename CacheEntry>
void CCoinsViewCache::AbstractPushAnchor(
const Tree &tree,
@ -608,6 +638,42 @@ void CCoinsViewCache::PopHistoryNode(uint32_t epochId) {
}
}
void CCoinsViewCache::PushSubtree(ShieldedType type, libzcash::SubtreeData subtree)
{
switch(type) {
case SAPLING:
return cacheSaplingSubtrees.PushSubtree(base, subtree);
case ORCHARD:
return cacheOrchardSubtrees.PushSubtree(base, subtree);
default:
throw std::runtime_error("PushSubtree: unsupported shielded type");
}
}
void CCoinsViewCache::PopSubtree(ShieldedType type)
{
switch(type) {
case SAPLING:
return cacheSaplingSubtrees.PopSubtree(base);
case ORCHARD:
return cacheOrchardSubtrees.PopSubtree(base);
default:
throw std::runtime_error("PopSubtree: unsupported shielded type");
}
}
void CCoinsViewCache::ResetSubtrees(ShieldedType type)
{
switch(type) {
case SAPLING:
return cacheSaplingSubtrees.ResetSubtrees();
case ORCHARD:
return cacheOrchardSubtrees.ResetSubtrees();
default:
throw std::runtime_error("ResetSubtrees: unsupported shielded type");
}
}
template<typename Tree, typename Cache, typename CacheEntry>
void CCoinsViewCache::AbstractPopAnchor(
const uint256 &newrt,
@ -679,8 +745,8 @@ void CCoinsViewCache::SetNullifiers(const CTransaction& tx, bool spent) {
ret.first->second.flags |= CNullifiersCacheEntry::DIRTY;
}
}
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
std::pair<CNullifiersMap::iterator, bool> ret = cacheSaplingNullifiers.insert(std::make_pair(spendDescription.nullifier, CNullifiersCacheEntry()));
for (const auto& spendDescription : tx.GetSaplingSpends()) {
std::pair<CNullifiersMap::iterator, bool> ret = cacheSaplingNullifiers.insert(std::make_pair(uint256::FromRawBytes(spendDescription.nullifier()), CNullifiersCacheEntry()));
ret.first->second.entered = spent;
ret.first->second.flags |= CNullifiersCacheEntry::DIRTY;
}
@ -874,7 +940,9 @@ bool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins,
CNullifiersMap &mapSproutNullifiers,
CNullifiersMap &mapSaplingNullifiers,
CNullifiersMap &mapOrchardNullifiers,
CHistoryCacheMap &historyCacheMapIn) {
CHistoryCacheMap &historyCacheMapIn,
SubtreeCache &cacheSaplingSubtreesIn,
SubtreeCache &cacheOrchardSubtreesIn) {
assert(!hasModifier);
for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end();) {
if (it->second.flags & CCoinsCacheEntry::DIRTY) { // Ignore non-dirty entries (optimization).
@ -920,6 +988,9 @@ bool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins,
::BatchWriteHistory(historyCacheMap, historyCacheMapIn);
cacheSaplingSubtrees.BatchWrite(base, cacheSaplingSubtreesIn);
cacheOrchardSubtrees.BatchWrite(base, cacheOrchardSubtreesIn);
hashSproutAnchor = hashSproutAnchorIn;
hashSaplingAnchor = hashSaplingAnchorIn;
hashOrchardAnchor = hashOrchardAnchorIn;
@ -928,6 +999,11 @@ bool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins,
}
bool CCoinsViewCache::Flush() {
// This ensures that before we pass the subtree caches
// they have been initialized correctly
cacheSaplingSubtrees.Initialize(base);
cacheOrchardSubtrees.Initialize(base);
bool fOk = base->BatchWrite(cacheCoins,
hashBlock,
hashSproutAnchor,
@ -939,7 +1015,9 @@ bool CCoinsViewCache::Flush() {
cacheSproutNullifiers,
cacheSaplingNullifiers,
cacheOrchardNullifiers,
historyCacheMap);
historyCacheMap,
cacheSaplingSubtrees,
cacheOrchardSubtrees);
cacheCoins.clear();
cacheSproutAnchors.clear();
cacheSaplingAnchors.clear();
@ -948,6 +1026,8 @@ bool CCoinsViewCache::Flush() {
cacheSaplingNullifiers.clear();
cacheOrchardNullifiers.clear();
historyCacheMap.clear();
cacheSaplingSubtrees.clear();
cacheOrchardSubtrees.clear();
cachedCoinsUsage = 0;
return fOk;
}
@ -1021,10 +1101,11 @@ tl::expected<void, UnsatisfiedShieldedReq> CCoinsViewCache::CheckShieldedRequire
intermediates.insert(std::make_pair(tree.root(), tree));
}
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
if (GetNullifier(spendDescription.nullifier, SAPLING)) { // Prevent double spends
for (const auto& spendDescription : tx.GetSaplingSpends()) {
uint256 nullifier = uint256::FromRawBytes(spendDescription.nullifier());
if (GetNullifier(nullifier, SAPLING)) { // Prevent double spends
auto txid = tx.GetHash().ToString();
auto nf = spendDescription.nullifier.ToString();
auto nf = nullifier.ToString();
TracingWarn("consensus", "Sapling double-spend detected",
"txid", txid.c_str(),
"nf", nf.c_str());
@ -1032,9 +1113,10 @@ tl::expected<void, UnsatisfiedShieldedReq> CCoinsViewCache::CheckShieldedRequire
}
SaplingMerkleTree tree;
if (!GetSaplingAnchorAt(spendDescription.anchor, tree)) {
uint256 rt = uint256::FromRawBytes(spendDescription.anchor());
if (!GetSaplingAnchorAt(rt, tree)) {
auto txid = tx.GetHash().ToString();
auto anchor = spendDescription.anchor.ToString();
auto anchor = rt.ToString();
TracingWarn("consensus", "Transaction uses unknown Sapling anchor",
"txid", txid.c_str(),
"anchor", anchor.c_str());
@ -1101,3 +1183,156 @@ CCoinsModifier::~CCoinsModifier()
cache.cachedCoinsUsage += it->second.coins.DynamicMemoryUsage();
}
}
void SubtreeCache::clear() {
initialized = false;
parentLatestSubtree = std::nullopt;
newSubtrees.clear();
}
void SubtreeCache::Initialize(CCoinsView *parentView)
{
if (!initialized) {
parentLatestSubtree = parentView->GetLatestSubtree(type);
initialized = true;
}
}
std::optional<libzcash::LatestSubtree> SubtreeCache::GetLatestSubtree(CCoinsView *parentView) {
Initialize(parentView);
if (newSubtrees.size() > 0) {
// The latest subtree is in our cache.
libzcash::SubtreeIndex index;
if (parentLatestSubtree.has_value()) {
// The best subtree index is newSubtrees.size() larger than
// our parent view's subtree index.
index = parentLatestSubtree.value().index + newSubtrees.size();
} else {
// The parent view has no subtrees
index = newSubtrees.size() - 1;
}
auto lastSubtree = newSubtrees.back();
return libzcash::LatestSubtree(index, lastSubtree.root, lastSubtree.nHeight);
} else {
return parentLatestSubtree;
}
}
std::optional<libzcash::SubtreeData> SubtreeCache::GetSubtreeData(CCoinsView *parentView, libzcash::SubtreeIndex index) {
Initialize(parentView);
auto latestSubtree = GetLatestSubtree(parentView);
if (!latestSubtree.has_value() || latestSubtree.value().index < index) {
// This subtree isn't complete in our local view
return std::nullopt;
}
if (parentLatestSubtree.has_value()) {
if (index <= parentLatestSubtree.value().index) {
// This subtree in question must have previously been flushed to the parent cache layer,
// so we ask for it there.
return parentView->GetSubtreeData(type, index);
} else {
// Get the index into our local `newSubtrees` where the subtree should
// be located.
auto localIndex = index - (parentLatestSubtree.value().index + 1);
assert(newSubtrees.size() > localIndex);
return newSubtrees[localIndex];
}
} else {
// The index we've been given is the index into our local `newSubtrees`
// since the parent view has no subtrees.
assert(newSubtrees.size() > index);
return newSubtrees[index];
}
}
void SubtreeCache::PushSubtree(CCoinsView *parentView, libzcash::SubtreeData subtree) {
Initialize(parentView);
newSubtrees.push_back(subtree);
}
void SubtreeCache::PopSubtree(CCoinsView *parentView) {
Initialize(parentView);
if (newSubtrees.empty()) {
// Try to pop from the parent view
if (parentLatestSubtree.has_value()) {
libzcash::SubtreeIndex parentIndex = parentLatestSubtree.value().index;
if (parentIndex == 0) {
// This pops the only subtree left in the parent view.
parentLatestSubtree = std::nullopt;
} else {
parentIndex -= 1;
auto newParent = parentView->GetSubtreeData(type, parentIndex);
if (!newParent.has_value()) {
throw std::runtime_error("cache inconsistency; parent view does not have subtree");
}
parentLatestSubtree = libzcash::LatestSubtree(
parentIndex,
newParent.value().root,
newParent.value().nHeight
);
}
} else {
throw std::runtime_error("tried to pop a subtree from an empty subtree list");
}
} else {
newSubtrees.pop_back();
}
}
void SubtreeCache::ResetSubtrees() {
// This ensures that all subtrees will be popped from the parent view
initialized = true;
parentLatestSubtree = std::nullopt;
newSubtrees.clear();
}
void SubtreeCache::BatchWrite(CCoinsView *parentView, SubtreeCache &childMap) {
Initialize(parentView);
auto bestSubtree = GetLatestSubtree(parentView);
if (!bestSubtree.has_value()) {
// We do not have any local subtrees, so it cannot be possible
// for the childMap to think we have any latest subtree, which
// suggests the wrong childMap was passed or the wrong backing
// view has been set in the cache.
if (childMap.parentLatestSubtree.has_value()) {
throw std::runtime_error("cache inconsistency; child view of parent's latest subtree cannot be correct");
}
} else {
uint64_t pops;
// Compute the number of times we must PopSubtree until our best subtree
// is the same as the child's parentLatestSubtree index.
if (childMap.parentLatestSubtree.has_value()) {
if (childMap.parentLatestSubtree.value().index > bestSubtree.value().index) {
throw std::runtime_error("cache inconsistency; child view of parent's latest subtree cannot be correct");
}
pops = bestSubtree.value().index - childMap.parentLatestSubtree.value().index;
} else {
// We have to pop everything.
pops = bestSubtree.value().index + 1;
}
for (uint64_t i = 0; i < pops; i++) {
PopSubtree(parentView);
}
}
// Now we can inherit the child's new subtrees
newSubtrees.insert(
newSubtrees.end(),
std::make_move_iterator(childMap.newSubtrees.begin()),
std::make_move_iterator(childMap.newSubtrees.end())
);
childMap.clear();
}

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