Compare commits

...

115 Commits

Author SHA1 Message Date
Jack Grigg 2352fbc1ed
Merge pull request #7030 from daira/nicer-bip0039-language-handling
Make the handling of bip0039 languages nicer
2025-05-20 16:31:44 +01:00
Daira-Emma Hopwood 78695a7d63 Make the handling of bip0039 languages nicer.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-05-20 10:40:28 +01:00
Jack Grigg 4256156874
Merge pull request #7029 from pacu/fix-test-compiler-error
Fixes test/sighash_tests.cpp compiler error
2025-05-19 13:21:37 +01:00
Jack Grigg 3b5ecb2b5d
Merge pull request #7027 from str4d/rust-updates-6.3.0
Rust updates for 6.3.0
2025-05-19 13:20:17 +01:00
pacu 9c593754c9
Fixes test/sighash_tests.cpp compiler error
closes #7028
2025-05-15 13:51:45 -03:00
Jack Grigg dfec26eb1d rust: thiserror 2 2025-05-09 00:27:58 +00:00
Jack Grigg 7cdc7457a4 depends: cxx 1.0.158 2025-05-09 00:21:54 +00:00
Jack Grigg 2403a0aed9 rust: clearscreen 4 2025-05-08 23:39:55 +00:00
Jack Grigg be5ff646dc rust: Migrate to `zcash_primitives 0.21` 2025-05-08 23:33:04 +00:00
Jack Grigg e90508083e rust: Migrate to `bip0039 0.12` 2025-05-08 23:33:04 +00:00
Kris Nuttycombe 1f1f7a385a
Merge pull request #7018 from zcash/version-6.2.0
Merge 6.2.0 back into the main branch
2025-04-21 12:00:53 -06:00
Kris Nuttycombe e3119e5b72 ci: Use the `clone_url` field of the `repo` object for `git fetch` to check a PR
This also modifies changed file list parsing to avoid the need for a
shell variable.
2025-04-17 14:29:32 -06:00
Daira-Emma Hopwood c2cbbc3ae2 Merge remote-tracking branch 'origin' into version-6.2.0 2025-04-17 13:47:00 +01:00
Kris Nuttycombe a78675000b
Merge pull request #7021 from zcash/release-v6.2.0
Release v6.2.0
2025-04-17 06:16:07 -06:00
y4ssi ff279fdb6a Update ci.yml
Remove CI for ubuntu 20.04
2025-04-16 22:22:51 -06:00
Kris Nuttycombe 76db11eba1
Merge pull request #7020 from zcash/remove_ubuntu2004_build
Remove CI for ubuntu 20.04
2025-04-16 22:17:51 -06:00
y4ssi bb59677ec9 Update ci.yml
Remove CI for ubuntu 20.04
2025-04-16 21:51:21 -06:00
Daira-Emma Hopwood 654a8be227 make-release.py: Updated book for 6.2.0. 2025-04-16 23:59:38 +01:00
Daira-Emma Hopwood 07ef131cfe make-release.py: Updated release notes and changelog for 6.2.0. 2025-04-16 23:59:38 +01:00
Daira-Emma Hopwood dfa67a9939 make-release.py: Updated manpages for 6.2.0. 2025-04-16 23:59:37 +01:00
Daira-Emma Hopwood 9032e57fdd make-release.py: Versioning changes for 6.2.0. 2025-04-16 23:53:22 +01:00
Daira-Emma Hopwood 95d70e77e4 CI: Test on Ubuntu 24.04 as Tier 3.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-16 23:49:30 +01:00
Daira-Emma Hopwood aa55bdcaae Move Ubuntu 22.04 support to Tier 1.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-16 23:44:51 +01:00
Daira-Emma Hopwood 07059a8ad9 CI: Bump the Ubuntu runner version used for Debian.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-16 23:41:51 +01:00
Daira-Emma Hopwood b3c9ae5455 contrib/devtools/symbol-check.py: Update allowed library versions and documentation.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-16 23:40:55 +01:00
Daira-Emma Hopwood 884dfe49c9 Remove Ubuntu 20.04 from the list of supported platforms because GitHub
no longer supports CI runners for it.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-16 23:09:43 +01:00
Daira-Emma Hopwood bee8d1df45 Postpone C++ dependency updates for the v6.2.0 release.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-16 22:24:27 +01:00
Kris Nuttycombe abf417ef22
Merge pull request #7017 from daira/release-v6.2.0-rc1
Release v6.2.0-rc1
2025-04-14 14:48:14 -06:00
Daira-Emma Hopwood 99557f8a3d Update audits.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-10 21:28:06 +01:00
Daira-Emma Hopwood 024d47011f Trivial doc update to poke CI.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-10 20:54:24 +01:00
Daira-Emma Hopwood bfb620e47e make-release.py: Updated book for 6.2.0-rc1. 2025-04-10 18:44:12 +01:00
Daira-Emma Hopwood 87661dcfbc make-release.py: Updated release notes and changelog for 6.2.0-rc1. 2025-04-10 18:44:12 +01:00
Daira-Emma Hopwood 912da4bfb6 make-release.py: Updated manpages for 6.2.0-rc1. 2025-04-10 18:44:11 +01:00
Daira-Emma Hopwood ab7ddaa963 make-release.py: Versioning changes for 6.2.0-rc1. 2025-04-10 18:39:55 +01:00
Daira-Emma Hopwood 3f3cc10672 Correction to the 6.2.0-rc1 release notes.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-10 18:39:09 +01:00
Daira-Emma Hopwood ece9c517fe Update crossbeam-channel and tokio in `Cargo.lock` to avoid vulnerable
versions and pass `cargo audit`.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-10 18:39:09 +01:00
Daira-Emma Hopwood 52c8856ce6 Update links in the README.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-10 18:39:09 +01:00
Daira-Emma Hopwood ed718d0773 Fix URL to the Rust Target Tier Policy.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-10 18:39:09 +01:00
Daira-Emma Hopwood a8aa33152c Postpone native updates (after thorough checking with @y4ssi).
Co-authored-by: Yasser <yasser@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-10 18:39:09 +01:00
Kris Nuttycombe 7ac250c93b
Merge pull request #7015 from daira/deprecations-for-6.2.0
Deprecations for 6.2.0
2025-04-08 21:32:52 -06:00
Daira-Emma Hopwood bfb2cf9255 Add `i-am-aware-zcashd-will-be-replaced-by-zebrad-and-zallet-in-2025` to
release notes.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 03:32:53 +01:00
Daira-Emma Hopwood 638ea507be Allow the RPC help to be displayed for disabled methods.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 03:32:53 +01:00
Daira-Emma Hopwood f8a5d39464 Fix RPC tests broken by deprecations.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 03:32:53 +01:00
Daira-Emma Hopwood f8a2c46094 Wording changes to address review comments.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 03:32:53 +01:00
Daira-Emma Hopwood 50b2d2c6c3 Default-disable the RPC methods { `z_getbalance`, `getnetworkhashps` },
and the features { `gbt_oldhashes`, `deprecationinfo_deprecationheight` }.
Also make sure that the `addrtype` feature is default-disabled regardless
of the `ENABLE_WALLET` flag.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 03:32:53 +01:00
Daira-Emma Hopwood ba867612af Document that `z_getpaymentdisclosure` and `z_validatepaymentdisclosure`
are deprecated.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 02:31:45 +01:00
Daira-Emma Hopwood 8c965df2fd Cosmetics in deprecation messages.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 02:31:45 +01:00
Daira-Emma Hopwood 2767e56801 Deprecate RPC methods { `getnetworkhashps`, `keypoolrefill`, `settxfee`,
`createrawtransaction`, `fundrawtransaction`, `signrawtransaction` }.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 02:31:45 +01:00
Daira-Emma Hopwood 6cef229226 [doc] user/deprecation.md: add the version in which each feature was default-disabled.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2025-04-09 02:31:45 +01:00
Daira-Emma Hopwood dacad3704a
Merge pull request #7014 from str4d/6982-deprecation-awareness
Add a warning modal for zcashd deprecation
2025-04-08 20:11:01 +01:00
Jack Grigg 48ba891366 Add a warning modal for zcashd deprecation
Closes zcash/zcash#6982.
2025-04-07 19:19:36 +00:00
Daira-Emma Hopwood e818c7dbd8
Merge pull request #6997 from LarryRuane/2025-01-leveldb-index-performance
dbwrapper: Bump max file size to 32 MiB (lightwalletd sync performance)
2025-04-07 16:53:17 +01:00
Jack Grigg 9714aa4cec
Merge pull request #7000 from LarryRuane/2025-01-shell-lint
fix CI lint error
2025-04-07 16:14:55 +01:00
Daira-Emma Hopwood 5c4fe92ef8
Merge pull request #7001 from sandakersmann/master
New checkpoint at block 2800000 for mainnet
2025-04-07 16:13:33 +01:00
Marius Kjærstad f9bc542925
New checkpoint at block 2800000 for mainnet 2025-01-27 06:17:01 +01:00
Larry Ruane 8013e2eb65 fix CI lint error
CI results:

Run ./test/lint/lint-shell.sh

In zcutil/libfuzzer/libfuzzer-build.sh line 67:
    shift
    ^---^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

For more information:
  https://www.shellcheck.net/wiki/SC2317 -- Command appears to be unreachable...
2025-01-23 12:08:42 -07:00
Maciej S. Szmigiero d48c5a9ec1 dbwrapper: Bump max file size to 32 MiB
The default max file size for LevelDB is 2 MiB, which results in the
LevelDB compaction code generating ~4 disk cache flushes per second when
syncing with the Bitcoin network.
These disk cache flushes are triggered by fdatasync() syscall issued by the
LevelDB compaction code when reaching the max file size.

If the database is on a HDD this flush rate brings the whole system to a
crawl.
It also results in very slow throughput since 2 MiB * 4 flushes per second
is about 8 MiB / second max throughput, while even an old HDD can pull
100 - 200 MiB / second streaming throughput.

Increase the max file size for LevelDB to 32 MiB instead so the flush rate
drops significantly and the system no longer gets so sluggish.

The new max file size value chosen is a compromise between the one that
works best for HDD and SSD performance, as determined by benchmarks done by
various people.

(cherry picked from commit bitcoin/bitcoin@b73d331937)
2025-01-09 12:05:40 -07:00
Jack Grigg a3435336b0
Merge pull request #6996 from zcash/update-deps
Update dependencies for 6.2.0
2025-01-07 21:25:42 +00:00
Jack Grigg 400dcdf83e CI: Migrate to `cargo-vet 0.10` 2025-01-07 20:33:39 +00:00
Jack Grigg 907a477c7f cargo update 2025-01-07 20:33:39 +00:00
Jack Grigg d21cb5409f depends: cxx 1.0.136 2025-01-07 20:33:39 +00:00
Jack Grigg 0aac0db813 cargo vet prune 2025-01-07 20:33:39 +00:00
Jack Grigg 9c0a8ad776 depends: native_cmake 3.31.3 2025-01-07 20:33:39 +00:00
Jack Grigg 90ef1beea4 depends: native_xxhash 0.8.3 2025-01-07 20:33:39 +00:00
Jack Grigg bf4c198e6b depends: native_fmt 11.1.1 2025-01-07 20:33:39 +00:00
Jack Grigg 8e68e5b181 depends: utfcpp 4.0.6 2025-01-07 20:33:39 +00:00
Jack Grigg e0c8daed68
Merge pull request #6995 from zcash/version-6.1.0
Merge 6.1.0 back into the main branch
2025-01-07 20:32:33 +00:00
Jack Grigg eea3d68e57
Merge pull request #6993 from zcash/release-v6.1.0
Release v6.1.0
2025-01-05 16:10:39 +00:00
Jack Grigg 3c3c6ae85b Update release notes with maintenance purpose 2025-01-02 19:25:26 +00:00
Jack Grigg 1847ee1b17 make-release.py: Updated book for 6.1.0. 2025-01-02 19:21:43 +00:00
Jack Grigg 64a32e0110 make-release.py: Updated release notes and changelog for 6.1.0. 2025-01-02 19:21:43 +00:00
Jack Grigg d66219bb03 make-release.py: Updated manpages for 6.1.0. 2025-01-02 19:21:41 +00:00
Jack Grigg 50c2ce6abb make-release.py: Versioning changes for 6.1.0. 2025-01-02 19:18:11 +00:00
Jack Grigg 26bdfcf9f0 qa: Postpone all dependency updates until after 6.1.0 2025-01-02 19:15:43 +00:00
Jack Grigg 4f9fb43a3d
Merge pull request #6987 from LarryRuane/2024-12-lockbox-value-logging
move Lockbox value logging behind category valuepool
2025-01-02 18:39:25 +00:00
Jack Grigg 44f6202c72
qa: Fix line wrapping in `show_help` 2025-01-02 17:23:22 +00:00
Larry Ruane 7b5029eb9f move Lockbox value logging behind category valuepool 2024-12-16 23:07:08 -07:00
Jack Grigg 99ad6fdc3a
Merge pull request #6964 from daira/mining-test-comment-offbyone
Miner tests: correct a comment, and add another similar comment where it applies
2024-10-24 06:27:41 +01:00
Jack Grigg 7fbb055123
Merge pull request #6965 from daira/fix-getblocksubsidy-suggestions
Fix getblocksubsidy suggestions
2024-10-24 06:26:28 +01:00
Jack Grigg 1e5eb36466
Merge pull request #6967 from daira/fix-test_checkblock
gtest/test_checkblock.cpp: fix a bug in MockCValidationState that was causing a test warning
2024-10-24 06:14:32 +01:00
Jack Grigg c6dfd89530
Merge pull request #6968 from daira/update-daira-emma-keys
Update Daira-Emma's gpg keys
2024-10-24 06:12:51 +01:00
Daira-Emma Hopwood f6540856d2 Update Daira-Emma Hopwood's gpg keys.
The key referred to by `daira-emma-old.asc` was used to sign the tags for
zcashd v1.0.0-rc1, v1.0.0-rc2, and v1.0.0-rc3. All other zcashd signatures
made by Daira-Emma used the key referred to by `daira-emma.asc`.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-09 15:12:17 +01:00
Daira-Emma Hopwood 7505afc78e Miner tests: correct a comment, and add another similar comment where it
applies. Doc-only.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-07 23:13:46 +01:00
Daira-Emma Hopwood a2f63ffcf4 gtest/test_checkblock.cpp: fix a bug in MockCValidationState that was
causing a test warning.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-07 22:48:47 +01:00
Daira-Emma Hopwood 4ddd3405c5 Simplify `GetActiveFundingStreamElements`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-07 22:00:27 +01:00
Daira-Emma Hopwood d60c51eb8d sapling::Builder: add funding stream outputs in a more predictable order.
Previously it was deterministic, but depended on details of the `operator<`
implementations of `FundingStreamRecipient`, `SaplingPaymentAddress`, and
`CScript`. Now it is just the same order as in `vFundingStreams`.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-07 22:00:27 +01:00
Daira-Emma Hopwood e44be4f1f4 Funding streams: Rename INSUFFICIENT_ADDRESSES to INSUFFICIENT_RECIPIENTS.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-07 21:52:51 +01:00
Daira-Emma Hopwood 238ffa4bec
Merge pull request #6966 from zcash/version-6.0.0
Version 6.0.0 post-release merge.
2024-10-07 21:44:58 +01:00
Kris Nuttycombe 857bd0d398
Merge pull request #6958 from zcash/release-v6.0.0
Release v6.0.0
2024-10-04 15:58:36 -06:00
Jack Grigg c61e5473ae
Merge pull request #6962 from daira/fix-miner-future-timestamp
Ensure that the "future timestamp" rule is correctly applied by block template construction
2024-10-04 13:19:37 +01:00
Jack Grigg 26939a9710
Merge pull request #6963 from str4d/fix-getblocksubsidy
Fix `getblocksubsidy`
2024-10-04 13:18:09 +01:00
Jack Grigg 97bba691ab Fix specification URL for NU6 lockbox 2024-10-04 08:48:57 +00:00
Jack Grigg bd17de8b42 test: Update `getblocksubsidy` test with NU6 mainnet funding streams 2024-10-04 08:48:06 +00:00
Jack Grigg 6c765107f1 rpc: Fetch correct funding streams in `getblocksubsidy`
The previous logic was indexing into the global funding streams list
with the local index into the active funding streams. This worked fine
for the first funding stream period, but once a funding stream ended and
another was enabled, the indices no longer matched.

We now return the `FundingStream` from `GetActiveFundingStreams`, as the
only user of that method is `getblocksubsidy`.
2024-10-04 08:28:54 +00:00
Daira-Emma Hopwood 9831458a4a Ensure that the "future timestamp" rule is correctly applied by block
template construction. fixes #6960

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-04 04:19:45 +01:00
Daira-Emma Hopwood a0602ebfb7 Changes necessary for NU6 funding streams and activation height.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-02 21:36:18 +00:00
Jack Grigg 74ff943c40 debian: Set urgency of 6.0.0 release to `high` 2024-10-02 20:48:07 +00:00
Jack Grigg 09cae52fc0 make-release.py: Updated book for 6.0.0. 2024-10-02 20:45:09 +00:00
Jack Grigg 337afb9d02 make-release.py: Updated release notes and changelog for 6.0.0. 2024-10-02 20:45:09 +00:00
Jack Grigg 4e1e6fe164 make-release.py: Updated manpages for 6.0.0. 2024-10-02 20:45:08 +00:00
Jack Grigg b7708cc68e make-release.py: Versioning changes for 6.0.0. 2024-10-02 20:41:53 +00:00
Jack Grigg 79a72d79a5 Update release notes for 6.0.0 2024-10-02 20:37:29 +00:00
Jack Grigg bf3b8d7e16 Set support window back to the usual 16 weeks 2024-10-02 20:28:04 +00:00
Jack Grigg fd47b5af52 Migrate to librustzcash crates revision right before NU6 mainnet height
This gets the other side-effects of the recent changes out of the way,
and then in the commit where we set the mainnet activation height in
`zcashd`, we can do so uniformly across the stack.
2024-10-02 20:26:29 +00:00
Jack Grigg f5245c7092 qa: Add latest Clang release to postponed updates 2024-10-02 20:19:45 +00:00
Kris Nuttycombe 48bd7b0a7f
Merge pull request #6957 from daira/code-of-conduct-update
Update contacts in the Code of Conduct
2024-10-02 11:38:51 -06:00
Daira-Emma Hopwood 4e44eadbdb Code of Conduct: add Kris and Str4d as contacts.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-02 18:20:57 +01:00
Daira-Emma Hopwood 1951ec76d0 Code of Conduct: update email addresses and remove Sean as a contact.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-02 18:20:57 +01:00
Jack Grigg ee75b6ae28
Merge pull request #6900 from daira/make-default-block-unpaid-action-limit-zero
Make DEFAULT_BLOCK_UNPAID_ACTION_LIMIT zero
2024-10-02 16:30:35 +01:00
Daira-Emma Hopwood dd791388c7 Add a regression test for the ZIP 317 default fee bug (#6956), and make
the tests pass for now.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-02 04:03:09 +01:00
Daira-Emma Hopwood 8b436e8f1f Repair the RPC tests.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-02 03:53:11 +01:00
Daira-Emma Hopwood 34c0c125de Use at least the ZIP 317 fee for Sprout->Sapling migration.
Because of excessive complexity in the Sprout JoinSplit construction
algorithm, we might not be able to compute the exact ZIP 317 fee, since
we essentially need to predict how many JoinSplits the algorithm will
use. So, we use a conservative upper bound to compute the fee. The
difference betweeen that upper bound and the actual number of JoinSplits
might leak some information.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-02 03:52:13 +01:00
Daira-Emma Hopwood e379dc0341 Add more detail to the "tx unpaid action limit exceeded" message.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-02 03:52:13 +01:00
Daira-Emma Hopwood 535f434032 Make DEFAULT_BLOCK_UNPAID_ACTION_LIMIT zero.
fixes #6899 (see that issue for rationale)

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-10-02 03:52:07 +01:00
Jack Grigg dc1637ac11
Merge pull request #6954 from zcash/release-v6.0.0-rc1
Release v6.0.0-rc1
2024-09-28 01:41:46 +01:00
132 changed files with 3747 additions and 1885 deletions

View File

@ -4,25 +4,5 @@ linker = "aarch64-linux-gnu-gcc"
[source.crates-io]
replace-with = "vendored-sources"
[source."https://github.com/zcash/incrementalmerkletree"]
git = "https://github.com/zcash/incrementalmerkletree"
rev = "ffe4234788fd22662b937ba7c6ea01535fcc1293"
replace-with = "vendored-sources"
[source."https://github.com/zcash/orchard"]
git = "https://github.com/zcash/orchard"
rev = "55fb089a335bbbc1cda186c706bc037073df8eb7"
replace-with = "vendored-sources"
[source."https://github.com/zcash/sapling-crypto"]
git = "https://github.com/zcash/sapling-crypto"
rev = "b1ad3694ee13a2fc5d291ad04721a6252da0993c"
replace-with = "vendored-sources"
[source."https://github.com/zcash/librustzcash.git"]
git = "https://github.com/zcash/librustzcash.git"
rev = "1410f1449100a417bfbc4f6c7167aa9808e38792"
replace-with = "vendored-sources"
[source.vendored-sources]
# The directory for this source is set to RUST_VENDORED_SOURCES by src/Makefile.am

View File

@ -17,7 +17,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
id: toolchain
- run: rustup override set ${{steps.toolchain.outputs.name}}
- run: cargo install cargo-vet --version ~0.9
- run: cargo install cargo-vet --version ~0.10
- run: cargo vet --locked
cargo-deny:

View File

@ -45,9 +45,9 @@ jobs:
fetch-depth: 0
- name: Fetch the commits for the PR branch
run: git fetch $HEAD_REPO $HEAD_SHA
run: git fetch "${HEAD_REPO}" "${HEAD_SHA}"
env:
HEAD_REPO: ${{ github.event.pull_request.head.repo }}
HEAD_REPO: ${{ github.event.pull_request.head.repo.clone_url }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
- name: Check whether the changes are only to the set of filtered paths
@ -74,7 +74,11 @@ jobs:
]
paths_regex = '(?:%s)' % '|'.join(paths)
changed_files = shlex.split(os.environ["CHANGED_FILES"])
lex = shlex.shlex(posix = True)
lex.whitespace = '\n\r'
lex.whitespace_split = True
lex.commenters = ''
changed_files = list(lex)
if len(changed_files) == 0:
sys.exit(1)
@ -85,9 +89,8 @@ jobs:
print('result=verified' if verified else 'result=skipped')
EOF
CHANGED_FILES=$(git diff --name-only ${{ github.sha }}...$HEAD_SHA --)
echo $CHANGED_FILES
CHANGED_FILES=$CHANGED_FILES python3 ./subclass.py >> $GITHUB_OUTPUT
git diff --name-only ${{ github.sha }}...$HEAD_SHA -- | python3 ./subclass.py >> $GITHUB_OUTPUT
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}

View File

@ -51,33 +51,33 @@ jobs:
- name: Debian-bookworm
tier: 1
platform: Debian Bookworm
build_os: ubuntu-20.04-8cores
test_os: ubuntu-20.04
build_os: ubuntu-22.04-8cores
test_os: ubuntu-22.04
container: electriccoinco/debian-helper:bookworm
host: x86_64-pc-linux-gnu
- name: Debian-bullseye
tier: 1
platform: Debian bullseye
build_os: ubuntu-20.04-8cores
test_os: ubuntu-20.04
build_os: ubuntu-22.04-8cores
test_os: ubuntu-22.04
container: electriccoinco/debian-helper:bullseye
host: x86_64-pc-linux-gnu
- name: ubuntu-20.04
tier: 1
platform: Ubuntu 20.04
build_os: ubuntu-20.04-8cores
test_os: ubuntu-20.04
host: x86_64-pc-linux-gnu
- name: ubuntu-22.04
tier: 3
tier: 1
platform: Ubuntu 22.04
build_os: ubuntu-22.04-8cores
test_os: ubuntu-22.04
host: x86_64-pc-linux-gnu
- name: ubuntu-24.04
tier: 3
platform: Ubuntu 24.04
build_os: ubuntu-24.04
test_os: ubuntu-24.04
host: x86_64-pc-linux-gnu
# - name: macos-12
# tier: 3
# platform: macOS 12 Monterey

586
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@ path = "src/rust/bin/wallet_tool.rs"
[dependencies]
bellman = "0.14"
bip0039 = { version = "0.10.1", features = ["std", "all-languages"] }
bip0039 = { version = "0.12", features = ["std", "all-languages"] }
blake2b_simd = "1"
blake2s_simd = "1"
bls12_381 = "0.8"
@ -50,8 +50,8 @@ libc = "0.2"
jubjub = "0.10"
memuse = "0.2"
nonempty = "0.7"
orchard = "0.9"
sapling = { package = "sapling-crypto", version = "0.2", features = ["temporary-zcashd"] }
orchard = "0.10"
sapling = { package = "sapling-crypto", version = "0.4", features = ["temporary-zcashd"] }
secp256k1 = "0.27"
subtle = "2.2"
rand_core = "0.6"
@ -59,20 +59,21 @@ redjubjub = "0.7"
tracing = "0.1"
tracing-core = "0.1"
tracing-appender = "0.2"
zcash_address = "0.5"
transparent = { package = "zcash_transparent", version = "0.1" }
zcash_address = "0.6"
zcash_encoding = "0.2.1"
zcash_history = "0.4"
zcash_note_encryption = "0.4"
zcash_primitives = { version = "0.17", features = ["temporary-zcashd", "transparent-inputs"] }
zcash_proofs = { version = "0.17", features = ["directories"] }
zcash_protocol = { version = "0.3", features = ["local-consensus"] }
zcash_primitives = { version = "0.21", features = ["temporary-zcashd", "transparent-inputs"] }
zcash_proofs = { version = "0.21", features = ["directories"] }
zcash_protocol = { version = "0.4", features = ["local-consensus"] }
ed25519-zebra = "4"
zeroize = "1.4.2"
wagyu-zcash-parameters = "0.2"
# Rust/C++ interop
# The version needs to match depends/packages/native_cxxbridge.mk
cxx = { version = "=1.0.128", features = ["c++17"] }
cxx = { version = "=1.0.158", features = ["c++17"] }
# Rust threading
rayon = "1.5"
@ -91,16 +92,19 @@ gumdrop = "0.8"
# (also depends on tracing, and tracing-subscriber with "env-filter" and "fmt" features)
anyhow = "1.0"
backtrace = "0.3"
clearscreen = "3"
clearscreen = "4"
rand = "0.8"
secrecy = "0.8"
thiserror = "1"
thiserror = "2"
time = { version = "0.3", features = ["formatting", "macros"] }
# Macros
macro_find_and_replace = "1"
[dev-dependencies]
incrementalmerkletree = { version = "0.7", features = ["test-dependencies"] }
proptest = "1.0.0"
zcash_primitives = { version = "0.17", features = ["temporary-zcashd", "transparent-inputs", "test-dependencies"] }
zcash_primitives = { version = "0.21", features = ["temporary-zcashd", "transparent-inputs", "test-dependencies"] }
[dependencies.tracing-subscriber]
version = "0.3"
@ -111,16 +115,3 @@ features = ["ansi", "env-filter", "fmt", "time"]
lto = 'thin'
panic = 'abort'
codegen-units = 1
[patch.crates-io]
bridgetree = { git = "https://github.com/zcash/incrementalmerkletree", rev = "ffe4234788fd22662b937ba7c6ea01535fcc1293" }
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree", rev = "ffe4234788fd22662b937ba7c6ea01535fcc1293" }
orchard = { git = "https://github.com/zcash/orchard", rev = "55fb089a335bbbc1cda186c706bc037073df8eb7" }
sapling-crypto = { git = "https://github.com/zcash/sapling-crypto", rev = "b1ad3694ee13a2fc5d291ad04721a6252da0993c" }
equihash = { git = "https://github.com/zcash/librustzcash.git", rev = "1410f1449100a417bfbc4f6c7167aa9808e38792" }
zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "1410f1449100a417bfbc4f6c7167aa9808e38792" }
zcash_encoding = { git = "https://github.com/zcash/librustzcash.git", rev = "1410f1449100a417bfbc4f6c7167aa9808e38792" }
zcash_history = { git = "https://github.com/zcash/librustzcash.git", rev = "1410f1449100a417bfbc4f6c7167aa9808e38792" }
zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "1410f1449100a417bfbc4f6c7167aa9808e38792" }
zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "1410f1449100a417bfbc4f6c7167aa9808e38792" }
zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "1410f1449100a417bfbc4f6c7167aa9808e38792" }

View File

@ -1,4 +1,4 @@
Zcash 6.0.0-rc1
Zcash 6.2.0
<img align="right" width="120" height="80" src="doc/imgs/logo.png">
===========
@ -60,8 +60,8 @@ for instructions on joining the main Zcash network.
* :blue_book: See the documentation at the [ReadTheDocs](https://zcash.readthedocs.io)
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://discord.com/invite/zcash)
* :incoming_envelope: Ask for help on the [Zcash forum](https://forum.zcashcommunity.com/).
* :speech_balloon: Join our community on the [Zcash Global Discord](https://discord.com/invite/zcash).
* 🧑‍🎓: Learn at [ZecHub](https://zechub.wiki/)
Participation in the Zcash project is subject to a
@ -76,7 +76,7 @@ Build Zcash along with most dependencies from source by running the following co
```
Currently, Zcash is only officially supported on Debian and Ubuntu. See the
[Debian / Ubuntu build](https://zcash.readthedocs.io/en/latest/rtd_pages/Debian-Ubuntu-build.html)
[Debian / Ubuntu build page](https://zcash.readthedocs.io/en/latest/rtd_pages/Debian-Ubuntu-build.html)
for detailed instructions.
License

View File

@ -47,13 +47,14 @@ is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.
You may send reports to [our Conduct email](mailto:conduct@z.cash).
You may send reports to [our Conduct email](mailto:conduct@electriccoin.co).
If you wish to contact specific maintainers directly, the following have made
themselves available for conduct issues:
- Daira Hopwood (daira at z.cash)
- Sean Bowe (sean at z.cash)
- Daira-Emma Hopwood (daira-emma at electriccoin.co)
- Kris Nuttycombe (kris at electriccoin.co)
- Jack Grigg (jack at electriccoin.co)
This Code of Conduct is adapted from the [Contributor Covenant][homepage],

View File

@ -1,9 +1,9 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 6)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_MINOR, 2)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 25)
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)))
define(_CLIENT_VERSION_IS_RELEASE, true)

View File

@ -1,3 +1,27 @@
zcash (6.2.0) stable; urgency=medium
* 6.2.0 release.
-- Electric Coin Company <team@electriccoin.co> Wed, 16 Apr 2025 23:59:38 +0100
zcash (6.2.0~rc1) stable; urgency=medium
* 6.2.0-rc1 release.
-- Electric Coin Company <team@electriccoin.co> Thu, 10 Apr 2025 18:44:12 +0100
zcash (6.1.0) stable; urgency=medium
* 6.1.0 release.
-- Electric Coin Company <team@electriccoin.co> Thu, 02 Jan 2025 19:21:42 +0000
zcash (6.0.0) stable; urgency=high
* 6.0.0 release.
-- Electric Coin Company <team@electriccoin.co> Wed, 02 Oct 2024 20:45:09 +0000
zcash (6.0.0~rc1) stable; urgency=medium
* 6.0.0-rc1 release.

View File

@ -190,6 +190,10 @@ Copyright: 2016-2021 isis agora lovecruft
2012 The Go Authors
License: BSD-3-clause and BSD-3-clause-Google
Files: depends/*/vendored-sources/foldhash/*
Copyright: 2024 Orson Peters
License: Zlib
Files: depends/*/vendored-sources/instant/*
Copyright: 2019 Sébastien Crozet
License: BSD-3-clause
@ -235,8 +239,8 @@ Copyright: 2016-2020 meh <meh@schizofreni.co>
License: WTFPL
Files: depends/*/vendored-sources/unicode-ident/src/tables.rs
Copyright: 1991-2022 Unicode, Inc
License: Unicode-DFS-2016
Copyright: 1991-2023 Unicode, Inc.
License: Unicode-3.0
Comment: This entry is for code in the unicode-ident crate generated from Unicode data tables.
The license of the unicode-ident crate itself is MIT/Expat or Apache-2.0.
@ -2031,50 +2035,62 @@ License: Ring-BoringSSL
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
License: Unicode-DFS-2016
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
.
See Terms of Use <https://www.unicode.org/copyright.html>
for definitions of Unicode Inc.s Data Files and Software.
.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
License: Unicode-3.0
UNICODE LICENSE V3
.
COPYRIGHT AND PERMISSION NOTICE
.
Copyright © 1991-2022 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
Copyright © 1991-2023 Unicode, Inc.
.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.
.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS.
.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.
.
Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.
License: Zlib
This software is provided 'as-is', without any express or implied warranty. In
no event will the authors be held liable for any damages arising from the use of
this software.
.
Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to
the following restrictions:
.
1. The origin of this software must not be misrepresented; you must not claim
that you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
.
3. This notice may not be removed or altered from any source distribution.

View File

@ -18,50 +18,50 @@ import re
import sys
import os
# Ubuntu 20.04 LTS (Focal Fossa; End of Support April 2025) has:
# Ubuntu 22.04 LTS (Jammy Jellyfish; End of Support April 2027) has:
#
# - 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)
# - g++ version 11.2.0 (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=g%2B%2B)
# - libc6 version 2.35 (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=libc6)
#
# Debian 10 (Buster; LTS EOL June 2024) has:
# Debian 11 (Bullseye; LTS EOL August 2026) has:
#
# - 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)
# - g++ version 10.2.1 (https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=g%2B%2B)
# - libc6 version 2.31 (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:
# RedHat Enterprise Linux 9 (EOL some time in 2032) is based on Fedora 34 (EOL 2022-06-07) and uses the same base packages:
#
# - g++ version 8.0.1 (https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/28/Everything/x86_64/os/Packages/g/ search for gcc-)
# - libc6 version 2.27 (https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/28/Everything/x86_64/os/Packages/g/ search for glibc)
# - g++ version 11.0.1 (https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/34/Everything/x86_64/os/Packages/g/ search for gcc-)
# - libc6 version 2.33 (https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/34/Everything/x86_64/os/Packages/g/ search for glibc)
#
# Fedora 31 (EOL ~November 2020) has:
# Fedora 40 (EOL ~May 2025) has:
#
# - g++ version 9.2.1 (https://dl.fedoraproject.org/pub/fedora/linux/releases/31/Everything/x86_64/os/Packages/g/ search for gcc-)
# - libc6 version 2.30 (https://dl.fedoraproject.org/pub/fedora/linux/releases/31/Everything/x86_64/os/Packages/g/ search for glibc)
# - g++ version 14.0.1 (https://dl.fedoraproject.org/pub/fedora/linux/releases/40/Everything/x86_64/os/Packages/g/ search for gcc-)
# - libc6 version 2.39 (https://dl.fedoraproject.org/pub/fedora/linux/releases/40/Everything/x86_64/os/Packages/g/ search for glibc)
#
# Arch is a rolling release, and as of October 2020 has packages for:
# Arch is a rolling release, and as of April 2025 has packages for:
#
# - 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)
# - g++ version 13.3.1 / 14.2.1 (https://www.archlinux.org/packages/?q=gcc)
# - libc6 version 2.41 (https://www.archlinux.org/packages/?q=glibc)
#
# We take the minimum of these as our target. In practice, if we build on Buster without
# We take the minimum of these as our target. In practice, if we build on Bullseye 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 8.0.0: GCC_8.0.0, GLIBCXX_3.4.24, CXXABI_1.3.11
# libc6: GLIBC_2_27
# According to the GNU ABI document (https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) this corresponds to libstdc++.so.6.0.28:
# GCC 10.1.0: GCC_9.0.0, GLIBCXX_3.4.28, CXXABI_1.3.12
# libc6: GLIBC_2_31
# 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': (8,0,0),
'GLIBC': (2,27),
'GCC': (10,2,1),
'GLIBC': (2,31),
}
if ALLOW_DYNAMIC_LIBSTDCXX:
MAX_VERSIONS.update({
'GLIBCXX': (3,4,14),
'CXXABI': (1,3,4),
'GLIBCXX': (3,4,28),
'CXXABI': (1,3,12),
})
# See here for a description of _IO_stdin_used:

View File

@ -1,5 +1,5 @@
---
name: "zcash-6.0.0-rc1"
name: "zcash-6.2.0"
enable_cache: true
distro: "debian"
suites:

View File

@ -1,5 +1,5 @@
---
name: "zcash-6.0.0-rc1"
name: "zcash-6.2.0"
enable_cache: true
distro: "debian"
suites:

View File

@ -0,0 +1,78 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBF0AKGMBDAC7aZY600aU58klU+ot+i84rSPfhBvqXUlg8kfd5bG5jGGfVFY0
a1iOzMKL4KKhIbmifCCrIRap+fQV7UXaFsGP6+cmhoxWFK6T49iXi1ZdNYBhVWLD
ELdguZgeIDEJyukgN/99nAqMXIDcTLL7Cf+OQJM56JzzHIvCZqSNmp6zypL0BIUF
3Xx/AUQjENx+1AAO1nOwKIzV3v7JZ9L2e4YKV/LJIctqi+GIjcIvLsLzZL30A6ru
oSmaJNyDdcfMPSUosJ+32jWhFwLcHXCRLMVRKgr0TGqLcGYt3Es4BmteHpPSBhpq
bOSXjc8Sx3vKmo5JDDXK1EoRwLN4pX7G6y17BLcdWbkH5rEFaB7Nw+H3rxNQ77ZY
qWWZ8NrfORiwplYJG5FejpcsGyk8mL2J3qG2Dx0Sqvlc4Ve4tskBuUtPxhn2IGeT
fnlbAMSpV6z/JTUmNfYCO2MlokbtqILVDwSJLtUYVDF7GJK70elbk4QoZZKOZjO2
smRZVF4ZtlnL0b0AEQEAAbQ0RGFpcmEgSG9wd29vZCAoemNhc2ggZ2l0aWFuKSA8
ZGFpcmFAZWxlY3RyaWNjb2luLmNvPokB1AQTAQgAPgIbAwULCQgHAgYVCAkKCwIE
FgIDAQIeAQIXgBYhBF/DXfKZ2HH9KaGxC/RV6bkgI6GLBQJnBnAzBQkNyK7QAAoJ
EPRV6bkgI6GLTkkL/0i9ulDoPJ0qfRwJw3odiRO4VI/b8Bj4+fabaojkHCcYiZL+
lc5fSNJOmlT069kLo+v0gQF6JufqyFPrUvpXzLHMAfjJptanQJiD0q1YykxdqTFs
WbjR6DB7HR3nounO4H9BpNLw6MSDnfGyY36URSsabWQWRDjgQNCw6ZwiYe0dFvhV
Bmd756/jKH+n3rKlFimdkAgqPVg6oWvC27yuGusjpGD9MeF31O7p85FR/AdJzQJ5
GaQ1K/UvjMWzdnF0ejij6XOfl4sHP5bG7ctLTHVUja7YjLhxsCjgM9SnhR4STSyP
ATGApSANMB7YlByfbJCtvm3x8d+zg5sX8YaIAzaYTUFLMaNgEbCRU/SF6sv/uFpx
eVJyrKdJyQrmhoCgynsqCW8Eg9pinLyumuJCwXOdEbJBwPpcEOJJv6lKicNnVBAe
6SiizkwS0mlUnvBl/HVIlUaWUiHNktBucoAf9bXlZkCgPiT4Q+YWvlLLkYaBIGOc
GrVPIuJXmvJ+EOAlELQyRGFpcmEgSG9wd29vZCAoemNhc2ggZ2l0aWFuKSA8ZGFp
cmFAamFjYXJhbmRhLm9yZz6JAdQEEwEIAD4CGwMFCwkIBwIGFQgJCgsCBBYCAwEC
HgECF4AWIQRfw13ymdhx/SmhsQv0Vem5ICOhiwUCZwZwMwUJDciu0AAKCRD0Vem5
ICOhi1qwC/45inPXEI8nbzLg4Z5JPzIjw75e+2SiLFbEJ3u40vWP0WEqVWLqSy93
VhRjgT8Sk99clvqhTGSvpbY8RMsExzPLgxRhqsk851lvb5KnRODIi7IyGPtwAanI
3zadoQPvkjV/d4ly/b/Gsxt5uymbn6viJPQfCz5dDUVBvaQf6q9QZWiAZarR2x36
sLesBymfRwZhWT2Rh4yPwkwhGJNcmCdWbe6j1BmVgWLQpbFkDbhv1iJN4M24AIoA
cQlpiHgrjxIVEJca4WCpXJ3YbGgMv3SVoprkJW3dxEUdv77JA2DIuJTVJN4YRHfa
voibA8B5sdayfMrKmi1YuLC35NCnsF4v5i6UdoW0PHvYiUQTlF9uFbTt32OA2HPv
U+Jhok/s/o1chaU71GUUN2j9qz7dZHLbb/5oA+QaNl/Rppsn5SUqfBdM2FVe7XT7
ajcIIzhGYkqjwnw3jQZqT+wxU3kQFDZn0pB7vp/6Igfvn0purEpxw4azGXiif6OF
tUZWfc040dS5AY0EXQAoYwEMAPiAjOzLsTF8w4ifNAbDulp9yEJakLUyyewXSFeZ
bnl5SADvDQuyXEAksrONtrxtm1rZ0KG938wGiV16NqPhAqcBJjH+MrvsoLf5itDm
AMmQUFOXaJD+sBu9qMMGyLL08xHinCOklBEjmDsJXY3IhEZpV9PO+VmhMH7llMzo
nyv4LReJ8sRRqQMbepphbaCtbHu3MYLSzo4EkJCKT1e7onjCEVmdc2amLvq4ozBK
eEsGz0/vRB8/9OsAYiaeTKJ8TOt8xzG8d/Pacy8rSWAxd1TDxCuFjtwagJAOAi5n
Nn0sKOopXF8cfCdfIRP2ySijjmgH9ooxNIpkS0byYM0sfUkq6fGQL7/V3AcMTMj9
iEbv00wJE3gLOlFcePVh6qEdrHWclKZv0N6Nw33BoXwHO34bMmDmIHaa0nDkCXyt
gyrAbxpQspjeJ4ttH/+JEcKmPRMNus6ptD3AV+ADsJNYjgqzgr1CrmI3W+WCHOHf
Ynz5FinpP93UBCuWBeWmfs5h3QARAQABiQG8BBgBCAAmAhsMFiEEX8Nd8pnYcf0p
obEL9FXpuSAjoYsFAmcGcGEFCQ3Irv4ACgkQ9FXpuSAjoYub+AwAlPk32l3lLyPz
mBr9dNbQMrH06Dm024AdXXOFssTIDpKdvDaAMufagFX58LaMVm02XVpP4vAj7K45
R5JxhbQrGj4oE1EZjtmW9TdqNU+iMSH2z+eFl86dURWDMa2Vzobq94QtJUOhRHpf
IFRbNrrUdUweBqsByq4Vx4v8KeiWlpY0Gh9gJN9AehjLMCPLihRkHvxQp/HykO8G
oGrUk8fpKcHoMj8Us0OViscQAVgOgzfSi+pmNKYTLX+rxDA3w4dncwTDEm1bNJhh
xNJkQKDXbwYHKuiCSBceS0Dh1XWQYY6Dk9V+N6AzPE9lyJUwmSUD6fTz/iVPEcVh
vDjvr5YKnb0hU7rCpyEqSl6voQev4rm6borncehDioNvtGuAtCVyRXFpY8qRsjXA
wMr3cU9mftZC+oZNMBrL7vT1DHmWnQYQoN8YnFMNWl9uP0/d0Rzq06zE1yUWsKW0
JbeQynvtX0i8bojj0F2ORHODZEB7o8iQitR/ehyMzxG61uo2xd73uQMNBGMgcfEQ
DACaiZO6UKA1B9TAlS8JeaPlQgyLEmaWRCKbc8XK62fqYMfM8ateNV+0KHCpYCxo
2De2HejZn16mDErYXqtLJL6HadfVWKwsJB2Ptgmo8pO8QjxNWJpO1RzRYekO+n/S
77ivHlWIkgo6nWGTtYBgUjc7IEYi2cNoV65yS+znIxXOm8HA3llYV1zJjHhOl9Tg
PxGj/qOXCFt+mf6AaoF68msqsdqm4inrjok4HOLhhI19LhlXQSUkZXcOD/TDwwG5
idwK9dMUHjhsFgxlPZ5VubiNSNJ+O/5JBPQNKxXrDpF0WCRFH6gEXSzX09f18wsk
Y+EKOVDa4Cf9pGv6VbRmxaykk7kibGfYhllPsTNlYmKdVn+A6nFyIcYQONKIN8/L
pxtBn0Kyzv80YZPfz6TQocVmCKqdiekTvCVrBnjHgdeOLEhHhMcOFr9Mch3RqjkN
I+7eeNC6taZ2XvPKJWaGeCn122RyY0VZ1MVhr69RuTHDHM/JDVvoj/AeocJJEsNd
3hMAAwUL/3cjN7ns6V5hw32s+OXTt5ouP17Jid0tuJODyVJbfw6ToAgS8BK8xROD
MvVQGR30PHslhKUecCXr5kRBO6q8vMAjjvPP8P6LyyluR/+xEXmOyqUOEQofYDkn
yqPg1hrxfvzbehXB6D8oz8coZhy5CDhsWpFnudKzTc6d1RHfX8VRyA05HDbedTey
hb6X+IuIbUWwvoqdnFyllvUeCwVDkJlP2hlCWbh+QNQAYdhiol0wSFxGSVvM/rFx
d9GxHZ+8280QfbejScP7RN4SGIEA6d/oKkg8IbGE0BP/u9P+s8ZMaqUJc9IIlHyX
zKZEMvKYafmWKA7GrSBM3TdwbWN8yN+JiGgi/M/0HOj3I2eoj1YSz+D4uzqLzAw2
U1jJtvOFW9wGmgOsOuw2LGmSokDC7h/RFhuTtm0XBDtmlE8Act4z2javYXK6G+8f
QUETOTJhuXPbkAaMGOMnrUqcAIftPzhb60gdwK+ksUCiWaUjoVo32XuMC3bGwDYO
khpQZCx8ZIkBvAQYAQoAJgIbDBYhBF/DXfKZ2HH9KaGxC/RV6bkgI6GLBQJnBnBh
BQkHqGVwAAoJEPRV6bkgI6GLJsIL/RPwrtgFnLg1+hX5f5huU8t8YwfsYmYgzHFl
aLVIJC8Jov4//UEuLr8ff/Tig0RviyAE8Pw/mqISOsmcvoDH+7Pg4EA2c156I3Ea
PUzZU3RolW8hRfy6wVBdfSl15Nj4ChB5Zk72VkGi4Gl9/utNGA0/GOuds0RNrLJs
qpZuFY7VnOXfBxc5fO7DL/HOrLuUUF22lK6Q8To5SdJ8tpEzOH3MZS68QY1+1vQi
UC3Wzb3t8bvOWJYiA832tO8ZZNuQqbWSk3YupdnamQ1/1NTtVPoIxY1dcw2mHnLR
n3O7MYEJ/U2rFy10gUDgvxgwqqon2wYKnHmsdRB5Yoqp87f/Z+xZVfk9jGusioTm
pr3/oIJnGMGlFmhB2nnzbtPF6zBlAXxSq90tSyVZtxhywie3WmN8MQ5vG7LyWbQq
E+RbFqJuY0F0jY0feAl+q2iWTgsQ0JayLhRYJDjvhqgr28A1obQgTHiA0Ct8UxN1
Y9xe1BwXNuPn29YN+3cLqZXeczInWg==
=q07c
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -25,9 +25,10 @@ allow = [
exceptions = [
{ name = "arrayref", allow = ["BSD-2-Clause"] },
{ name = "curve25519-dalek", allow = ["BSD-3-Clause"] },
{ name = "foldhash", allow = ["Zlib"] },
{ name = "secp256k1", allow = ["CC0-1.0"] },
{ name = "secp256k1-sys", allow = ["CC0-1.0"] },
{ name = "subtle", allow = ["BSD-3-Clause"] },
{ name = "terminfo", allow = ["WTFPL"] },
{ name = "unicode-ident", allow = ["Unicode-DFS-2016"] },
{ name = "unicode-ident", allow = ["Unicode-3.0"] },
]

View File

@ -1,8 +1,8 @@
package=native_cmake
$(package)_version=3.30.4
$(package)_version=3.31.3
$(package)_download_path=https://github.com/Kitware/CMake/releases/download/v$($(package)_version)
$(package)_file_name=cmake-$($(package)_version).tar.gz
$(package)_sha256_hash=c759c97274f1e7aaaafcb1f0d261f9de9bf3a5d6ecb7e2df616324a46fe704b2
$(package)_sha256_hash=fac45bc6d410b49b3113ab866074888d6c9e9dc81a141874446eb239ac38cb87
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.128
$(package)_version=1.0.158
$(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=7aa61d128d75cbfb4713e0c0803efb4da6c88180327f9e2f095641b55a5d0e06
$(package)_sha256_hash=58a3c7b28033caeeb8a5e1f74c5124d63b1bfc8a67a5740c475c6d12d1bc7f4b
$(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.128
# $ export VERSION=1.0.158
# $ rm .cargo/config.toml .cargo/.configured-for-offline
# $ mkdir tmp
# $ cd tmp

View File

@ -1,9 +1,9 @@
package=native_fmt
$(package)_version=11.0.2
$(package)_version=11.1.1
$(package)_download_path=https://github.com/fmtlib/fmt/archive/refs/tags
$(package)_download_file=$($(package)_version).tar.gz
$(package)_file_name=fmt-$($(package)_version).tar.gz
$(package)_sha256_hash=6cb1e6d37bdcb756dbbe59be438790db409cdb4868c66e888d5df9f13f7c027f
$(package)_sha256_hash=482eed9efbc98388dbaee5cb5f368be5eca4893456bb358c18b7ff71f835ae43
$(package)_build_subdir=build
$(package)_dependencies=native_cmake

View File

@ -1,9 +1,9 @@
package=native_xxhash
$(package)_version=0.8.2
$(package)_version=0.8.3
$(package)_download_path=https://github.com/Cyan4973/xxHash/archive/refs/tags
$(package)_download_file=v$($(package)_version).tar.gz
$(package)_file_name=xxhash-$($(package)_version).tar.gz
$(package)_sha256_hash=baee0c6afd4f03165de7a4e67988d16f0f2b257b51d0e3cb91909302a26a79c4
$(package)_sha256_hash=aae608dfe8213dfd05d909a57718ef82f30722c392344583d3f39050c7f29a80
define $(package)_build_cmds
$(MAKE) libxxhash.a

View File

@ -1,9 +1,9 @@
package=utfcpp
$(package)_version=4.0.5
$(package)_version=4.0.6
$(package)_download_path=https://github.com/nemtrif/$(package)/archive/refs/tags
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_download_file=v$($(package)_version).tar.gz
$(package)_sha256_hash=ffc668a310e77607d393f3c18b32715f223da1eac4c4d6e0579a11df8e6b59cf
$(package)_sha256_hash=6920a6a5d6a04b9a89b2a89af7132f8acefd46e0c2a7b190350539e9213816c0
define $(package)_stage_cmds
mkdir -p $($(package)_staging_dir)$(host_prefix)/include && \

View File

@ -10,15 +10,21 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
[[package]]
name = "anstyle"
version = "1.0.8"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]]
name = "bitflags"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
[[package]]
name = "cc"
version = "1.1.21"
version = "1.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0"
checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0"
dependencies = [
"jobserver",
"libc",
@ -33,28 +39,28 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clang-ast"
version = "0.1.26"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "577457f7ace079a595017e4307c6e480902664ede6e4a0760747c4f498b7c996"
checksum = "0f215fa69fa4265fc39aef0b1a1e724e62392da3dcc8c08f892dd323107e9a8d"
dependencies = [
"rustc-hash",
"foldhash",
"serde",
]
[[package]]
name = "clap"
version = "4.5.18"
version = "4.5.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3"
checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071"
dependencies = [
"clap_builder",
]
[[package]]
name = "clap_builder"
version = "4.5.18"
version = "4.5.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b"
checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2"
dependencies = [
"anstyle",
"clap_lex",
@ -63,16 +69,17 @@ dependencies = [
[[package]]
name = "clap_lex"
version = "0.7.2"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "codespan-reporting"
version = "0.11.1"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81"
dependencies = [
"serde",
"termcolor",
"unicode-width",
]
@ -88,14 +95,16 @@ dependencies = [
[[package]]
name = "cxx"
version = "1.0.128"
version = "1.0.158"
dependencies = [
"cc",
"cxx-build",
"cxx-gen",
"cxx-test-suite",
"cxxbridge-cmd",
"cxxbridge-flags",
"cxxbridge-macro",
"foldhash",
"link-cplusplus",
"rustversion",
"trybuild",
@ -103,13 +112,12 @@ dependencies = [
[[package]]
name = "cxx-build"
version = "1.0.128"
version = "1.0.158"
dependencies = [
"cc",
"codespan-reporting",
"cxx",
"cxx-gen",
"once_cell",
"pkg-config",
"proc-macro2",
"quote",
@ -119,7 +127,7 @@ dependencies = [
[[package]]
name = "cxx-gen"
version = "0.7.128"
version = "0.7.158"
dependencies = [
"codespan-reporting",
"proc-macro2",
@ -138,7 +146,7 @@ dependencies = [
[[package]]
name = "cxxbridge-cmd"
version = "1.0.128"
version = "1.0.158"
dependencies = [
"clap",
"codespan-reporting",
@ -149,11 +157,11 @@ dependencies = [
[[package]]
name = "cxxbridge-flags"
version = "1.0.128"
version = "1.0.158"
[[package]]
name = "cxxbridge-macro"
version = "1.0.128"
version = "1.0.158"
dependencies = [
"clang-ast",
"cxx",
@ -161,6 +169,7 @@ dependencies = [
"memmap",
"proc-macro2",
"quote",
"rustversion",
"serde",
"serde_derive",
"serde_json",
@ -177,43 +186,61 @@ dependencies = [
[[package]]
name = "dissimilar"
version = "1.0.9"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d"
checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921"
[[package]]
name = "equivalent"
version = "1.0.1"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "flate2"
version = "1.0.33"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253"
checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "glob"
version = "0.3.1"
name = "foldhash"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]]
name = "getrandom"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"wasi",
]
[[package]]
name = "glob"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
[[package]]
name = "hashbrown"
version = "0.14.5"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3"
[[package]]
name = "indexmap"
version = "2.5.0"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5"
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
dependencies = [
"equivalent",
"hashbrown",
@ -221,30 +248,31 @@ dependencies = [
[[package]]
name = "itoa"
version = "1.0.11"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
[[package]]
name = "jobserver"
version = "0.1.32"
version = "0.1.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a"
dependencies = [
"getrandom",
"libc",
]
[[package]]
name = "libc"
version = "0.2.159"
version = "0.2.172"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
[[package]]
name = "link-cplusplus"
version = "1.0.9"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9"
checksum = "4a6f6da007f968f9def0d65a05b187e2960183de70c160204ecfccf0ee330212"
dependencies = [
"cc",
]
@ -267,81 +295,75 @@ dependencies = [
[[package]]
name = "miniz_oxide"
version = "0.8.0"
version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a"
dependencies = [
"adler2",
]
[[package]]
name = "once_cell"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "pkg-config"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]]
name = "proc-macro2"
version = "1.0.86"
version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.37"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustc-hash"
version = "2.0.0"
name = "r-efi"
version = "5.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
[[package]]
name = "rustversion"
version = "1.0.17"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
[[package]]
name = "ryu"
version = "1.0.18"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]]
name = "scratch"
version = "1.0.7"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152"
checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52"
[[package]]
name = "serde"
version = "1.0.210"
version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.210"
version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
dependencies = [
"proc-macro2",
"quote",
@ -350,9 +372,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.128"
version = "1.0.140"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
dependencies = [
"itoa",
"memchr",
@ -383,15 +405,21 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "2.0.77"
version = "2.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "target-triple"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ac9aa371f599d22256307c24a9d748c041e548cbf599f35d890f9d365361790"
[[package]]
name = "termcolor"
version = "1.4.1"
@ -403,9 +431,9 @@ dependencies = [
[[package]]
name = "toml"
version = "0.8.19"
version = "0.8.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae"
dependencies = [
"serde",
"serde_spanned",
@ -415,52 +443,69 @@ dependencies = [
[[package]]
name = "toml_datetime"
version = "0.6.8"
version = "0.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
version = "0.22.22"
version = "0.22.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5"
checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e"
dependencies = [
"indexmap",
"serde",
"serde_spanned",
"toml_datetime",
"toml_write",
"winnow",
]
[[package]]
name = "trybuild"
version = "1.0.99"
name = "toml_write"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "207aa50d36c4be8d8c6ea829478be44a372c6a77669937bb39c698e52f1491e8"
checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076"
[[package]]
name = "trybuild"
version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ae08be68c056db96f0e6c6dd820727cca756ced9e1f4cc7fdd20e2a55e23898"
dependencies = [
"dissimilar",
"glob",
"serde",
"serde_derive",
"serde_json",
"target-triple",
"termcolor",
"toml",
]
[[package]]
name = "unicode-ident"
version = "1.0.13"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
[[package]]
name = "unicode-width"
version = "0.1.14"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
[[package]]
name = "wasi"
version = "0.14.2+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3"
dependencies = [
"wit-bindgen-rt",
]
[[package]]
name = "winapi"
@ -568,9 +613,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
version = "0.6.20"
version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b"
checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec"
dependencies = [
"memchr",
]
[[package]]
name = "wit-bindgen-rt"
version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
dependencies = [
"bitflags",
]

View File

@ -1,9 +1,9 @@
Zcash Contributors
==================
* Jack Grigg (2157)
* Kris Nuttycombe (750)
* Daira-Emma Hopwood (483)
* Jack Grigg (2194)
* Kris Nuttycombe (751)
* Daira-Emma Hopwood (526)
* Simon Liu (464)
* Sean Bowe (413)
* Eirik Ogilvie-Wigley (273)
@ -15,8 +15,8 @@ Zcash Contributors
* Taylor Hornby (118)
* Ying Tong Lai (99)
* Marco Falke (91)
* Larry Ruane (91)
* Jonas Schnelli (90)
* Larry Ruane (89)
* Jay Graber (89)
* sasha (80)
* Cory Fields (78)
@ -34,8 +34,8 @@ Zcash Contributors
* Jorge Timón (25)
* John Newbery (24)
* Yasser Isa (21)
* Marius Kjærstad (21)
* Suhas Daftuar (20)
* Marius Kjærstad (20)
* Jonathan "Duke" Leto (19)
* furszy (18)
* syd (16)
@ -88,6 +88,7 @@ Zcash Contributors
* Evan Klitzke (4)
* DeckerSU (4)
* Ben Woosley (4)
* y4ssi (3)
* mruddy (3)
* lpescher (3)
* isle2983 (3)
@ -152,7 +153,6 @@ Zcash Contributors
* Akio Nakamura (2)
* ロハン ダル (1)
* zathras-crypto (1)
* y4ssi (1)
* vim88 (1)
* user (1)
* unsystemizer (1)
@ -210,6 +210,7 @@ Zcash Contributors
* Maxwell Gubler (1)
* Matt Quinn (1)
* Marko Bencun (1)
* Maciej S. Szmigiero (1)
* Luv Khemani (1)
* Louis Nyffenegger (1)
* LongShao007 (1)

View File

@ -3,7 +3,7 @@
## General
ECC provides three tiers of platform support, modeled after the
[Rust Target Tier Policy](https://doc.rust-lang.org/stable/rustc/platform-tier-policy.html):
[Rust Target Tier Policy](https://doc.rust-lang.org/stable/rustc/target-tier-policy.html):
- The Zcash developers provide no guarantees about tier 3 platforms; they exist in the
codebase, but may or may not build.

View File

@ -37,10 +37,19 @@ the node, or if an `allowdeprecated=none` line is added to `zcash.conf`.
| `feature` | Deprecated | Feature details
|-------------------------------------|------------|----------------
| `z_getbalance` | 5.0.0 | The `z_getbalance` RPC method.
| `z_gettotalbalance` | 5.0.0 | The `z_gettotalbalance` RPC method.
| `gbt_oldhashes` | 5.4.0 | The `finalsaplingroothash`, `lightclientroothash`, and `blockcommitmentshash` fields in the output of `getblocktemplate`, which are replaced by the `defaultroots` field.
| `deprecationinfo_deprecationheight` | 5.5.0 | The `deprecationheight` field returned by the `getdeprecationinfo` RPC method has been replaced by the `end_of_service` object.
| `createrawtransaction` | 6.2.0 | The `createrawtransaction` RPC method.
| `fundrawtransaction` | 6.2.0 | The `fundrawtransaction` RPC method.
| `signrawtransaction` | 6.2.0 | The `signrawtransactions` RPC method.
| `keypoolrefill` | 6.2.0 | The `keypoolrefill` RPC method.
| `settxfee` | 6.2.0 | The `settxfee` RPC method.
The `createrawtransaction`, `fundrawtransaction`, and `signrawtransaction` RPC methods are intended to be replaced
by PCZT-based functionality implemented in Zallet [zcash/wallet#99](https://github.com/zcash/wallet/issues/99).
The experimental RPC methods `z_getpaymentdisclosure` and `z_validatepaymentdisclosure` (which only supported
Sprout) are also deprecated.
Stage 2
-------
@ -49,12 +58,18 @@ Each feature in the table below may be enabled by adding `-allowdeprecated=<feat
to the CLI arguments when starting the node, or by adding an `allowdeprecated=<feature>`
line to `zcash.conf`.
| `feature` | Deprecated | Feature details
|-----------------------|------------|----------------
| `legacy_privacy` | 5.0.0 | The default "legacy" privacy policy for `z_sendmany` has been replaced by the `FullPrivacy` directive.
| `getnewaddress` | 5.0.0 | The `getnewaddress` RPC method.
| `getrawchangeaddress` | 5.0.0 | The `getrawchangeaddress` RPC method.
| `z_getnewaddress` | 5.0.0 | The `z_getnewaddress` RPC method.
| `z_listaddresses` | 5.0.0 | The `z_listaddresses` RPC method.
| `addrtype` | 5.0.0 | The `type` attribute is deprecated in the results of RPC methods that return address metadata. It is recommended that applications using this metadata be updated to use the `pool` or `address_type` attributes, which have replaced the `type` attribute, as appropriate.
| `wallettxvjoinsplit` | 5.1.0 | The `vjoinsplit` attribute returned by the `gettransaction` RPC method.
| `feature` | Deprecated | Default-disabled | Feature details
|-------------------------------------|------------|------------------|----------------
| `legacy_privacy` | 5.0.0 | 5.4.0 | The default "legacy" privacy policy for `z_sendmany` has been replaced by the `FullPrivacy` directive.
| `getnewaddress` | 5.0.0 | 5.4.0 | The `getnewaddress` RPC method.
| `getrawchangeaddress` | 5.0.0 | 5.4.0 | The `getrawchangeaddress` RPC method.
| `z_getnewaddress` | 5.0.0 | 5.4.0 | The `z_getnewaddress` RPC method.
| `z_listaddresses` | 5.0.0 | 5.4.0 | The `z_listaddresses` RPC method.
| `addrtype` | 5.0.0 | 5.4.0 `*` | The `type` attribute is deprecated in the results of RPC methods that return address metadata. It is recommended that applications using this metadata be updated to use the `pool` or `address_type` attributes, which have replaced the `type` attribute, as appropriate.
| `wallettxvjoinsplit` | 5.1.0 | 5.4.0 | The `vjoinsplit` attribute returned by the `gettransaction` RPC method.
| `z_getbalance` | 5.0.0 | 6.2.0 | The `z_getbalance` RPC method.
| `gbt_oldhashes` | 5.4.0 | 6.2.0 | The `finalsaplingroothash`, `lightclientroothash`, and `blockcommitmentshash` fields in the output of `getblocktemplate`, which are replaced by the `defaultroots` field.
| `deprecationinfo_deprecationheight` | 5.5.0 | 6.2.0 | The `deprecationheight` field returned by the `getdeprecationinfo` RPC method has been replaced by the `end_of_service` object.
| `getnetworkhashps` | 6.2.0 | 6.2.0 | The `getnetworkhashps` RPC method (use `getnetworksolps` instead).
`*` As of version 6.2.0, `addrtype` is default-disabled even when zcashd is compiled without the `ENABLE_WALLET` flag.

View File

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

View File

@ -42,7 +42,7 @@ 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.10.0-rc1 | 2024-08-22 | 2700600 | 2024-10-31 |
| 5.10.0 | 2024-08-27 | 2706540 | 2024-11-05 |
| 6.0.0-rc1 | 2024-09-27 | 2710272 | 2024-11-08 |
| 6.1.0 | 2025-01-02 | 2901800 | 2025-04-24 |
| 6.2.0-rc1 | 2025-04-10 | 3013824 | 2025-07-31 |
| 6.2.0 | 2025-04-16 | 3021100 | 2025-08-06 |
<!-- 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" "September 2024" "zcash-cli v6.0.0-rc1" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH ZCASH-CLI "1" "April 2025" "zcash-cli v6.2.0" "User Commands"
.SH NAME
zcash-cli \- manual page for zcash-cli v6.0.0-rc1
zcash-cli \- manual page for zcash-cli v6.2.0
.SH DESCRIPTION
Zcash RPC client version v6.0.0\-rc1
Zcash RPC client version v6.2.0
.PP
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.

View File

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

View File

@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASHD-WALLET-TOOL "1" "September 2024" "zcashd-wallet-tool v6.0.0-rc1" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH ZCASHD-WALLET-TOOL "1" "April 2025" "zcashd-wallet-tool v6.2.0" "User Commands"
.SH NAME
zcashd-wallet-tool \- manual page for zcashd-wallet-tool v6.0.0-rc1
zcashd-wallet-tool \- manual page for zcashd-wallet-tool v6.2.0
.SH SYNOPSIS
.B zcashd-wallet-tool
[\fI\,OPTIONS\/\fR]

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASHD "1" "September 2024" "zcashd v6.0.0-rc1" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH ZCASHD "1" "April 2025" "zcashd v6.2.0" "User Commands"
.SH NAME
zcashd \- manual page for zcashd v6.0.0-rc1
zcashd \- manual page for zcashd v6.2.0
.SH DESCRIPTION
Zcash Daemon version v6.0.0\-rc1
Zcash Daemon version v6.2.0
.PP
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.
@ -34,10 +34,12 @@ long fork (%s in cmd is replaced by message)
.IP
Explicitly allow the use of the specified deprecated feature. Multiple
instances of this parameter are permitted; values for <feature> must be
selected from among {"none", "deprecationinfo_deprecationheight",
"gbt_oldhashes", "z_getbalance", "z_gettotalbalance", "addrtype",
"getnewaddress", "getrawchangeaddress", "legacy_privacy",
"wallettxvjoinsplit", "z_getnewaddress", "z_listaddresses"}
selected from among {"none", "createrawtransaction",
"fundrawtransaction", "getnetworkhashps", "keypoolrefill", "settxfee",
"signrawtransaction", "z_gettotalbalance", "addrtype",
"deprecationinfo_deprecationheight", "gbt_oldhashes", "getnewaddress",
"getrawchangeaddress", "legacy_privacy", "wallettxvjoinsplit",
"z_getbalance", "z_getnewaddress", "z_listaddresses"}
.HP
\fB\-blocknotify=\fR<cmd>
.IP
@ -98,7 +100,7 @@ Keep at most <n> unconnectable transactions in memory (default: 100)
.HP
\fB\-par=\fR<n>
.IP
Set the number of script verification threads (\fB\-16\fR to 16, 0 = auto, <0 =
Set the number of script verification threads (\fB\-6\fR to 16, 0 = auto, <0 =
leave that many cores free, default: 0)
.HP
\fB\-pid=\fR<file>
@ -429,8 +431,8 @@ optional). If <category> is not supplied or if <category> = 1, output
all debugging information. <category> can be: addrman, alert, bench,
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.
selectcoins, tor, valuepool, zmq, zrpc, zrpcunsafe (implies zrpc). For
multiple specific categories use \fB\-debug=\fR<category> multiple times.
.HP
\fB\-experimentalfeatures\fR
.IP
@ -484,7 +486,7 @@ Maximum size of data in data carrier transactions we relay and mine
\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)
accepted to the mempool or relayed (default: 0)
.PP
Block creation options:
.HP
@ -495,7 +497,7 @@ Set maximum block size in bytes (default: 2000000)
\fB\-blockunpaidactionlimit=\fR<n>
.IP
Set the limit on unpaid actions that will be accepted in a block for
transactions paying less than the ZIP 317 fee (default: 50)
transactions paying less than the ZIP 317 fee (default: 0)
.PP
Mining options:
.HP

View File

@ -4,4 +4,3 @@ release-notes at release time)
Notable changes
===============
- Windows builds have been fixed.

View File

@ -0,0 +1,84 @@
Notable changes
===============
The mainnet activation of the NU6 network upgrade is supported by the 6.0.0
release, with an activation height of 2726400, which should occur on
approximately November 23, 2024. Please upgrade to this release, or any
subsequent release, in order to follow the NU6 network upgrade.
The following ZIPs are being deployed, or have been updated, as part of this upgrade:
* [ZIP 207: Funding Streams (updated)](https://zips.z.cash/zip-0207)
* [ZIP 214: Consensus rules for a Zcash Development Fund (updated)](https://zips.z.cash/zip-0214)
* [ZIP 236: Blocks should balance exactly](https://zips.z.cash/zip-0236)
* [ZIP 253: Deployment of the NU6 Network Upgrade](https://zips.z.cash/zip-0253)
* [ZIP 1015: Block Reward Allocation for Non-Direct Development Funding](https://zips.z.cash/zip-1015)
* [ZIP 2001: Lockbox Funding Streams](https://zips.z.cash/zip-2001)
In order to help the ecosystem prepare for the mainnet activation, NU6 has
already been activated on the Zcash testnet. Any node version 5.10.0 or higher,
including this release, supports the NU6 activation on testnet.
Mining
------
- The default setting of `-blockunpaidactionlimit` is now zero, which has
the effect of no longer allowing "unpaid actions" in [block production].
This adapts to current network conditions. If you have overridden this
setting as a miner, we recommend removing the override. This configuration
option may be removed entirely in a future release.
[block production]: https://zips.z.cash/zip-0317#block-production
Platform Support
----------------
- Windows builds have been fixed.
Changelog
=========
Daira-Emma Hopwood (9):
Ensure out-reference parameters of `CWallet::CreateTransaction` are initialized.
Rename ecc_addresses to bp_addresses in chainparams.cpp.
Make DEFAULT_BLOCK_UNPAID_ACTION_LIMIT zero. fixes #6899 (see that issue for rationale)
Add more detail to the "tx unpaid action limit exceeded" message.
Use at least the ZIP 317 fee for Sprout->Sapling migration.
Repair the RPC tests.
Add a regression test for the ZIP 317 default fee bug (#6956), and make the tests pass for now.
Code of Conduct: update email addresses and remove Sean as a contact.
Code of Conduct: add Kris and Str4d as contacts.
Jack Grigg (24):
depends: Update Rust to 1.81.0
depends: native_cmake 3.30.3
depends: cxx 1.0.128
cargo vet prune
cargo update
qa: Postpone Boost, LevelDB, and Clang updates
Fix clippy lints for 1.81
Remove `#[should_panic]` tests of `extern "C"` functions
depends: Fix incompatibility between libsodium 1.0.20 and Clang 18
depends: Downgrade libc++ for MinGW to 18.1.6-1
Migrate to latest revision of Zcash Rust crates
depends: native_cmake 3.30.4
Update release notes
Decrease support window to 6 weeks for 6.0.0-rc1
make-release.py: Versioning changes for 6.0.0-rc1.
make-release.py: Updated manpages for 6.0.0-rc1.
make-release.py: Updated release notes and changelog for 6.0.0-rc1.
make-release.py: Updated book for 6.0.0-rc1.
qa: Add latest Clang release to postponed updates
Migrate to librustzcash crates revision right before NU6 mainnet height
Set support window back to the usual 16 weeks
Update release notes for 6.0.0
make-release.py: Versioning changes for 6.0.0.
make-release.py: Updated manpages for 6.0.0.
Kris Nuttycombe (1):
Use scopes to make it more obvious that certain variables are never used.
y4ssi (2):
fix gitian-descriptors
Simplify Dockerfile (#6906)

View File

@ -0,0 +1,23 @@
This is a maintenance release that sets a new end-of-service height to help
ensure continuity of services.
Changelog
=========
Daira-Emma Hopwood (6):
Funding streams: Rename INSUFFICIENT_ADDRESSES to INSUFFICIENT_RECIPIENTS.
sapling::Builder: add funding stream outputs in a more predictable order. Previously it was deterministic, but depended on details of the `operator<` implementations of `FundingStreamRecipient`, `SaplingPaymentAddress`, and `CScript`. Now it is just the same order as in `vFundingStreams`.
Simplify `GetActiveFundingStreamElements`.
gtest/test_checkblock.cpp: fix a bug in MockCValidationState that was causing a test warning.
Miner tests: correct a comment, and add another similar comment where it applies. Doc-only.
Update Daira-Emma Hopwood's gpg keys.
Jack Grigg (4):
qa: Fix line wrapping in `show_help`
qa: Postpone all dependency updates until after 6.1.0
make-release.py: Versioning changes for 6.1.0.
make-release.py: Updated manpages for 6.1.0.
Larry Ruane (1):
move Lockbox value logging behind category valuepool

View File

@ -0,0 +1,80 @@
Notable changes
===============
zcashd is being deprecated in 2025. Full nodes are being migrated to zebrad,
and the Zallet wallet is being built as a replacement for the zcashd wallet.
For some of zcashd's JSON-RPC methods, zebrad or Zallet should be a drop-in
replacement. Other JSON-RPC methods may require modified usage, and some
JSON-RPC methods will not be supported.
You can find all information about the zcashd deprecation process on this
webpage, which you can monitor for future updates:
<https://z.cash/support/zcashd-deprecation/>
We are collecting information about how zcashd users are currently using the
existing JSON-RPC methods. The above webpage has a link to a spreadsheet
containing the information we have collected so far, and the planned status
for each JSON-RPC method based on that information. If you have not provided
feedback to us about how you are using the zcashd JSON-RPC interface, please
do so as soon as possible.
To confirm that you are aware that zcashd is being deprecated and that you
will need to migrate to zebrad and/or Zallet in 2025, add the following
option to your config file:
i-am-aware-zcashd-will-be-replaced-by-zebrad-and-zallet-in-2025=1
RPC Changes
-----------
* The RPC methods `keypoolrefill`, `settxfee`, `createrawtransaction`,
`fundrawtransaction`, and `signrawtransaction` have been deprecated, but
are still enabled by default.
* The RPC methods `z_getbalance` (which was previously deprecated), and
`getnetworkhashps`, and the features `deprecationinfo_deprecationheight`
and `gbt_oldhashes`, have been disabled by default. The `addrtype` feature
is now disabled by default even when zcashd is compiled without the
`ENABLE_WALLET` flag.
Changelog
=========
Daira-Emma Hopwood (16):
[doc] user/deprecation.md: add the version in which each feature was default-disabled.
Deprecate RPC methods { `getnetworkhashps`, `keypoolrefill`, `settxfee`, `createrawtransaction`, `fundrawtransaction`, `signrawtransaction` }.
Cosmetics in deprecation messages.
Document that `z_getpaymentdisclosure` and `z_validatepaymentdisclosure` are deprecated.
Default-disable the RPC methods { `z_getbalance`, `getnetworkhashps` }, and the features { `gbt_oldhashes`, `deprecationinfo_deprecationheight` }. Also make sure that the `addrtype` feature is default-disabled regardless of the `ENABLE_WALLET` flag.
Wording changes to address review comments.
Fix RPC tests broken by deprecations.
Allow the RPC help to be displayed for disabled methods.
Add `i-am-aware-zcashd-will-be-replaced-by-zebrad-and-zallet-in-2025` to release notes.
Postpone native updates (after thorough checking with @y4ssi).
Fix URL to the Rust Target Tier Policy.
Update links in the README.
Update crossbeam-channel and tokio in `Cargo.lock` to avoid vulnerable versions and pass `cargo audit`.
Correction to the 6.2.0-rc1 release notes.
make-release.py: Versioning changes for 6.2.0-rc1.
make-release.py: Updated manpages for 6.2.0-rc1.
Jack Grigg (9):
depends: utfcpp 4.0.6
depends: native_fmt 11.1.1
depends: native_xxhash 0.8.3
depends: native_cmake 3.31.3
cargo vet prune
depends: cxx 1.0.136
cargo update
CI: Migrate to `cargo-vet 0.10`
Add a warning modal for zcashd deprecation
Larry Ruane (1):
fix CI lint error
Maciej S. Szmigiero (1):
dbwrapper: Bump max file size to 32 MiB
Marius Kjærstad (1):
New checkpoint at block 2800000 for mainnet

View File

@ -0,0 +1,100 @@
Notable changes
===============
zcashd is being deprecated in 2025. Full nodes are being migrated to zebrad,
and the Zallet wallet is being built as a replacement for the zcashd wallet.
For some of zcashd's JSON-RPC methods, zebrad or Zallet should be a drop-in
replacement. Other JSON-RPC methods may require modified usage, and some
JSON-RPC methods will not be supported.
You can find all information about the zcashd deprecation process on this
webpage, which you can monitor for future updates:
<https://z.cash/support/zcashd-deprecation/>
We are collecting information about how zcashd users are currently using the
existing JSON-RPC methods. The above webpage has a link to a spreadsheet
containing the information we have collected so far, and the planned status
for each JSON-RPC method based on that information. If you have not provided
feedback to us about how you are using the zcashd JSON-RPC interface, please
do so as soon as possible.
To confirm that you are aware that zcashd is being deprecated and that you
will need to migrate to zebrad and/or Zallet in 2025, add the following
option to your config file:
i-am-aware-zcashd-will-be-replaced-by-zebrad-and-zallet-in-2025=1
Platform Support
----------------
- Ubuntu 20.04 LTS has been removed from the list of supported platforms. It
will reach End of Support on May 31st 2025, but it no longer satisfies our
Tier 2 policy requirements because GitHub no longer supports Ubuntu 20.04
runners.
RPC Changes
-----------
* The RPC methods `keypoolrefill`, `settxfee`, `createrawtransaction`,
`fundrawtransaction`, and `signrawtransaction` have been deprecated, but
are still enabled by default.
* The RPC methods `z_getbalance` (which was previously deprecated), and
`getnetworkhashps`, and the features `deprecationinfo_deprecationheight`
and `gbt_oldhashes`, have been disabled by default. The `addrtype` feature
is now disabled by default even when zcashd is compiled without the
`ENABLE_WALLET` flag.
Changelog
=========
Daira-Emma Hopwood (28):
[doc] user/deprecation.md: add the version in which each feature was default-disabled.
Deprecate RPC methods { `getnetworkhashps`, `keypoolrefill`, `settxfee`, `createrawtransaction`, `fundrawtransaction`, `signrawtransaction` }.
Cosmetics in deprecation messages.
Document that `z_getpaymentdisclosure` and `z_validatepaymentdisclosure` are deprecated.
Default-disable the RPC methods { `z_getbalance`, `getnetworkhashps` }, and the features { `gbt_oldhashes`, `deprecationinfo_deprecationheight` }. Also make sure that the `addrtype` feature is default-disabled regardless of the `ENABLE_WALLET` flag.
Wording changes to address review comments.
Fix RPC tests broken by deprecations.
Allow the RPC help to be displayed for disabled methods.
Add `i-am-aware-zcashd-will-be-replaced-by-zebrad-and-zallet-in-2025` to release notes.
Postpone native updates (after thorough checking with @y4ssi).
Fix URL to the Rust Target Tier Policy.
Update links in the README.
Update crossbeam-channel and tokio in `Cargo.lock` to avoid vulnerable versions and pass `cargo audit`.
Correction to the 6.2.0-rc1 release notes.
make-release.py: Versioning changes for 6.2.0-rc1.
make-release.py: Updated manpages for 6.2.0-rc1.
make-release.py: Updated release notes and changelog for 6.2.0-rc1.
make-release.py: Updated book for 6.2.0-rc1.
Trivial doc update to poke CI.
Update audits.
Postpone C++ dependency updates for the v6.2.0 release.
Remove Ubuntu 20.04 from the list of supported platforms because GitHub no longer supports CI runners for it.
contrib/devtools/symbol-check.py: Update allowed library versions and documentation.
CI: Bump the Ubuntu runner version used for Debian.
Move Ubuntu 22.04 support to Tier 1.
CI: Test on Ubuntu 24.04 as Tier 3.
make-release.py: Versioning changes for 6.2.0.
make-release.py: Updated manpages for 6.2.0.
Jack Grigg (9):
depends: utfcpp 4.0.6
depends: native_fmt 11.1.1
depends: native_xxhash 0.8.3
depends: native_cmake 3.31.3
cargo vet prune
depends: cxx 1.0.136
cargo update
CI: Migrate to `cargo-vet 0.10`
Add a warning modal for zcashd deprecation
Larry Ruane (1):
fix CI lint error
Maciej S. Szmigiero (1):
dbwrapper: Bump max file size to 32 MiB
Marius Kjærstad (1):
New checkpoint at block 2800000 for mainnet

View File

@ -37,12 +37,11 @@ SERIAL_SCRIPTS = [
FLAKY_SCRIPTS = [
# These tests have intermittent failures that we haven't diagnosed yet.
'mempool_nu_activation.py',
'mempool_nu_activation.py', # this *may* be fixed
'mempool_packages.py',
]
BASE_SCRIPTS= [
# Scripts that are run by the travis build process
# Longest test should go first, to favor running tests in parallel
# vv Tests less than 5m vv
'wallet.py',
@ -94,6 +93,7 @@ BASE_SCRIPTS= [
'wallet_sendmany_any_taddr.py',
'wallet_treestate.py',
'wallet_unified_change.py',
'wallet_zip317_default.py',
'listtransactions.py',
'mempool_resurrect_test.py',
'txn_doublespend.py',

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
#
@ -32,6 +32,8 @@ from test_framework.script import (
OP_DROP,
)
from test_framework.zip317 import MARGINAL_FEE
from test_framework.mininode import (
COIN,
CTransaction,
@ -50,7 +52,6 @@ class AddressIndexTest(BitcoinTestFramework):
def setup_network(self):
base_args = [
'-minrelaytxfee=0',
'-debug',
'-txindex',
'-experimentalfeatures',
@ -374,7 +375,7 @@ class AddressIndexTest(BitcoinTestFramework):
tx.vout = [
CTxOut(1 * COIN, scriptPubKey),
CTxOut(2 * COIN, scriptPubKey),
CTxOut(7 * COIN, scriptUnknown),
CTxOut(7 * COIN - 3 * MARGINAL_FEE, scriptUnknown),
]
tx = self.nodes[0].signrawtransaction(hexlify(tx.serialize()).decode('utf-8'))
txid = self.nodes[0].sendrawtransaction(tx['hex'], True)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2021 The Zcash developers
# Copyright (c) 2021-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -21,7 +21,6 @@ from test_framework.util import (
HEARTWOOD_BRANCH_ID,
CANOPY_BRANCH_ID,
NU5_BRANCH_ID,
LEGACY_DEFAULT_FEE,
assert_equal,
assert_false,
assert_true,
@ -31,6 +30,7 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import ZIP_317_FEE
from tx_expiry_helper import TestNode
import os.path
@ -201,7 +201,7 @@ class Zip239Test(BitcoinTestFramework):
opid = self.nodes[0].z_sendmany(sproutzaddr, [{
'address': node1_taddr,
'amount': 1,
}], 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
}], 1, ZIP_317_FEE, 'AllowRevealedRecipients')
v4_txid = uint256_from_reversed_hex(
wait_and_assert_operationid_status(self.nodes[0], opid)
)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -14,6 +14,7 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
@ -33,7 +34,6 @@ class FinalOrchardRootTest(BitcoinTestFramework):
def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-txindex', # Avoid JSONRPC error: No information available about transaction
'-reindex', # Required due to enabling -txindex
nuparams(NU5_BRANCH_ID, 200),
@ -138,9 +138,9 @@ class FinalOrchardRootTest(BitcoinTestFramework):
assert_equal(acct0, addrRes0['account'])
assert_equal(addrRes0['receiver_types'], ['orchard'])
orchardAddr0 = addrRes0['address']
recipients = []
recipients.append({"address": orchardAddr0, "amount": Decimal('10')})
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, 0, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{"address": orchardAddr0, "amount": Decimal('10') - fee}]
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, fee, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -158,8 +158,8 @@ class FinalOrchardRootTest(BitcoinTestFramework):
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
# Since there is now an Orchard shielded input in the blockchain,
# the Orchard values should have changed
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["orchard"]["commitments"]["finalRoot"], root)
assert_equal(new_treestate["sprout"], treestate["sprout"])
@ -192,8 +192,9 @@ class FinalOrchardRootTest(BitcoinTestFramework):
# Mine a block with a Sprout shielded tx and verify the final Orchard root does not change
zaddr0 = self.nodes[0].listaddresses()[0]['sprout']['addresses'][0]
assert_equal(self.nodes[0].z_getbalance(zaddr0), Decimal('50'))
fee = conventional_fee(3)
recipients = [{"address": taddr0, "amount": Decimal('12.34')}]
opid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, 0, 'AllowRevealedRecipients')
opid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
@ -202,7 +203,7 @@ class FinalOrchardRootTest(BitcoinTestFramework):
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(self.nodes[0].z_getbalance(zaddr0), Decimal("37.66") - fee)
assert_equal(root, blk["finalorchardroot"])
assert_equal(blk["trees"]["orchard"]["size"], 2)
@ -218,7 +219,7 @@ class FinalOrchardRootTest(BitcoinTestFramework):
# Mine a block with a Sapling shielded tx and verify the final Orchard root does not change
saplingAddr1 = self.nodes[1].z_getnewaddress("sapling")
recipients = [{"address": saplingAddr1, "amount": Decimal('2.34')}]
myopid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, 0, 'AllowRevealedAmounts')
myopid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, ZIP_317_FEE, 'AllowRevealedAmounts')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -247,7 +248,7 @@ class FinalOrchardRootTest(BitcoinTestFramework):
assert_equal(addrRes1['receiver_types'], ['orchard'])
orchardAddr1 = addrRes1['address']
recipients = [{"address": orchardAddr1, "amount": Decimal('2.34')}]
myopid = self.nodes[0].z_sendmany(orchardAddr0, recipients, 1, 0)
myopid = self.nodes[0].z_sendmany(orchardAddr0, recipients, 1, ZIP_317_FEE)
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -275,9 +276,9 @@ class FinalOrchardRootTest(BitcoinTestFramework):
# Mine a block with an Orchard shielded sender and transparent recipient and verify the final Orchard root changes (because actions)
taddr2 = self.nodes[0].getnewaddress()
recipients = []
recipients.append({"address": taddr2, "amount": Decimal('2.34')})
myopid = self.nodes[1].z_sendmany(orchardAddr1, recipients, 1, 0, 'AllowRevealedRecipients')
fee = conventional_fee(3)
recipients = [{"address": taddr2, "amount": Decimal('2.34') - fee}]
myopid = self.nodes[1].z_sendmany(orchardAddr1, recipients, 1, fee, 'AllowRevealedRecipients')
mytxid = wait_and_assert_operationid_status(self.nodes[1], myopid)
self.sync_all()
@ -286,7 +287,8 @@ class FinalOrchardRootTest(BitcoinTestFramework):
blk = self.nodes[0].getblock("217")
assert_equal(len(blk["tx"]), 2)
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("2.34"))
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("2.34") - fee)
assert_equal(self.nodes[1].z_getbalance(orchardAddr1), 0)
assert root != blk["finalorchardroot"]
# Verify there is a Orchard output description (its commitment was added to tree)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -14,6 +14,7 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
@ -33,7 +34,6 @@ class FinalSaplingRootTest(BitcoinTestFramework):
def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-txindex', # Avoid JSONRPC error: No information available about transaction
'-reindex', # Required due to enabling -txindex
nuparams(NU5_BRANCH_ID, 210),
@ -105,9 +105,9 @@ class FinalSaplingRootTest(BitcoinTestFramework):
# Node 0 shields some funds
taddr0 = get_coinbase_address(self.nodes[0])
saplingAddr0 = self.nodes[0].z_getnewaddress('sapling')
recipients = []
recipients.append({"address": saplingAddr0, "amount": Decimal('10')})
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, 0, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{"address": saplingAddr0, "amount": Decimal('10') - fee}]
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, fee, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -125,8 +125,8 @@ class FinalSaplingRootTest(BitcoinTestFramework):
assert_equal(len(result["vShieldedOutput"]), 2) # Non-coinbase bundles are padded
assert_equal(blk["trees"]["sapling"]["size"], 2)
# Since there is a now sapling shielded input in the blockchain,
# the sapling values should have changed
# Since there is now a Sapling shielded input in the blockchain,
# the Sapling values should have changed
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["sapling"]["commitments"]["finalRoot"], root)
assert_equal(new_treestate["sprout"], treestate["sprout"])
@ -159,8 +159,9 @@ class FinalSaplingRootTest(BitcoinTestFramework):
# Mine a block with a Sprout shielded tx and verify the final Sapling root does not change
zaddr0 = self.nodes[0].listaddresses()[0]['sprout']['addresses'][0]
assert_equal(self.nodes[0].z_getbalance(zaddr0), Decimal('50'))
fee = conventional_fee(3)
recipients = [{"address": taddr0, "amount": Decimal('12.34')}]
opid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, 0, 'AllowRevealedRecipients')
opid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
@ -169,7 +170,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
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(self.nodes[0].z_getbalance(zaddr0), Decimal("37.66") - fee)
assert_equal(root, blk["finalsaplingroot"])
assert_equal(blk["trees"]["sapling"]["size"], 2)
@ -185,7 +186,7 @@ class FinalSaplingRootTest(BitcoinTestFramework):
# Mine a block with a Sapling shielded recipient and verify the final Sapling root changes
saplingAddr1 = self.nodes[1].z_getnewaddress("sapling")
recipients = [{"address": saplingAddr1, "amount": Decimal('2.34')}]
myopid = self.nodes[0].z_sendmany(saplingAddr0, recipients, 1, 0)
myopid = self.nodes[0].z_sendmany(saplingAddr0, recipients, 1, ZIP_317_FEE)
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -212,9 +213,9 @@ class FinalSaplingRootTest(BitcoinTestFramework):
# 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')})
myopid = self.nodes[1].z_sendmany(saplingAddr1, recipients, 1, 0, 'AllowRevealedRecipients')
fee = conventional_fee(3)
recipients = [{"address": taddr2, "amount": Decimal('2.34') - fee}]
myopid = self.nodes[1].z_sendmany(saplingAddr1, recipients, 1, fee, 'AllowRevealedRecipients')
mytxid = wait_and_assert_operationid_status(self.nodes[1], myopid)
self.sync_all()
@ -224,13 +225,11 @@ class FinalSaplingRootTest(BitcoinTestFramework):
blk = self.nodes[0].getblock("206")
assert_equal(len(blk["tx"]), 2)
assert_equal(mytxid, blk["tx"][1])
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("2.34"))
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("2.34") - fee)
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).
print(self.nodes[0].getrawtransaction(blk["tx"][0]))
print(self.nodes[0].getrawtransaction(blk["tx"][1]))
root = blk["finalsaplingroot"]
assert root != self.nodes[0].getblock("205")["finalsaplingroot"]
assert_equal(blk["trees"]["sapling"]["size"], 6)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2016 The Zcash developers
# Copyright (c) 2016-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -9,7 +9,6 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
CANOPY_BRANCH_ID,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
get_coinbase_address,
hex_str_to_bytes,
@ -24,6 +23,8 @@ from test_framework.mininode import (
from test_framework.blocktools import (
create_block
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
class GetBlockTemplateTest(BitcoinTestFramework):
@ -43,6 +44,7 @@ class GetBlockTemplateTest(BitcoinTestFramework):
nuparams(NU5_BRANCH_ID, 230),
"-allowdeprecated=getnewaddress",
"-allowdeprecated=z_getbalance",
"-allowdeprecated=gbt_oldhashes",
]
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [args] * self.num_nodes)
self.is_network_split = False
@ -52,13 +54,14 @@ 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, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
myopid = node.z_sendmany(self.sprout_addr, recipients, 1, ZIP_317_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, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{"address": self.unified_addr, "amount": Decimal('10') - fee}]
myopid = node.z_sendmany(get_coinbase_address(node), recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(node, myopid)
def add_transparent_tx_to_mempool(self):
@ -196,7 +199,6 @@ class GetBlockTemplateTest(BitcoinTestFramework):
print("- block with 6 Orchard transactions (plus coinbase)")
for i in range(0, 6):
print(str(node.z_getbalance(self.transparent_addr)))
self.add_nu5_v5_tx_to_mempool()
self.gbt_submitblock(True)

View File

@ -1,15 +1,17 @@
#!/usr/bin/env python3
#
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2021-2024 The Zcash developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.comptool import TestManager, TestInstance, RejectResult
from test_framework.mininode import NetworkThread
from test_framework.mininode import NetworkThread, COIN
from test_framework.blocktools import create_block, create_coinbase, create_transaction
import time
from test_framework.zip317 import MINIMUM_FEE
import time
'''
In this test we connect to one node over p2p, and test tx requests.
@ -19,7 +21,6 @@ In this test we connect to one node over p2p, and test tx requests.
class InvalidTxRequestTest(ComparisonTestFramework):
def __init__(self):
super().__init__()
self.additional_args = ['-minrelaytxfee=0']
''' Can either run this test as 1 node with expected answers, or two and compare them.
Change the "outcome" variable from each TestInstance object to only do the comparison. '''
@ -64,7 +65,7 @@ class InvalidTxRequestTest(ComparisonTestFramework):
# b'\x64' is OP_NOTIF
# Transaction will be rejected with code 16 (REJECT_INVALID)
tx1 = create_transaction(self.block1.vtx[0], 0, b'\x64', 10*100000000)
tx1 = create_transaction(self.block1.vtx[0], 0, b'\x64', 10*COIN - MINIMUM_FEE)
yield TestInstance([[tx1, RejectResult(16, b'mandatory-script-verify-flag-failed')]])
# TODO: test further transactions...

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2019-2022 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -67,28 +67,24 @@ class MempoolLimit(BitcoinTestFramework):
zaddr1 = self.nodes[0].z_getnewaddress('sapling')
zaddr2 = self.nodes[0].z_getnewaddress('sapling')
zaddr3 = self.nodes[0].z_getnewaddress('sapling')
fee = conventional_fee(2)
print("Filling mempool...")
opid1 = self.nodes[1].z_sendmany(
get_coinbase_address(self.nodes[1]),
[{"address": zaddr1, "amount": Decimal('10.0') - fee}],
1, fee, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{"address": zaddr1, "amount": Decimal('10.0') - fee}]
opid1 = self.nodes[1].z_sendmany(get_coinbase_address(self.nodes[1]), recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[1], opid1)
opid2 = self.nodes[2].z_sendmany(
get_coinbase_address(self.nodes[2]),
[{"address": zaddr2, "amount": Decimal('10.0') - fee}],
1, fee, 'AllowRevealedSenders')
recipients = [{"address": zaddr2, "amount": Decimal('10.0') - fee}]
opid2 = self.nodes[2].z_sendmany(get_coinbase_address(self.nodes[2]), recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[2], opid2)
self.sync_all()
self.check_mempool_sizes(2)
print("Adding one more transaction...")
opid3 = self.nodes[3].z_sendmany(
get_coinbase_address(self.nodes[3]),
[{"address": zaddr3, "amount": Decimal('10.0') - fee}],
1, fee, 'AllowRevealedSenders')
recipients = [{"address": zaddr3, "amount": Decimal('10.0') - fee}]
opid3 = self.nodes[3].z_sendmany(get_coinbase_address(self.nodes[3]), recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[3], opid3)
# The mempools are no longer guaranteed to be in a consistent state, so we cannot sync
sleep(5)
@ -106,9 +102,10 @@ class MempoolLimit(BitcoinTestFramework):
print("Checking mempool size reset after block mined...")
self.check_mempool_sizes(0)
zaddr4 = self.nodes[0].z_getnewaddress('sapling')
opid4 = self.nodes[0].z_sendmany(zaddr1, [{"address": zaddr4, "amount": Decimal('10.0') - 2*fee}], 1)
recipients = [{"address": zaddr4, "amount": Decimal('10.0') - 2*fee}]
opid4 = self.nodes[0].z_sendmany(zaddr1, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[0], opid4)
opid5 = self.nodes[0].z_sendmany(zaddr2, [{"address": zaddr4, "amount": Decimal('10.0') - 2*fee}], 1)
opid5 = self.nodes[0].z_sendmany(zaddr2, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[0], opid5)
self.sync_all()

View File

@ -1,20 +1,21 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 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.mininode import NU5_PROTO_VERSION
from test_framework.util import (
BLOSSOM_BRANCH_ID,
CANOPY_BRANCH_ID,
HEARTWOOD_BRANCH_ID,
NU5_BRANCH_ID,
NU6_BRANCH_ID,
assert_equal, assert_true,
nuparams,
start_node, connect_nodes, wait_and_assert_operationid_status,
get_coinbase_address
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -30,18 +31,17 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework):
def setup_network(self):
args = [
'-minrelaytxfee=0',
'-checkmempool',
'-debug=mempool',
'-blockmaxsize=4000',
'-allowdeprecated=getnewaddress',
'-allowdeprecated=legacy_privacy',
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
nuparams(BLOSSOM_BRANCH_ID, 200),
nuparams(HEARTWOOD_BRANCH_ID, 210),
nuparams(CANOPY_BRANCH_ID, 220),
nuparams(NU5_BRANCH_ID, 230),
nuparams(NU6_BRANCH_ID, 240),
]
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, args))
@ -62,9 +62,13 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework):
# Shield some ZEC
node1_taddr = get_coinbase_address(self.nodes[1])
node0_zaddr = self.nodes[0].z_getnewaddress('sapling')
recipients = [{'address': node0_zaddr, 'amount': Decimal('10')}]
myopid = self.nodes[1].z_sendmany(node1_taddr, recipients, 1, 0)
print(wait_and_assert_operationid_status(self.nodes[1], myopid))
coinbase_fee = conventional_fee(3)
recipients = [{'address': node0_zaddr, 'amount': Decimal('10') - coinbase_fee}]
myopid = self.nodes[1].z_sendmany(node1_taddr, recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[1], myopid)
node0_balance = Decimal('10') - coinbase_fee
fee = conventional_fee(2)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
@ -79,15 +83,23 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework):
assert_equal(set(self.nodes[0].getrawmempool()), set())
# Check node 0 shielded balance
assert_equal(self.nodes[0].z_getbalance(node0_zaddr), Decimal('10'))
assert_equal(self.nodes[0].z_getbalance(node0_zaddr), node0_balance)
# Fill the mempool with more transactions than can fit into 4 blocks
# (note `-blockmaxsize=4000` in the node arguments).
node0_taddr = self.nodes[0].getnewaddress()
x_txids = []
print("Filling mempool", end="", flush=True)
while self.nodes[1].getmempoolinfo()['bytes'] < 8 * 4000:
x_txids.append(self.nodes[1].sendtoaddress(node0_taddr, Decimal('0.001')))
if len(x_txids) % 10 == 0:
print(".", end="", flush=True)
# this sync is important for reliability
self.sync_all()
self.sync_all()
print(" done")
# Spends should be in the mempool
x_mempool = set(self.nodes[0].getrawmempool())
assert_equal(x_mempool, set(x_txids))
@ -147,8 +159,8 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework):
self.sync_all()
# Create a shielded Y transaction
recipients = [{'address': node0_zaddr, 'amount': Decimal('10')}]
myopid = self.nodes[0].z_sendmany(node0_zaddr, recipients, 1,0)
recipients = [{'address': node0_zaddr, 'amount': node0_balance - fee}]
myopid = self.nodes[0].z_sendmany(node0_zaddr, recipients, 1, fee)
shielded = wait_and_assert_operationid_status(self.nodes[0], myopid)
assert(shielded != None)
y_txids.append(shielded)
@ -179,7 +191,7 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework):
assert_equal(set(self.nodes[1].getrawmempool()), set(y_txids))
# Node 0 note should be spendable again
assert_equal(self.nodes[0].z_getbalance(node0_zaddr), Decimal('10'))
assert_equal(self.nodes[0].z_getbalance(node0_zaddr), node0_balance)
# Reconsider block H - 1.
self.nodes[0].reconsiderblock(block_hm1)
@ -189,28 +201,31 @@ class MempoolUpgradeActivationTest(BitcoinTestFramework):
self.nodes[1].generate(6)
self.sync_all()
net_version = self.nodes[0].getnetworkinfo()["protocolversion"]
print('Testing Sapling -> Blossom activation boundary')
# Current height = 195
assert_equal(self.nodes[0].getblockcount(), 195)
nu_activation_checks()
# Current height = 205
node0_balance -= fee
assert_equal(self.nodes[0].getblockcount(), 205)
print('Testing Blossom -> Heartwood activation boundary')
nu_activation_checks()
# Current height = 215
node0_balance -= fee
assert_equal(self.nodes[0].getblockcount(), 215)
print('Testing Heartwood -> Canopy activation boundary')
nu_activation_checks()
# Current height = 225
if net_version < NU5_PROTO_VERSION:
print("Node's block index is not NU5-aware, skipping remaining tests")
return
node0_balance -= fee
assert_equal(self.nodes[0].getblockcount(), 225)
print('Testing Canopy -> NU5 activation boundary')
nu_activation_checks()
# Current height = 235
node0_balance -= fee
assert_equal(self.nodes[0].getblockcount(), 235)
print('Testing NU5 -> NU6 activation boundary')
nu_activation_checks()
node0_balance -= fee
assert_equal(self.nodes[0].getblockcount(), 245)
if __name__ == '__main__':
MempoolUpgradeActivationTest().main()

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@ -28,10 +29,11 @@ class MempoolPackagesTest(BitcoinTestFramework):
def setup_network(self):
base_args = [
'-limitdescendantcount=%d' % (self.limitdescendantcount,),
'-minrelaytxfee=0',
'-maxorphantx=%d' % (self.limitdescendantcount,),
'-debug',
'-allowdeprecated=getnewaddress',
'-allowdeprecated=createrawtransaction',
'-allowdeprecated=signrawtransaction',
]
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, base_args))
@ -63,7 +65,7 @@ class MempoolPackagesTest(BitcoinTestFramework):
vout = utxo[0]['vout']
value = utxo[0]['amount']
fee = conventional_fee(2)
fee = conventional_fee(10)
# 100 transactions off a confirmed tx should be fine
chain = []
for i in range(100):
@ -195,6 +197,7 @@ class MempoolPackagesTest(BitcoinTestFramework):
value = utxo[0]['amount']
vout = utxo[0]['vout']
fee = conventional_fee(8)
send_value = satoshi_round((value - fee)/2)
inputs = [ {'txid' : txid, 'vout' : vout} ]
outputs = {}

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2019-2022 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -9,9 +9,12 @@
# that spend (directly or indirectly) coinbase transactions.
#
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_raises, start_node, connect_nodes
from test_framework.zip317 import conventional_fee
# Create one-input, one-output, no-fee transaction:
@ -24,7 +27,6 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
def setup_network(self):
args = [
'-minrelaytxfee=0',
'-checkmempool',
'-debug=mempool',
'-allowdeprecated=getnewaddress',
@ -61,12 +63,13 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
# and make sure the mempool code behaves correctly.
b = [ self.nodes[0].getblockhash(n) for n in range(101, 105) ]
coinbase_txids = [ self.nodes[0].getblock(h)['tx'][0] for h in b ]
spend_101_raw = self.create_tx(coinbase_txids[1], node1_address, 10)
spend_102_raw = self.create_tx(coinbase_txids[2], node0_address, 10)
spend_103_raw = self.create_tx(coinbase_txids[3], node0_address, 10)
fee = conventional_fee(2)
spend_101_raw = self.create_tx(coinbase_txids[1], node1_address, Decimal('10') - fee)
spend_102_raw = self.create_tx(coinbase_txids[2], node0_address, Decimal('10') - fee)
spend_103_raw = self.create_tx(coinbase_txids[3], node0_address, Decimal('10') - fee)
# Create a block-height-locked transaction which will be invalid after reorg
timelock_tx = self.nodes[0].createrawtransaction([{"txid": coinbase_txids[0], "vout": 0}], {node0_address: 10})
timelock_tx = self.nodes[0].createrawtransaction([{"txid": coinbase_txids[0], "vout": 0}], {node0_address: Decimal('10') - fee})
# Set the time lock, ensuring we don't clobber the rest of the Sapling v4 tx format
timelock_tx = timelock_tx.replace("ffffffff", "11111111", 1)
timelock_tx = timelock_tx[:-38] + hex(self.nodes[0].getblockcount() + 2)[2:] + "000000" + timelock_tx[-30:]
@ -80,8 +83,8 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
assert_raises(JSONRPCException, self.nodes[0].sendrawtransaction, timelock_tx)
# Create 102_1 and 103_1:
spend_102_1_raw = self.create_tx(spend_102_id, node1_address, 10)
spend_103_1_raw = self.create_tx(spend_103_id, node1_address, 10)
spend_102_1_raw = self.create_tx(spend_102_id, node1_address, Decimal('10') - 2*fee)
spend_103_1_raw = self.create_tx(spend_103_id, node1_address, Decimal('10') - 2*fee)
# Broadcast and mine 103_1:
spend_103_1_id = self.nodes[0].sendrawtransaction(spend_103_1_raw)

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Copyright (c) 2016-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -10,7 +10,8 @@
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, start_node, LEGACY_DEFAULT_FEE
from test_framework.util import assert_equal, start_node
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -25,7 +26,6 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
def setup_network(self):
# Just need one node for this test
args = [
'-minrelaytxfee=0',
'-checkmempool',
'-debug=mempool',
'-allowdeprecated=getnewaddress',
@ -56,13 +56,14 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
b = [ self.nodes[0].getblockhash(n) for n in range(1, 4) ]
coinbase_txids = [ self.nodes[0].getblock(h)['tx'][0] for h in b ]
spends1_raw = [ self.create_tx(txid, node0_address, 10) for txid in coinbase_txids ]
fee = conventional_fee(1)
spends1_raw = [ self.create_tx(txid, node0_address, Decimal('10') - fee) for txid in coinbase_txids ]
spends1_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends1_raw ]
blocks = []
blocks.extend(self.nodes[0].generate(1))
spends2_raw = [ self.create_tx(txid, node0_address, Decimal('10.0') - LEGACY_DEFAULT_FEE) for txid in spends1_id ]
spends2_raw = [ self.create_tx(txid, node0_address, Decimal('10') - 2*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

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Copyright (c) 2016-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -14,10 +14,13 @@
# but less mature coinbase spends are NOT.
#
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, assert_raises, \
start_node
from test_framework.zip317 import conventional_fee
# Create one-input, one-output, no-fee transaction:
@ -30,7 +33,6 @@ class MempoolSpendCoinbaseTest(BitcoinTestFramework):
def setup_network(self):
# Just need one node for this test
args = [
'-minrelaytxfee=0',
'-checkmempool',
'-debug=mempool',
'-allowdeprecated=getnewaddress',
@ -57,7 +59,8 @@ class MempoolSpendCoinbaseTest(BitcoinTestFramework):
# is too immature to spend.
b = [ self.nodes[0].getblockhash(n) for n in range(101, 103) ]
coinbase_txids = [ self.nodes[0].getblock(h)['tx'][0] for h in b ]
spends_raw = [ self.create_tx(txid, node0_address, 10) for txid in coinbase_txids ]
fee = conventional_fee(1)
spends_raw = [ self.create_tx(txid, node0_address, Decimal('10') - fee) for txid in coinbase_txids ]
spend_101_id = self.nodes[0].sendrawtransaction(spends_raw[0])

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -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, LEGACY_DEFAULT_FEE
wait_and_assert_operationid_status
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -23,7 +23,6 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-txexpirydelta=%d' % TX_EXPIRY_DELTA,
'-debug=mempool',
'-allowdeprecated=getnewaddress',
@ -43,7 +42,7 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
self.split_network()
# Test dependent txs
firstTx = self.nodes[0].sendtoaddress(alice, 0.1)
firstTx = self.nodes[0].sendtoaddress(alice, Decimal('0.1'))
firstTxInfo = self.nodes[0].getrawtransaction(firstTx, 1)
assert_equal(firstTxInfo["version"], 4)
assert_equal(firstTxInfo["overwintered"], True)
@ -56,7 +55,8 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
vout = outpoint
break
inputs = [{'txid': firstTx, 'vout': vout['n'], 'scriptPubKey': vout['scriptPubKey']['hex']}]
outputs = {alice: 0.1}
fee = conventional_fee(2)
outputs = {alice: Decimal('0.1') - fee}
rawTx = self.nodes[0].createrawtransaction(inputs, outputs)
rawTxSigned = self.nodes[0].signrawtransaction(rawTx)
assert(rawTxSigned['complete'])
@ -79,7 +79,8 @@ 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, LEGACY_DEFAULT_FEE, 1)
coinbase_fee = conventional_fee(3)
res = self.nodes[0].z_shieldcoinbase("*", z_alice, coinbase_fee, 1)
wait_and_assert_operationid_status(self.nodes[0], res['opid'])
self.nodes[0].generate(1)
self.sync_all()
@ -87,17 +88,16 @@ 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') - LEGACY_DEFAULT_FEE)
assert_equal(Decimal(bal["private"]), Decimal('10.0') - coinbase_fee)
print("Splitting network...")
self.split_network()
# Create transactions
blockheight = self.nodes[0].getblockchaininfo()['blocks']
zsendamount = Decimal('1.0') - conventional_fee(2)
recipients = []
recipients.append({"address": z_bob, "amount": zsendamount})
myopid = self.nodes[0].z_sendmany(z_alice, recipients, 1)
fee = conventional_fee(2)
recipients = [{"address": z_bob, "amount": Decimal('1.0') - fee}]
myopid = self.nodes[0].z_sendmany(z_alice, recipients, 1, fee)
persist_shielded = wait_and_assert_operationid_status(self.nodes[0], myopid)
persist_transparent = self.nodes[0].sendtoaddress(bob, 0.01)
# Verify transparent transaction is version 4 intended for Sapling branch
@ -196,9 +196,10 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
print("\nBlockheight advances to greater than expiry block height. After reorg, txs should expire from mempool")
print("Balance before expire_shielded is sent: ", self.nodes[0].z_gettotalbalance())
myopid = self.nodes[0].z_sendmany(z_alice, recipients, 1)
fee = conventional_fee(2)
myopid = self.nodes[0].z_sendmany(z_alice, recipients, 1, fee)
expire_shielded = wait_and_assert_operationid_status(self.nodes[0], myopid)
expire_transparent = self.nodes[0].sendtoaddress(bob, 0.01)
expire_transparent = self.nodes[0].sendtoaddress(bob, Decimal('0.01'))
print("Blockheight node 0 at expire_transparent creation:", self.nodes[0].getblockchaininfo()['blocks'])
print("Blockheight node 2 at expire_shielded creation:", self.nodes[2].getblockchaininfo()['blocks'])
print("Expiryheight of expire_transparent:", self.nodes[0].getrawtransaction(expire_transparent, 1)['expiryheight'])
@ -220,7 +221,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') - LEGACY_DEFAULT_FEE)
assert_equal(Decimal(bal["private"]), Decimal('8.0') - coinbase_fee)
print("Splitting network...")
self.split_network()
@ -229,7 +230,7 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
print("Balance before expire_shielded is sent: ", self.nodes[0].z_gettotalbalance())
myopid = self.nodes[0].z_sendmany(z_alice, recipients, 1)
expire_shielded = wait_and_assert_operationid_status(self.nodes[0], myopid)
expire_transparent = self.nodes[0].sendtoaddress(bob, 0.01)
expire_transparent = self.nodes[0].sendtoaddress(bob, Decimal('0.01'))
print("Blockheight node 0 at expire_transparent creation:", self.nodes[0].getblockchaininfo()['blocks'])
print("Blockheight node 2 at expire_shielded creation:", self.nodes[2].getblockchaininfo()['blocks'])
print("Expiryheight of expire_transparent:", self.nodes[0].getrawtransaction(expire_transparent, 1)['expiryheight'])

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -10,8 +10,8 @@
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, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
wait_and_assert_operationid_status
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
@ -39,7 +39,6 @@ class MergeToAddressHelper:
def setup_network(self, test, additional_args=[]):
args = [
'-minrelaytxfee=0',
'-debug=zrpcunsafe',
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
@ -86,26 +85,36 @@ class MergeToAddressHelper:
# Shield the coinbase
myzaddr = self.new_address(test, 0)
result = test.nodes[0].z_shieldcoinbase("*", myzaddr, 0, None, None, 'AllowLinkingAccountAddresses')
fee = conventional_fee(7)
result = test.nodes[0].z_shieldcoinbase("*", myzaddr, fee, None, None, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
test.sync_all()
expected_myzaddr = Decimal('50') - fee
assert_equal(test.nodes[0].z_getbalance(myzaddr), expected_myzaddr)
# Prepare some UTXOs and notes for merging
mytaddr = test.nodes[0].getnewaddress()
mytaddr2 = test.nodes[0].getnewaddress()
mytaddr3 = test.nodes[0].getnewaddress()
fee = conventional_fee(6)
result = test.nodes[0].z_sendmany(myzaddr, [
{'address': do_not_shield_taddr, 'amount': Decimal('10')},
{'address': mytaddr, 'amount': Decimal('10')},
{'address': mytaddr2, 'amount': Decimal('10')},
{'address': mytaddr3, 'amount': Decimal('10')},
], 1, 0, 'AllowRevealedRecipients')
], 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(test.nodes[0], result)
test.sync_all()
generate_and_check(test.nodes[1], 2)
test.sync_all()
expected_myzaddr -= Decimal('40') + fee
expected_mytaddr = Decimal('10')
assert_equal(test.nodes[0].z_getbalance(mytaddr), expected_mytaddr)
assert_equal(test.nodes[0].z_getbalance(myzaddr), expected_myzaddr)
# Merging will fail because from arguments need to be in an array
assert_mergetoaddress_exception(
@ -136,22 +145,22 @@ class MergeToAddressHelper:
# Merging will fail because transparent limit parameter must be at least 0
assert_mergetoaddress_exception(
"Limit on maximum number of UTXOs cannot be negative",
lambda: test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, Decimal('0.001'), -1))
lambda: test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, ZIP_317_FEE, -1))
# Merging will fail because transparent limit parameter is absurdly large
assert_mergetoaddress_exception(
"JSON integer out of range",
lambda: test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, Decimal('0.001'), 99999999999999))
lambda: test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, ZIP_317_FEE, 99999999999999))
# Merging will fail because shielded limit parameter must be at least 0
assert_mergetoaddress_exception(
"Limit on maximum number of notes cannot be negative",
lambda: test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, Decimal('0.001'), 50, -1))
lambda: test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, ZIP_317_FEE, 50, -1))
# Merging will fail because shielded limit parameter is absurdly large
assert_mergetoaddress_exception(
"JSON integer out of range",
lambda: test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, Decimal('0.001'), 50, 99999999999999))
lambda: test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, ZIP_317_FEE, 50, 99999999999999))
# Merging will fail for this specific case where it would spend a fee and do nothing
assert_mergetoaddress_exception(
@ -164,22 +173,27 @@ 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, 'AllowLinkingAccountAddresses')
fee = conventional_fee(5)
result = test.nodes[0].z_mergetoaddress([mytaddr, mytaddr2, mytaddr3], myzaddr, fee, None, None, None, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
test.sync_all()
expected_myzaddr += Decimal('30') - fee
expected_mytaddr = 0
# 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(5))
assert_equal(test.nodes[0].z_getbalance(mytaddr), expected_mytaddr)
assert_equal(test.nodes[0].z_getbalance(myzaddr), expected_myzaddr)
assert_equal(test.nodes[1].getbalance(), Decimal('40'))
assert_equal(test.nodes[2].getbalance(), Decimal('30'))
# Shield all notes to another z-addr
myzaddr2 = self.new_address(test, 0)
result = test.nodes[0].z_mergetoaddress(self.any_zaddr, myzaddr2, 0)
fee = conventional_fee(2)
result = test.nodes[0].z_mergetoaddress(self.any_zaddr, myzaddr2, fee)
assert_equal(result["mergingUTXOs"], 0)
assert_equal(result["remainingUTXOs"], 0)
assert_equal(result["mergingNotes"], 2)
@ -188,54 +202,65 @@ class MergeToAddressHelper:
test.sync_all()
generate_and_check(test.nodes[1], 2)
test.sync_all()
expected_myzaddr2 = expected_myzaddr - fee
expected_myzaddr = 0
assert_equal(test.nodes[0].z_getbalance(myzaddr), Decimal('0'))
assert_equal(test.nodes[0].z_getbalance(myzaddr2), Decimal('40') - conventional_fee(5))
assert_equal(test.nodes[0].z_getbalance(myzaddr), expected_myzaddr)
assert_equal(test.nodes[0].z_getbalance(myzaddr2), expected_myzaddr2)
# Shield coinbase UTXOs from any node 2 taddr, and set fee to 0
result = test.nodes[2].z_shieldcoinbase("*", myzaddr, 0, None, None, 'AllowLinkingAccountAddresses')
# Shield coinbase UTXOs from any node 2 taddr
fee = conventional_fee(5)
result = test.nodes[2].z_shieldcoinbase("*", myzaddr, fee, None, None, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(test.nodes[2], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
test.sync_all()
expected_myzaddr += Decimal('30') - fee
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(5))
assert_equal(test.nodes[0].z_getbalance(myzaddr), expected_myzaddr)
assert_equal(test.nodes[0].z_getbalance(myzaddr2), expected_myzaddr2)
assert_equal(test.nodes[1].getbalance(), Decimal('60'))
assert_equal(test.nodes[2].getbalance(), Decimal('0'))
# Merge all notes from node 0 into a node 0 taddr, and set fee to 0
result = test.nodes[0].z_mergetoaddress(self.any_zaddr, mytaddr, 0, None, None, None, 'AllowRevealedRecipients')
# Merge all notes from node 0 into a node 0 taddr
fee = conventional_fee(3)
result = test.nodes[0].z_mergetoaddress(self.any_zaddr, mytaddr, fee, None, None, None, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
test.sync_all()
expected_mytaddr += expected_myzaddr + expected_myzaddr2 - fee
expected_myzaddr = 0
expected_myzaddr2 = 0
assert_equal(test.nodes[0].getbalance(), Decimal('80') - conventional_fee(5))
assert_equal(test.nodes[0].getbalance(), Decimal('10') + expected_mytaddr)
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(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[0].z_getbalance(mytaddr), expected_mytaddr)
assert_equal(test.nodes[0].z_getbalance(myzaddr), expected_myzaddr)
assert_equal(test.nodes[0].z_getbalance(myzaddr2), expected_myzaddr2)
assert_equal(test.nodes[1].getbalance(), Decimal('70'))
assert_equal(test.nodes[2].getbalance(), Decimal('0'))
# Merge all node 0 UTXOs together into a node 1 taddr, and set fee to 0
# Merge all node 0 UTXOs together into a node 1 taddr
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, 'NoPrivacy')
fee = conventional_fee(4)
result = test.nodes[0].z_mergetoaddress(["ANY_TADDR"], n1taddr, fee, None, None, None, 'NoPrivacy')
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
test.sync_all()
generate_and_check(test.nodes[1], 2)
test.sync_all()
assert_equal(0, len(test.nodes[0].z_listunspent(0)))
expected_n1taddr = Decimal('10') + expected_mytaddr - fee
expected_mytaddr = 0
assert_equal(test.nodes[0].getbalance(), Decimal('0'))
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(5))
assert_equal(test.nodes[1].z_getbalance(n1taddr), Decimal('80') - conventional_fee(5))
assert_equal(test.nodes[0].z_getbalance(mytaddr), expected_mytaddr)
assert_equal(test.nodes[0].z_getbalance(myzaddr), expected_myzaddr)
assert_equal(test.nodes[1].getbalance(), Decimal('80') + expected_n1taddr)
assert_equal(test.nodes[1].z_getbalance(n1taddr), expected_n1taddr)
assert_equal(test.nodes[2].getbalance(), Decimal('0'))
# Generate 5 regular UTXOs on node 0, and 20 regular UTXOs on node 2.
@ -251,7 +276,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, LEGACY_DEFAULT_FEE, None, None, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, ZIP_317_FEE, None, None, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 5)
assert_equal(result["remainingUTXOs"], 0)
assert_equal(result["mergingNotes"], 0)
@ -259,7 +284,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, LEGACY_DEFAULT_FEE, 0, None, None, 'AllowRevealedSenders')
result = test.nodes[2].z_mergetoaddress([n2taddr], myzaddr, ZIP_317_FEE, 0, None, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 20)
assert_equal(result["remainingUTXOs"], 0)
assert_equal(result["mergingNotes"], 0)
@ -276,7 +301,7 @@ class MergeToAddressHelper:
test.nodes[1].sendtoaddress(mytaddr, 1)
generate_and_check(test.nodes[1], 101)
test.sync_all()
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, conventional_fee(52), None, None, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, ZIP_317_FEE, None, None, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 50)
assert_equal(result["remainingUTXOs"], 50)
assert_equal(result["mergingNotes"], 0)
@ -288,7 +313,7 @@ class MergeToAddressHelper:
assert_equal(3, len(test.nodes[0].z_listunspent(0)))
# Verify maximum number of UTXOs which node 0 can shield can be set by the limit parameter
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, conventional_fee(35), 33, None, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, ZIP_317_FEE, 33, None, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 33)
assert_equal(result["remainingUTXOs"], 17)
assert_equal(result["mergingNotes"], 0)
@ -303,7 +328,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, LEGACY_DEFAULT_FEE, 50, 2)
result1 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, ZIP_317_FEE, 50, 2)
# First merge should select from all notes
assert_equal(result1["mergingUTXOs"], 0)
@ -313,7 +338,7 @@ class MergeToAddressHelper:
assert_equal(result1["remainingNotes"], 2)
# Second merge should ignore locked notes
result2 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, LEGACY_DEFAULT_FEE, 50, 2)
result2 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, ZIP_317_FEE, 50, 2)
assert_equal(result2["mergingUTXOs"], 0)
assert_equal(result2["remainingUTXOs"], 0)
assert_equal(result2["mergingNotes"], 2)
@ -326,7 +351,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, LEGACY_DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, ZIP_317_FEE, 10, 2, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 10)
assert_equal(result["remainingUTXOs"], 7)
assert_equal(result["mergingNotes"], 2)
@ -334,7 +359,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, LEGACY_DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, ZIP_317_FEE, 10, 2, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 10)
assert_equal(result["remainingUTXOs"], 7)
assert_equal(result["mergingNotes"], 2)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -7,6 +7,7 @@ from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, get_coinbase_address, \
start_nodes, wait_and_assert_operationid_status
from test_framework.zip317 import conventional_fee
from mergetoaddress_helper import assert_mergetoaddress_exception
@ -18,7 +19,6 @@ class MergeToAddressMixedNotes(BitcoinTestFramework):
def setup_nodes(self):
self.num_nodes = 4
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-anchorconfirmations=1',
'-allowdeprecated=getnewaddress',
'-allowdeprecated=legacy_privacy',
@ -38,10 +38,11 @@ class MergeToAddressMixedNotes(BitcoinTestFramework):
assert_equal(self.nodes[0].z_getbalance(saplingAddr), Decimal('0'))
assert_equal(Decimal(self.nodes[1].z_gettotalbalance()["transparent"]), Decimal('200'))
# Make sure we cannot use "ANY_SPROUT" and "ANY_SAPLING" even if we only have Sprout Notes
fee = conventional_fee(3)
assert_mergetoaddress_exception(
"Cannot send from both Sprout and Sapling addresses using z_mergetoaddress",
lambda: self.nodes[0].z_mergetoaddress(["ANY_SPROUT", "ANY_SAPLING"], t_addr))
opid = self.nodes[0].z_sendmany(coinbase_addr, [{"address": saplingAddr, "amount": Decimal('10')}], 1, 0, 'AllowRevealedSenders')
opid = self.nodes[0].z_sendmany(coinbase_addr, [{"address": saplingAddr, "amount": Decimal('10') - fee}], 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.nodes[0].generate(1)
self.sync_all()
@ -49,28 +50,28 @@ class MergeToAddressMixedNotes(BitcoinTestFramework):
assert_equal(Decimal(self.nodes[1].z_gettotalbalance()["transparent"]), Decimal('200'))
# Merge Sprout -> taddr
result = self.nodes[0].z_mergetoaddress(["ANY_SPROUT"], t_addr, 0)
result = self.nodes[0].z_mergetoaddress(["ANY_SPROUT"], t_addr)
wait_and_assert_operationid_status(self.nodes[0], result['opid'])
self.nodes[0].generate(1)
self.sync_all()
assert_equal(self.nodes[0].z_getbalance(sproutAddr), Decimal('0'))
assert_equal(self.nodes[0].z_getbalance(saplingAddr), Decimal('10'))
assert_equal(Decimal(self.nodes[1].z_gettotalbalance()["transparent"]), Decimal('250'))
assert_equal(self.nodes[0].z_getbalance(saplingAddr), Decimal('10') - fee)
assert_equal(Decimal(self.nodes[1].z_gettotalbalance()["transparent"]), Decimal('250') - fee)
# Make sure we cannot use "ANY_SPROUT" and "ANY_SAPLING" even if we only have Sapling Notes
assert_mergetoaddress_exception(
"Cannot send from both Sprout and Sapling addresses using z_mergetoaddress",
lambda: self.nodes[0].z_mergetoaddress(["ANY_SPROUT", "ANY_SAPLING"], t_addr))
lambda: self.nodes[0].z_mergetoaddress(["ANY_SPROUT", "ANY_SAPLING"], t_addr, fee))
# Merge Sapling -> taddr
result = self.nodes[0].z_mergetoaddress(["ANY_SAPLING"], t_addr, 0)
result = self.nodes[0].z_mergetoaddress(["ANY_SAPLING"], t_addr, fee)
wait_and_assert_operationid_status(self.nodes[0], result['opid'])
self.nodes[0].generate(1)
self.sync_all()
assert_equal(self.nodes[0].z_getbalance(sproutAddr), Decimal('0'))
assert_equal(self.nodes[0].z_getbalance(saplingAddr), Decimal('0'))
assert_equal(Decimal(self.nodes[1].z_gettotalbalance()["transparent"]), Decimal('260'))
assert_equal(Decimal(self.nodes[1].z_gettotalbalance()["transparent"]), Decimal('260') - 3*fee)
if __name__ == '__main__':

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Copyright (c) 2016-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -11,8 +11,8 @@
import string
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_raises, \
start_node, connect_nodes
from test_framework.util import assert_equal, assert_raises_message, start_node, connect_nodes
from test_framework.zip317 import conventional_fee
class MerkleBlockTest(BitcoinTestFramework):
@ -24,7 +24,6 @@ class MerkleBlockTest(BitcoinTestFramework):
def setup_network(self):
base_args = [
'-minrelaytxfee=0',
'-debug',
'-allowdeprecated=getnewaddress',
]
@ -53,11 +52,11 @@ class MerkleBlockTest(BitcoinTestFramework):
assert_equal(self.nodes[2].getbalance(), 0)
node0utxos = self.nodes[0].listunspent(1)
tx1 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 10})
tx1 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 10 - conventional_fee(1)})
txid1 = self.nodes[0].sendrawtransaction(self.nodes[0].signrawtransaction(tx1)["hex"])
tx2 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 10})
tx2 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 10 - conventional_fee(1)})
txid2 = self.nodes[0].sendrawtransaction(self.nodes[0].signrawtransaction(tx2)["hex"])
assert_raises(JSONRPCException, self.nodes[0].gettxoutproof, [txid1])
assert_raises_message(JSONRPCException, "Transaction not yet in block", self.nodes[0].gettxoutproof, [txid1])
self.nodes[0].generate(1)
blockhash = self.nodes[0].getblockhash(chain_height + 1)
@ -73,7 +72,7 @@ class MerkleBlockTest(BitcoinTestFramework):
assert_equal(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid1, txid2], blockhash)), txlist)
txin_spent = self.nodes[1].listunspent(1).pop()
tx3 = self.nodes[1].createrawtransaction([txin_spent], {self.nodes[0].getnewaddress(): 10})
tx3 = self.nodes[1].createrawtransaction([txin_spent], {self.nodes[0].getnewaddress(): 10 - 2*conventional_fee(1)})
self.nodes[0].sendrawtransaction(self.nodes[1].signrawtransaction(tx3)["hex"])
self.nodes[0].generate(1)
self.sync_all()
@ -82,7 +81,7 @@ class MerkleBlockTest(BitcoinTestFramework):
txid_unspent = txid1 if txin_spent["txid"] != txid1 else txid2
# We can't find the block from a fully-spent tx
assert_raises(JSONRPCException, self.nodes[2].gettxoutproof, [txid_spent])
assert_raises_message(JSONRPCException, "Transaction not yet in block", self.nodes[2].gettxoutproof, [txid_spent])
# ...but we can if we specify the block
assert_equal(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid_spent], blockhash)), [txid_spent])
# ...or if the first tx is not fully-spent
@ -104,15 +103,15 @@ class MerkleBlockTest(BitcoinTestFramework):
# Test getblock heights including negatives relative to the head
assert_equal(self.nodes[0].getblock("0")["height"], 0)
assert_raises(JSONRPCException, self.nodes[0].getblock, ["108"])
assert_raises_message(JSONRPCException, "Block height out of range", self.nodes[0].getblock, "108")
assert_equal(self.nodes[0].getblock("107")["height"], 107)
assert_equal(self.nodes[0].getblock("-1")["height"], 107)
assert_equal(self.nodes[0].getblock("-2")["height"], 106)
assert_equal(self.nodes[0].getblock("-20")["height"], 88)
assert_equal(self.nodes[0].getblock("-107")["height"], 1)
assert_equal(self.nodes[0].getblock("-108")["height"], 0)
assert_raises(JSONRPCException, self.nodes[0].getblock, ["-109"])
assert_raises(JSONRPCException, self.nodes[0].getblock, ["-0"])
assert_raises_message(JSONRPCException, "Block height out of range", self.nodes[0].getblock, "-109")
assert_raises_message(JSONRPCException, "Invalid block height parameter", self.nodes[0].getblock, "-0")
# Test getblockhash negative heights
assert_equal(self.nodes[0].getblockhash(-1), self.nodes[0].getblockhash(107))

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -20,6 +20,7 @@ from test_framework.util import (
wait_and_assert_operationid_status,
check_node_log,
)
from test_framework.zip317 import conventional_fee
class ShieldCoinbaseTest (BitcoinTestFramework):
@ -30,7 +31,6 @@ class ShieldCoinbaseTest (BitcoinTestFramework):
def start_node_with(self, index, extra_args=[]):
args = [
'-minrelaytxfee=0',
nuparams(BLOSSOM_BRANCH_ID, 1),
nuparams(HEARTWOOD_BRANCH_ID, 10),
nuparams(CANOPY_BRANCH_ID, 20),
@ -96,16 +96,16 @@ class ShieldCoinbaseTest (BitcoinTestFramework):
self.sync_all()
# Transparent coinbase outputs are subject to coinbase maturity
assert_equal(self.nodes[0].getbalance(), Decimal('0'))
assert_equal(self.nodes[0].z_gettotalbalance()['transparent'], '0.00')
assert_equal(self.nodes[0].z_gettotalbalance()['private'], '0.00')
assert_equal(self.nodes[0].z_gettotalbalance()['total'], '0.00')
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('0'))
assert_equal(Decimal(self.nodes[0].z_gettotalbalance()['transparent']), Decimal('0'))
assert_equal(Decimal(self.nodes[0].z_gettotalbalance()['private']), Decimal('0'))
assert_equal(Decimal(self.nodes[0].z_gettotalbalance()['total']), Decimal('0'))
# Shielded coinbase outputs are not subject to coinbase maturity
assert_equal(self.nodes[1].z_getbalance(node1_zaddr, 0), 5)
assert_equal(self.nodes[1].z_getbalance(node1_zaddr), 5)
assert_equal(self.nodes[1].z_gettotalbalance()['private'], '5.00')
assert_equal(self.nodes[1].z_gettotalbalance()['total'], '5.00')
assert_equal(Decimal(self.nodes[1].z_getbalance(node1_zaddr, 0)), Decimal('5'))
assert_equal(Decimal(self.nodes[1].z_getbalance(node1_zaddr)), Decimal('5'))
assert_equal(Decimal(self.nodes[1].z_gettotalbalance()['private']), Decimal('5'))
assert_equal(Decimal(self.nodes[1].z_gettotalbalance()['total']), Decimal('5'))
# Send from Sapling coinbase to Sapling address and transparent address
# (to check that a non-empty vout is allowed when spending shielded
@ -113,18 +113,20 @@ class ShieldCoinbaseTest (BitcoinTestFramework):
print("Sending Sapling coinbase to Sapling address")
node0_zaddr = self.nodes[0].z_getnewaddress('sapling')
node0_taddr = self.nodes[0].getnewaddress()
recipients = []
recipients.append({"address": node0_zaddr, "amount": Decimal('2')})
recipients.append({"address": node0_taddr, "amount": Decimal('2')})
myopid = self.nodes[1].z_sendmany(node1_zaddr, recipients, 1, 0, 'AllowRevealedRecipients')
fee = conventional_fee(3)
recipients = [
{"address": node0_zaddr, "amount": Decimal('2')},
{"address": node0_taddr, "amount": Decimal('2')},
]
myopid = self.nodes[1].z_sendmany(node1_zaddr, recipients, 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[1], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(self.nodes[0].z_getbalance(node0_zaddr), 2)
assert_equal(self.nodes[0].z_getbalance(node0_taddr), 2)
assert_equal(self.nodes[1].z_getbalance(node1_zaddr), 1)
assert_equal(Decimal(self.nodes[0].z_getbalance(node0_zaddr)), Decimal('2'))
assert_equal(Decimal(self.nodes[0].z_getbalance(node0_taddr)), Decimal('2'))
assert_equal(Decimal(self.nodes[1].z_getbalance(node1_zaddr)), Decimal('1') - fee)
# Generate a Unified Address for node 1
self.nodes[1].z_getnewaccount()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -19,11 +19,10 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import ZIP_317_FEE
from finalsaplingroot import ORCHARD_TREE_EMPTY_ROOT
from decimal import Decimal
class OrchardReorgTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
@ -32,7 +31,6 @@ class OrchardReorgTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(BLOSSOM_BRANCH_ID, 1),
nuparams(HEARTWOOD_BRANCH_ID, 5),
nuparams(CANOPY_BRANCH_ID, 5),
@ -67,9 +65,8 @@ class OrchardReorgTest(BitcoinTestFramework):
)
# Create an Orchard note.
recipients = [{'address': ua, 'amount': Decimal('12.5')}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
res = self.nodes[0].z_shieldcoinbase(get_coinbase_address(self.nodes[0]), ua, ZIP_317_FEE, None, None, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], res['opid'])
# After mining a block, finalorchardroot should have changed.
self.sync_all()
@ -92,9 +89,8 @@ class OrchardReorgTest(BitcoinTestFramework):
self.split_network()
# Create another Orchard note on node 0.
recipients = [{'address': ua, 'amount': Decimal('12.5')}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
res = self.nodes[0].z_shieldcoinbase(get_coinbase_address(self.nodes[0]), ua, ZIP_317_FEE, None, None, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], res['opid'])
# Mine two blocks on node 0.
print("Mining 2 blocks on node 0")

View File

@ -1,14 +1,18 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from decimal import Decimal
from test_framework.authproxy import JSONRPCException
from test_framework.mininode import NodeConn, NetworkThread, CInv, \
msg_mempool, msg_getdata, msg_tx, mininode_lock, SAPLING_PROTO_VERSION
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, connect_nodes_bi, fail, \
p2p_port, start_nodes, sync_blocks, sync_mempools
from test_framework.zip317 import conventional_fee
from tx_expiry_helper import TestNode, create_transaction
@ -21,7 +25,6 @@ class TxExpiringSoonTest(BitcoinTestFramework):
def setup_network(self):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-allowdeprecated=getnewaddress',
]] * self.num_nodes)
connect_nodes_bi(self.nodes, 0, 1)
@ -31,7 +34,7 @@ class TxExpiringSoonTest(BitcoinTestFramework):
tx = create_transaction(self.nodes[0],
block,
address,
10.0,
Decimal("10.0") - conventional_fee(2),
expiry_height)
testnode.send_message(msg_tx(tx))

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The Zcash developers
# Copyright (c) 2017-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -28,10 +28,10 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
'-debug=zrpcunsafe',
]
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[
args + ['-txunpaidactionlimit=51', '-blockunpaidactionlimit=50'],
args + ['-txunpaidactionlimit=51', '-blockunpaidactionlimit=32'],
args + ['-txunpaidactionlimit=51'],
args + ['-txunpaidactionlimit=51', '-blockunpaidactionlimit=25'],
args + ['-txunpaidactionlimit=51'],
args + ['-txunpaidactionlimit=25'],
args + ['-txunpaidactionlimit=32'],
])
def run_test(self):
@ -39,12 +39,17 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
# but the halving interval is only 144 blocks.
# For the first test the miner subsidy is 10 ZEC.
self.test(self.nodes[0], Decimal("10"), DEFAULT_BLOCK_UNPAID_ACTION_LIMIT)
self.test(self.nodes[0], Decimal("10"), 50)
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.)
self.test(self.nodes[1], Decimal("6.25"), 25)
self.test(self.nodes[1], Decimal("6.25"), 32)
assert_equal(288, self.nodes[0].getblockcount())
# For the third test the miner subsidy is 3.125 ZEC.
self.test(self.nodes[2], Decimal("3.125"), DEFAULT_BLOCK_UNPAID_ACTION_LIMIT)
assert_equal(392, self.nodes[0].getblockcount())
def test(self, mining_node, miner_subsidy, block_unpaid_action_limit):
print("Testing with -blockunpaidactionlimit=%d" % (block_unpaid_action_limit,))
@ -62,43 +67,61 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
return False
# Make sure we have enough mature funds on mining_node.
blocks = 100 + block_unpaid_action_limit + 2
n = max(1, block_unpaid_action_limit)
blocks = 100 + n + 2
print("Mining %d blocks..." % (blocks,))
mining_node.generate(blocks)
self.sync_all()
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)
amount = miner_subsidy * 51
assert_equal(amount + miner_subsidy, mining_node.getbalance())
assert_raises_message(JSONRPCException, "tx unpaid action limit exceeded",
assert_raises_message(JSONRPCException,
"tx unpaid action limit exceeded: 52 action(s) exceeds limit of 51",
mining_node.sendtoaddress,
self.nodes[2].getnewaddress(), amount)
self.nodes[3].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.
# We spend `n` mining rewards, ensuring that tx has exactly `n + 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
# 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
amount = miner_subsidy * n
assert_equal(amount + miner_subsidy*2, mining_node.getbalance())
tx = mining_node.sendtoaddress(self.nodes[2].getnewaddress(), amount)
tx = mining_node.sendtoaddress(self.nodes[3].getnewaddress(), amount)
mempool = mining_node.getrawmempool(True)
assert tx in mempool, mempool
fee_zats = int(mempool[tx]['fee'] * COIN)
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'])
t_in_actions = len(tx_verbose['vin'])
t_out_actions = len(tx_verbose['vout'])
assert_equal(n + 1, t_in_actions)
assert_equal(2, t_out_actions)
assert_equal([], tx_verbose['vjoinsplit'])
assert_equal([], tx_verbose['vShieldedSpend'])
assert_equal([], tx_verbose['vShieldedOutput'])
if tx_verbose['version'] >= 5:
assert_equal([], tx_verbose['orchard']['actions'])
else:
assert('orchard' not in tx_verbose)
unpaid_actions = max(t_in_actions, t_out_actions)
assert_equal(unpaid_actions, n + 1)
# TODO after #6676: assert_equal(unpaid_actions, tx_verbose['unpaidActions'])
# Calculate the effective fee we would need to satisfy the limit.
required_fee = (unpaid_actions - block_unpaid_action_limit) * MARGINAL_FEE
# Check that tx is not in a new block template prior to prioritisation.
block_template = mining_node.getblocktemplate()
@ -118,31 +141,34 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
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
# For the first two tests, tx should not be accepted to node3's
# mempool because that node has `-txunpaidactionlimit=32`, which is
# less than `unpaid_actions` in those tests. For the third test, it
# should be accepted, but might already have been mined.
mempool = self.nodes[3].getrawmempool(True)
if 32 < unpaid_actions:
assert tx not in mempool, mempool
# Prioritising it on node 2 has no effect on mining_node.
# Prioritising it on a node other than mining_node has no effect.
other_node = self.nodes[0 if mining_node == self.nodes[2] else 2]
sync_and_check()
priority_success = self.nodes[2].prioritisetransaction(tx, 0, MARGINAL_FEE)
priority_success = other_node.prioritisetransaction(tx, 0, required_fee)
assert(priority_success)
mempool = self.nodes[2].getrawmempool(True)
assert_equal(fee_zats + MARGINAL_FEE, mempool[tx]['modifiedfee'] * COIN)
mempool = other_node.getrawmempool(True)
assert_equal(fee_zats + required_fee, mempool[tx]['modifiedfee'] * COIN)
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)
other_node.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)
priority_success = mining_node.prioritisetransaction(tx, 0, required_fee - fee_zats - 1)
assert(priority_success)
mempool = mining_node.getrawmempool(True)
assert_equal(MARGINAL_FEE - 1, mempool[tx]['modifiedfee'] * COIN)
assert_equal(required_fee - 1, mempool[tx]['modifiedfee'] * COIN)
send_fully_paid_transaction()
assert_equal(eventually_in_template(tx), False)
@ -152,7 +178,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
priority_success = mining_node.prioritisetransaction(tx, None, 1)
assert(priority_success)
mempool = mining_node.getrawmempool(True)
assert_equal(MARGINAL_FEE, mempool[tx]['modifiedfee'] * COIN)
assert_equal(required_fee, mempool[tx]['modifiedfee'] * COIN)
# The block template will refresh after 1 minute, or after 5 seconds if a new
# transaction is added to the mempool. As long as there is less than a minute
@ -164,18 +190,17 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
send_fully_paid_transaction()
assert_equal(eventually_in_template(tx), True)
# Mine a block on node 0.
# Mine a block.
blk_hash = mining_node.generate(1)
block = mining_node.getblock(blk_hash[0])
assert_equal(tx in block['tx'], True)
sync_and_check()
# Check that tx was mined and that node 1 received the funds.
# Check that tx was mined and that node 3 received the expected funds (including
# the amounts from the three calls to `send_fully_paid_transaction`).
mempool = mining_node.getrawmempool()
assert_equal(mempool, [])
assert_equal(self.nodes[2].getbalance(), node2_initial_balance + amount)
# Check that all of the fully paid transactions were mined.
assert_equal(self.nodes[3].getbalance(), node3_initial_balance + Decimal("0.3"))
assert_equal(self.nodes[3].getbalance(), node3_initial_balance + amount + Decimal("0.3"))
if __name__ == '__main__':
PrioritiseTransactionTest().main()

View File

@ -1,14 +1,14 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 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 (
LEGACY_DEFAULT_FEE,
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import ZIP_317_FEE
class RegtestSignrawtransactionTest (BitcoinTestFramework):
@ -33,7 +33,7 @@ class RegtestSignrawtransactionTest (BitcoinTestFramework):
opid = self.nodes[1].z_sendmany(
taddr,
[{'address': zaddr1, 'amount': 1}],
1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
1, ZIP_317_FEE, 'AllowFullyTransparent')
wait_and_assert_operationid_status(self.nodes[1], opid)
if __name__ == '__main__':

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2020 The Zcash developers
# Copyright (c) 2020-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -17,11 +17,11 @@ from test_framework.util import (
CANOPY_BRANCH_ID,
NU5_BRANCH_ID,
)
from test_framework.zip317 import ZIP_317_FEE
import logging
HAS_CANOPY = [
'-minrelaytxfee=0',
'-nurejectoldversions=false',
'-anchorconfirmations=1',
nuparams(BLOSSOM_BRANCH_ID, 205),
@ -69,7 +69,7 @@ class RemoveSproutShieldingTest (BitcoinTestFramework):
n0_taddr0 = self.nodes[0].getnewaddress()
for _ in range(3):
recipients = [{"address": n0_taddr0, "amount": Decimal('1')}]
myopid = self.nodes[0].z_sendmany(n0_sprout_addr0, recipients, 1, 0, 'AllowRevealedRecipients')
myopid = self.nodes[0].z_sendmany(n0_sprout_addr0, recipients, 1, ZIP_317_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[0].generate(1)
@ -82,14 +82,14 @@ class RemoveSproutShieldingTest (BitcoinTestFramework):
JSONRPCException,
"Sending funds into the Sprout pool is no longer supported.",
self.nodes[0].z_mergetoaddress,
["ANY_TADDR"], n1_sprout_addr0, 0)
["ANY_TADDR"], n1_sprout_addr0, ZIP_317_FEE)
self.nodes[0].generate(1)
self.sync_all()
# Send some funds back to n0_taddr0
recipients = [{"address": n0_taddr0, "amount": Decimal('1')}]
myopid = self.nodes[0].z_sendmany(n0_sprout_addr0, recipients, 1, 0, 'AllowRevealedRecipients')
myopid = self.nodes[0].z_sendmany(n0_sprout_addr0, recipients, 1, ZIP_317_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Mine to one block before Canopy activation on node 0; adding value
@ -114,7 +114,7 @@ class RemoveSproutShieldingTest (BitcoinTestFramework):
# Create taddr -> Sprout z_sendmany transaction on node 0. Should fail
n1_sprout_addr1 = self.nodes[1].z_getnewaddress('sprout')
recipients = [{"address": n1_sprout_addr1, "amount": Decimal('1')}]
myopid = self.nodes[0].z_sendmany(n0_taddr0, recipients, 1, 0)
myopid = self.nodes[0].z_sendmany(n0_taddr0, recipients, 1, ZIP_317_FEE)
wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", unsupported_sprout_msg)
print("taddr -> Sprout z_sendmany tx rejected at Canopy activation on node 0")
@ -139,7 +139,7 @@ class RemoveSproutShieldingTest (BitcoinTestFramework):
# Shield coinbase to Sapling on node 0. Should pass
sapling_addr = self.nodes[0].z_getnewaddress('sapling')
myopid = self.nodes[0].z_shieldcoinbase(get_coinbase_address(self.nodes[0]), sapling_addr, 0)['opid']
myopid = self.nodes[0].z_shieldcoinbase(get_coinbase_address(self.nodes[0]), sapling_addr, ZIP_317_FEE)['opid']
wait_and_assert_operationid_status(self.nodes[0], myopid)
print("taddr -> Sapling z_shieldcoinbase tx accepted after Canopy on node 0")

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -13,6 +13,7 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee
class ShorterBlockTimes(BitcoinTestFramework):
@ -23,7 +24,6 @@ class ShorterBlockTimes(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(BLOSSOM_BRANCH_ID, 106),
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_gettotalbalance',
@ -39,14 +39,15 @@ class ShorterBlockTimes(BitcoinTestFramework):
node0_taddr = get_coinbase_address(self.nodes[0])
node0_zaddr = self.nodes[0].z_getnewaddress('sapling')
recipients = [{'address': node0_zaddr, 'amount': Decimal('10.0')}]
myopid = self.nodes[0].z_sendmany(node0_taddr, recipients, 1, 0, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{'address': node0_zaddr, 'amount': Decimal('10.0') - fee}]
myopid = self.nodes[0].z_sendmany(node0_taddr, recipients, 1, fee, 'AllowRevealedSenders')
txid = wait_and_assert_operationid_status(self.nodes[0], myopid)
assert_equal(105, self.nodes[0].getrawtransaction(txid, 1)['expiryheight']) # Blossom activation - 1
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(10, Decimal(self.nodes[0].z_gettotalbalance()['private']))
assert_equal(10 - fee, Decimal(self.nodes[0].z_gettotalbalance()['private']))
self.nodes[0].generate(2)
self.sync_all()
@ -65,13 +66,13 @@ class ShorterBlockTimes(BitcoinTestFramework):
assert_equal(15, self.nodes[1].getwalletinfo()['immature_balance'])
# Send and mine a transaction after activation
myopid = self.nodes[0].z_sendmany(node0_taddr, recipients, 1, 0, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(node0_taddr, recipients, 1, fee, 'AllowFullyTransparent')
txid = wait_and_assert_operationid_status(self.nodes[0], myopid)
assert_equal(147, self.nodes[0].getrawtransaction(txid, 1)['expiryheight']) # height + 1 + 40
self.sync_all() # Ensure the transaction has propagated to node 1
self.nodes[1].generate(1)
self.sync_all()
assert_equal(20, Decimal(self.nodes[0].z_gettotalbalance()['private']))
assert_equal(20 - fee*2, Decimal(self.nodes[0].z_gettotalbalance()['private']))
if __name__ == '__main__':

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Copyright (c) 2017-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -40,10 +40,12 @@ Options:
-allowdeprecated=<feature>
Explicitly allow the use of the specified deprecated feature. Multiple
instances of this parameter are permitted; values for <feature> must be
selected from among {"none", "deprecationinfo_deprecationheight",
"gbt_oldhashes", "z_getbalance", "z_gettotalbalance", "addrtype",
"getnewaddress", "getrawchangeaddress", "legacy_privacy",
"wallettxvjoinsplit", "z_getnewaddress", "z_listaddresses"}
selected from among {"none", "createrawtransaction",
"fundrawtransaction", "getnetworkhashps", "keypoolrefill", "settxfee",
"signrawtransaction", "z_gettotalbalance", "addrtype",
"deprecationinfo_deprecationheight", "gbt_oldhashes", "getnewaddress",
"getrawchangeaddress", "legacy_privacy", "wallettxvjoinsplit",
"z_getbalance", "z_getnewaddress", "z_listaddresses"}
-blocknotify=<cmd>
Execute command when the best block changes (%s in cmd is replaced by
@ -430,8 +432,8 @@ Debugging/Testing options:
all debugging information. <category> can be: addrman, alert, bench,
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.
selectcoins, tor, valuepool, zmq, zrpc, zrpcunsafe (implies zrpc). For
multiple specific categories use -debug=<category> multiple times.
-experimentalfeatures
Enable use of experimental features
@ -502,7 +504,7 @@ Node relay options:
-txunpaidactionlimit=<n>
Transactions with more than this number of unpaid actions will not be
accepted to the mempool or relayed (default: 50)
accepted to the mempool or relayed (default: 0)
Block creation options:
@ -511,7 +513,7 @@ Block creation options:
-blockunpaidactionlimit=<n>
Set the limit on unpaid actions that will be accepted in a block for
transactions paying less than the ZIP 317 fee (default: 50)
transactions paying less than the ZIP 317 fee (default: 0)
| -blockversion=<n>
| Override block version to test forking scenarios (default: 4)

View File

@ -1,15 +1,18 @@
#!/usr/bin/env python3
# Copyright (c) 2018-2024 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 (
BLOSSOM_BRANCH_ID,
LEGACY_DEFAULT_FEE,
assert_equal,
assert_true,
initialize_chain_clean,
nuparams,
start_node,
)
from test_framework.zip317 import conventional_fee
from test_framework.authproxy import JSONRPCException
from decimal import Decimal
@ -49,7 +52,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') - LEGACY_DEFAULT_FEE})
create_hex = self.nodes[0].createrawtransaction(create_inputs, {taddr: Decimal('10.0') - conventional_fee(2)})
# 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,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -7,7 +7,8 @@ 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, LEGACY_DEFAULT_FEE
wait_and_assert_operationid_status_result
from test_framework.zip317 import conventional_fee
SAPLING_ADDR = 'zregtestsapling1ssqj3f3majnl270985gqcdqedd9t4nlttjqskccwevj2v20sc25deqspv3masufnwcdy67cydyy'
SAPLING_KEY = 'secret-extended-key-regtest1qv62zt2fqyqqpqrh2qzc08h7gncf4447jh9kvnnnhjg959fkwt7mhw9j8e9at7attx8z6u3953u86vcnsujdc2ckdlcmztjt44x3uxpah5mxtncxd0mqcnz9eq8rghh5m4j44ep5d9702sdvvwawqassulktfegrcp4twxgqdxx4eww3lau0mywuaeztpla2cmvagr5nj98elt45zh6fjznadl6wz52n2uyhdwcm2wlsu8fnxstrk6s4t55t8dy6jkgx5g0cwpchh5qffp8x5'
@ -127,7 +128,8 @@ class SproutSaplingMigration(BitcoinTestFramework):
# Check that unmigrated amount + unfinalized = starting balance - fee
status = node.z_getmigrationstatus()
print("status: {}".format(status))
assert_equal(sprout_initial_balance - LEGACY_DEFAULT_FEE, Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount']))
fee = conventional_fee(4)
assert_equal(sprout_initial_balance - 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 +148,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 - LEGACY_DEFAULT_FEE)
assert_true(sprout_balance + sapling_balance, sprout_initial_balance - fee)
check_migration_status(node, saplingAddr, DURING_MIGRATION)
# At 10 % 500 the transactions will be considered 'finalized'

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3
# blocktools.py - utilities for manipulating blocks and transactions
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Copyright (c) 2017-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -101,10 +101,10 @@ def create_coinbase(height, pubkey=None, after_blossom=False, outputs=[], lockbo
# Create a transaction with an anyone-can-spend output, that spends the
# nth output of prevtx.
def create_transaction(prevtx, n, sig, value):
def create_transaction(prevtx, n, sig, value_zats):
tx = CTransaction()
assert(n < len(prevtx.vout))
tx.vin.append(CTxIn(COutPoint(prevtx.sha256, n), sig, 0xffffffff))
tx.vout.append(CTxOut(value, b""))
tx.vout.append(CTxOut(value_zats, b""))
tx.calc_sha256()
return tx

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Copyright (c) 2016-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -31,8 +31,6 @@ from .authproxy import AuthServiceProxy, JSONRPCException
ZCASHD_BINARY = os.path.join('src', 'zcashd')
LEGACY_DEFAULT_FEE = Decimal('0.00001')
COVERAGE_DIR = None
PRE_BLOSSOM_BLOCK_TARGET_SPACING = 150
POST_BLOSSOM_BLOCK_TARGET_SPACING = 75
@ -262,6 +260,7 @@ def initialize_chain(test_dir, num_nodes, cachedir, cache_behavior='current'):
datadir = initialize_datadir(cachedir, i)
args = [ zcashd_binary(), "-keypool=1", "-datadir="+datadir, "-discover=0" ]
args.extend([
'-i-am-aware-zcashd-will-be-replaced-by-zebrad-and-zallet-in-2025',
'-nuparams=5ba81b19:1', # Overwinter
'-nuparams=76b809bb:1', # Sapling
'-mocktime=%d' % block_time
@ -484,6 +483,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
binary = zcashd_binary()
args = [ binary, "-datadir="+datadir, "-keypool=1", "-discover=0", "-rest" ]
args.extend([
'-i-am-aware-zcashd-will-be-replaced-by-zebrad-and-zallet-in-2025',
'-nuparams=5ba81b19:1', # Overwinter
'-nuparams=76b809bb:1', # Sapling
])

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2023 The Zcash developers
# Copyright (c) 2023-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -19,6 +19,9 @@ MARGINAL_FEE = 5000
# https://zips.z.cash/zip-0317#fee-calculation.
GRACE_ACTIONS = 2
# The minimum ZIP 317 fee.
MINIMUM_FEE = MARGINAL_FEE * GRACE_ACTIONS
# Limits the relative probability of picking a given transaction to be at most `WEIGHT_RATIO_CAP`
# times greater than a transaction that pays exactly the conventional fee. See
# https://zips.z.cash/zip-0317#recommended-algorithm-for-block-template-construction
@ -26,7 +29,7 @@ WEIGHT_RATIO_CAP = 4
# Default limit on the number of unpaid actions in a block. See
# https://zips.z.cash/zip-0317#recommended-algorithm-for-block-template-construction
DEFAULT_BLOCK_UNPAID_ACTION_LIMIT = 50
DEFAULT_BLOCK_UNPAID_ACTION_LIMIT = 0
# The zcashd RPC sentinel value to indicate the conventional_fee when a positional argument is
# required.

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -38,10 +38,11 @@ from test_framework.util import (
bitcoind_processes,
check_node_log
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
BASE_ARGS = [
'-minrelaytxfee=0',
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
]
@ -91,14 +92,14 @@ class TurnstileTest (BitcoinTestFramework):
self.sync_all()
taddr0 = get_coinbase_address(self.nodes[0])
fee = conventional_fee(3)
if (POOL_NAME == "SPROUT"):
dest_addr = self.nodes[0].listaddresses()[0]['sprout']['addresses'][0]
elif (POOL_NAME == "SAPLING"):
# Node 0 shields some funds
dest_addr = self.nodes[0].z_getnewaddress('sapling')
recipients = []
recipients.append({"address": dest_addr, "amount": Decimal('50')})
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, 0)
recipients = [{"address": dest_addr, "amount": Decimal('50') - fee}]
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[0], myopid)
else:
fail("Unrecognized pool name: " + POOL_NAME)
@ -121,9 +122,8 @@ class TurnstileTest (BitcoinTestFramework):
self.assert_pool_balance(self.nodes[2], POOL_NAME.lower(), Decimal('200'))
# Node 0 creates an unshielding transaction
recipients = []
recipients.append({"address": taddr0, "amount": Decimal('1')})
myopid = self.nodes[0].z_sendmany(dest_addr, recipients, 1, 0, 'AllowRevealedRecipients')
recipients = [{"address": taddr0, "amount": Decimal('1')}]
myopid = self.nodes[0].z_sendmany(dest_addr, recipients, 1, ZIP_317_FEE, 'AllowRevealedRecipients')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
# Verify transaction appears in mempool of nodes
@ -170,8 +170,8 @@ class TurnstileTest (BitcoinTestFramework):
# Verify size of shielded pool
self.assert_pool_balance(self.nodes[0], POOL_NAME.lower(), Decimal('0'))
self.assert_pool_balance(self.nodes[1], POOL_NAME.lower(), Decimal('199'))
self.assert_pool_balance(self.nodes[2], POOL_NAME.lower(), Decimal('199'))
self.assert_pool_balance(self.nodes[1], POOL_NAME.lower(), Decimal('199') - fee)
self.assert_pool_balance(self.nodes[2], POOL_NAME.lower(), Decimal('199') - fee)
# Stop node 0 and check logs to verify the block was rejected as a turnstile violation
string_to_find1 = "ConnectBlock: turnstile violation in " + POOL_NAME.capitalize() + " shielded value pool"

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Copyright (c) 2016-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -16,6 +16,7 @@ from test_framework.util import (
sync_blocks,
gather_inputs,
)
from test_framework.zip317 import conventional_fee
class TxnMallTest(BitcoinTestFramework):
@ -26,7 +27,6 @@ class TxnMallTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-allowdeprecated=getnewaddress',
]] * self.num_nodes)
@ -48,10 +48,12 @@ class TxnMallTest(BitcoinTestFramework):
# First: use raw transaction API to send (starting_balance - (mining_reward - 2)) ZEC to node1_address,
# but don't broadcast:
(total_in, inputs) = gather_inputs(self.nodes[0], (starting_balance - (mining_reward - 2)))
fee = conventional_fee(25)
change_address = self.nodes[0].getnewaddress("")
outputs = {}
outputs[change_address] = (mining_reward - 2)
outputs[node1_address] = (starting_balance - (mining_reward - 2))
outputs = {
change_address: mining_reward - 2 - fee,
node1_address: starting_balance - (mining_reward - 2),
}
rawtx = self.nodes[0].createrawtransaction(inputs, outputs)
doublespend = self.nodes[0].signrawtransaction(rawtx)
assert_equal(doublespend["complete"], True)
@ -82,7 +84,7 @@ class TxnMallTest(BitcoinTestFramework):
assert_equal(tx1["confirmations"], 1)
assert_equal(tx2["confirmations"], 1)
# Node1's total balance should be its starting balance plus both transaction amounts:
assert_equal(self.nodes[1].getbalance("*"), starting_balance - (tx1["amount"]+tx2["amount"]))
assert_equal(self.nodes[1].getbalance("*"), starting_balance - (tx1["amount"] + tx2["amount"]))
else:
assert_equal(tx1["confirmations"], 0)
assert_equal(tx2["confirmations"], 0)
@ -105,9 +107,9 @@ class TxnMallTest(BitcoinTestFramework):
assert_equal(tx1["confirmations"], -1)
assert_equal(tx2["confirmations"], -1)
# Node0's total balance should be starting balance, plus (mining_reward * 2) for
# two more matured blocks, minus (starting_balance - (mining_reward - 2)) for the double-spend:
expected = starting_balance + (mining_reward * 2) - (starting_balance - (mining_reward - 2))
# Node0's total balance should be starting balance, plus (mining_reward * 2) for two more
# matured blocks, minus (starting_balance - (mining_reward - 2) + fee) for the double-spend.
expected = starting_balance + (mining_reward * 2) - (starting_balance - (mining_reward - 2) + fee)
assert_equal(self.nodes[0].getbalance(), expected)
assert_equal(self.nodes[0].getbalance("*"), expected)

View File

@ -1,11 +1,12 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Copyright (c) 2016-2024 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.authproxy import JSONRPCException
from test_framework.mininode import COIN
from test_framework.util import assert_equal, start_nodes, start_node, \
connect_nodes_bi, sync_blocks, sync_mempools
from test_framework.zip317 import conventional_fee
@ -21,7 +22,6 @@ class WalletTest (BitcoinTestFramework):
def setup_network(self, split=False):
self.nodes = start_nodes(3, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getbalance',
]] * 3)
@ -31,15 +31,15 @@ class WalletTest (BitcoinTestFramework):
self.is_network_split=False
self.sync_all()
def run_test (self):
def run_test(self):
print("Mining blocks...")
self.nodes[0].generate(4)
self.sync_all()
walletinfo = self.nodes[0].getwalletinfo()
assert_equal(walletinfo['immature_balance'], 40)
assert_equal(walletinfo['balance'], 0)
assert_equal(Decimal(walletinfo['immature_balance']), Decimal('40'))
assert_equal(Decimal(walletinfo['balance']), Decimal('0'))
blockchaininfo = self.nodes[0].getblockchaininfo()
assert_equal(blockchaininfo['estimatedheight'], 4)
@ -48,20 +48,20 @@ class WalletTest (BitcoinTestFramework):
self.nodes[1].generate(101)
self.sync_all()
assert_equal(self.nodes[0].getbalance(), 40)
assert_equal(self.nodes[1].getbalance(), 10)
assert_equal(self.nodes[2].getbalance(), 0)
assert_equal(self.nodes[0].getbalance("*"), 40)
assert_equal(self.nodes[1].getbalance("*"), 10)
assert_equal(self.nodes[2].getbalance("*"), 0)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('40'))
assert_equal(Decimal(self.nodes[1].getbalance()), Decimal('10'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('0'))
assert_equal(Decimal(self.nodes[0].getbalance("*")), Decimal('40'))
assert_equal(Decimal(self.nodes[1].getbalance("*")), Decimal('10'))
assert_equal(Decimal(self.nodes[2].getbalance("*")), Decimal('0'))
# Send 21 ZEC from 0 to 2 using sendtoaddress call.
# Second transaction will be child of first, and will require a fee
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), Decimal('11'))
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), Decimal('10'))
walletinfo = self.nodes[0].getwalletinfo()
assert_equal(walletinfo['immature_balance'], 0)
assert_equal(Decimal(walletinfo['immature_balance']), Decimal('0'))
blockchaininfo = self.nodes[0].getblockchaininfo()
assert_equal(blockchaininfo['estimatedheight'], 105)
@ -77,10 +77,10 @@ class WalletTest (BitcoinTestFramework):
# node0 should end up with 50 ZEC in block rewards plus fees, but
# minus the 21 ZEC plus fees sent to node2
assert_equal(self.nodes[0].getbalance(), 50-21)
assert_equal(self.nodes[2].getbalance(), 21)
assert_equal(self.nodes[0].getbalance("*"), 50-21)
assert_equal(self.nodes[2].getbalance("*"), 21)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('50') - Decimal('21'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('21'))
assert_equal(Decimal(self.nodes[0].getbalance("*")), Decimal('50') - Decimal('21'))
assert_equal(Decimal(self.nodes[2].getbalance("*")), Decimal('21'))
# Node0 should have three unspent outputs.
# Create a couple of transactions to send them to node2, submit them through
@ -102,16 +102,14 @@ class WalletTest (BitcoinTestFramework):
# Catch an attempt to send a transaction with an absurdly high fee.
# Send 1.0 ZEC from an utxo of value 10.0 ZEC but don't specify a change output, so then
# the change of 9.0 ZEC becomes the fee, which is considered to be absurdly high because
# the fee is more than 4 times the conventional fee.
assert(Decimal("9.0") > 4*conventional_fee(1))
# the change of 9.0 ZEC becomes the fee, which is considered to be absurdly high.
inputs = []
outputs = {}
for utxo in node2utxos:
if utxo["amount"] == Decimal("10.0"):
break
assert_equal(utxo["amount"], Decimal("10.0"))
inputs.append({ "txid" : utxo["txid"], "vout" : utxo["vout"]})
inputs.append({"txid": utxo["txid"], "vout": utxo["vout"]})
outputs[self.nodes[2].getnewaddress("")] = Decimal("1.0")
raw_tx = self.nodes[2].createrawtransaction(inputs, outputs)
signed_tx = self.nodes[2].signrawtransaction(raw_tx)
@ -123,11 +121,12 @@ class WalletTest (BitcoinTestFramework):
# create both transactions
txns_to_send = []
fee = conventional_fee(2)
for utxo in node0utxos:
inputs = []
outputs = {}
inputs.append({ "txid" : utxo["txid"], "vout" : utxo["vout"]})
outputs[self.nodes[2].getnewaddress("")] = utxo["amount"]
inputs.append({"txid": utxo["txid"], "vout": utxo["vout"]})
outputs[self.nodes[2].getnewaddress("")] = utxo["amount"] - fee
raw_tx = self.nodes[0].createrawtransaction(inputs, outputs)
txns_to_send.append(self.nodes[0].signrawtransaction(raw_tx))
@ -141,52 +140,52 @@ class WalletTest (BitcoinTestFramework):
self.nodes[1].generate(1)
self.sync_all()
assert_equal(self.nodes[0].getbalance(), 0)
assert_equal(self.nodes[2].getbalance(), 50)
assert_equal(self.nodes[0].getbalance("*"), 0)
assert_equal(self.nodes[2].getbalance("*"), 50)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('0'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('50') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance("*")), Decimal('0'))
assert_equal(Decimal(self.nodes[2].getbalance("*")), Decimal('50') - 3*fee)
# Send 10 ZEC normally
address = self.nodes[0].getnewaddress("")
self.nodes[2].settxfee(Decimal('0.001')) # not the default
self.nodes[2].sendtoaddress(address, 10, "", "", False)
self.nodes[2].sendtoaddress(address, Decimal('10'), "", "", False)
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
assert_equal(self.nodes[2].getbalance(), Decimal('39.99900000'))
assert_equal(self.nodes[0].getbalance(), Decimal('10.00000000'))
assert_equal(self.nodes[2].getbalance("*"), Decimal('39.99900000'))
assert_equal(self.nodes[0].getbalance("*"), Decimal('10.00000000'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('39.99900000') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('10.00000000'))
assert_equal(Decimal(self.nodes[2].getbalance("*")), Decimal('39.99900000') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance("*")), Decimal('10.00000000'))
# Send 10 ZEC with subtract fee from amount
self.nodes[2].sendtoaddress(address, 10, "", "", True)
self.nodes[2].sendtoaddress(address, Decimal('10'), "", "", True)
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
assert_equal(self.nodes[2].getbalance(), Decimal('29.99900000'))
assert_equal(self.nodes[0].getbalance(), Decimal('19.99900000'))
assert_equal(self.nodes[2].getbalance("*"), Decimal('29.99900000'))
assert_equal(self.nodes[0].getbalance("*"), Decimal('19.99900000'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('29.99900000') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('19.99900000'))
assert_equal(Decimal(self.nodes[2].getbalance("*")), Decimal('29.99900000') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance("*")), Decimal('19.99900000'))
# Sendmany 10 ZEC
self.nodes[2].sendmany("", {address: 10}, 0, "", [])
self.nodes[2].sendmany("", {address: Decimal('10')}, 0, "", [])
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
assert_equal(self.nodes[2].getbalance(), Decimal('19.99800000'))
assert_equal(self.nodes[0].getbalance(), Decimal('29.99900000'))
assert_equal(self.nodes[2].getbalance("*"), Decimal('19.99800000'))
assert_equal(self.nodes[0].getbalance("*"), Decimal('29.99900000'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('19.99800000') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('29.99900000'))
assert_equal(Decimal(self.nodes[2].getbalance("*")), Decimal('19.99800000') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance("*")), Decimal('29.99900000'))
# Sendmany 10 ZEC with subtract fee from amount
self.nodes[2].sendmany("", {address: 10}, 0, "", [address])
self.nodes[2].sendmany("", {address: Decimal('10')}, 0, "", [address])
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
assert_equal(self.nodes[2].getbalance(), Decimal('9.99800000'))
assert_equal(self.nodes[0].getbalance(), Decimal('39.99800000'))
assert_equal(self.nodes[2].getbalance("*"), Decimal('9.99800000'))
assert_equal(self.nodes[0].getbalance("*"), Decimal('39.99800000'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('9.99800000') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('39.99800000'))
assert_equal(Decimal(self.nodes[2].getbalance("*")), Decimal('9.99800000') - 3*fee)
assert_equal(Decimal(self.nodes[0].getbalance("*")), Decimal('39.99800000'))
# Test ResendWalletTransactions:
# Create a couple of transactions, then start up a fourth
@ -207,16 +206,16 @@ class WalletTest (BitcoinTestFramework):
assert(txid1 in self.nodes[3].getrawmempool())
# check integer balances from getbalance
assert_equal(self.nodes[2].getbalance("*", 1, False, True), 999800000)
assert_equal(Decimal(self.nodes[2].getbalance("*", 1, False, True)), 999800000 - 3*fee*COIN)
# send from node 0 to node 2 taddr
mytaddr = self.nodes[2].getnewaddress()
mytxid = self.nodes[0].sendtoaddress(mytaddr, 10.0)
mytxid = self.nodes[0].sendtoaddress(mytaddr, Decimal('10.0'))
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
mybalance = self.nodes[2].z_getbalance(mytaddr)
mybalance = Decimal(self.nodes[2].z_getbalance(mytaddr))
assert_equal(mybalance, Decimal('10.0'))
# check integer balances from z_getbalance

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2016 The Zcash developers
# Copyright (c) 2016-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -9,7 +9,8 @@ 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, LEGACY_DEFAULT_FEE
get_coinbase_address
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -67,9 +68,9 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
myzaddr = self.nodes[0].z_getnewaddress()
# Send 10 coins to our zaddr.
recipients = []
recipients.append({"address":myzaddr, "amount":Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{"address": myzaddr, "amount": Decimal('10.0') - fee}]
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.nodes[0].generate(1)
@ -82,7 +83,7 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
# Confirm the balance on node 0.
resp = self.nodes[0].z_getbalance(myzaddr)
assert_equal(Decimal(resp), Decimal('10.0') - LEGACY_DEFAULT_FEE)
assert_equal(Decimal(resp), Decimal('10.0') - fee)
# Export the key for the zaddr from node 0.
key = self.nodes[0].z_exportkey(myzaddr)
@ -109,7 +110,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') - LEGACY_DEFAULT_FEE)
assert_equal(Decimal(resp), Decimal('10.0') - fee)
if __name__ == '__main__':

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -16,6 +16,7 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -23,7 +24,6 @@ from decimal import Decimal
class WalletAccountsTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 210),
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
@ -141,9 +141,11 @@ class WalletAccountsTest(BitcoinTestFramework):
# Send coinbase funds to the UA.
print('Sending coinbase funds to account')
recipients = [{'address': ua0, 'amount': Decimal('10')}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
coinbase_fee = conventional_fee(3)
recipients = [{'address': ua0, 'amount': Decimal('10') - coinbase_fee}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
txid = wait_and_assert_operationid_status(self.nodes[0], opid)
ua0sapling_balance = Decimal('10') - coinbase_fee
# The wallet should detect the new note as belonging to the UA.
tx_details = self.nodes[0].z_viewtransaction(txid)
@ -155,21 +157,23 @@ class WalletAccountsTest(BitcoinTestFramework):
# visible with minconf=0.
self.sync_all()
self.check_balance(0, 0, ua0, {})
self.check_balance(0, 0, ua0, {'sapling': 10}, 0)
self.check_balance(0, 0, ua0, {'sapling': ua0sapling_balance}, 0)
self.nodes[2].generate(1)
self.sync_all()
# The default minconf should now detect the balance.
self.check_balance(0, 0, ua0, {'sapling': 10})
self.check_balance(0, 0, ua0, {'sapling': ua0sapling_balance})
# Send Sapling funds from the UA.
print('Sending account funds to Sapling address')
node1sapling = self.nodes[1].z_getnewaddress('sapling')
fee = conventional_fee(2)
recipients = [{'address': node1sapling, 'amount': Decimal('1')}]
opid = self.nodes[0].z_sendmany(ua0, recipients, 1, 0)
opid = self.nodes[0].z_sendmany(ua0, recipients, 1, fee)
txid = wait_and_assert_operationid_status(self.nodes[0], opid)
ua0sapling_balance -= Decimal('1') + fee
# The wallet should detect the spent note as belonging to the UA.
tx_details = self.nodes[0].z_viewtransaction(txid)
@ -183,7 +187,7 @@ class WalletAccountsTest(BitcoinTestFramework):
# up until the transaction expires), or 9 (if we include the unmined transaction).
self.sync_all()
self.check_balance(0, 0, ua0, {})
self.check_balance(0, 0, ua0, {'sapling': 9}, 0)
self.check_balance(0, 0, ua0, {'sapling': ua0sapling_balance}, 0)
# Activate NU5
print('Activating NU5')
@ -193,9 +197,11 @@ class WalletAccountsTest(BitcoinTestFramework):
# Send more coinbase funds to the UA.
print('Sending coinbase funds to account')
recipients = [{'address': ua0, 'amount': Decimal('10')}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{'address': ua0, 'amount': Decimal('10') - fee}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, fee, 'AllowRevealedSenders')
txid = wait_and_assert_operationid_status(self.nodes[0], opid)
ua0orchard_balance = Decimal('10') - fee
# The wallet should detect the new note as belonging to the UA.
tx_details = self.nodes[0].z_viewtransaction(txid)
@ -206,12 +212,12 @@ class WalletAccountsTest(BitcoinTestFramework):
# The new balance should not be visible with the default minconf, but should be
# visible with minconf=0.
self.sync_all()
self.check_balance(0, 0, ua0, {'sapling': 9})
self.check_balance(0, 0, ua0, {'sapling': 9, 'orchard': 10}, 0)
self.check_balance(0, 0, ua0, {'sapling': ua0sapling_balance})
self.check_balance(0, 0, ua0, {'sapling': ua0sapling_balance, 'orchard': ua0orchard_balance}, 0)
# The total balance with the default minconf should be just the Sapling balance
assert_equal('9.00', self.nodes[0].z_gettotalbalance()['private'])
assert_equal('19.00', self.nodes[0].z_gettotalbalance(0)['private'])
assert_equal(Decimal(self.nodes[0].z_gettotalbalance()['private']), ua0sapling_balance)
assert_equal(Decimal(self.nodes[0].z_gettotalbalance(0)['private']), ua0sapling_balance + ua0orchard_balance)
self.nodes[2].generate(1)
self.sync_all()
@ -223,9 +229,11 @@ class WalletAccountsTest(BitcoinTestFramework):
self.check_z_listaccounts(1, 0, 0, node1orchard)
node1orchard = node1orchard['address']
fee = conventional_fee(2)
recipients = [{'address': node1orchard, 'amount': Decimal('1')}]
opid = self.nodes[0].z_sendmany(ua0, recipients, 1, 0)
opid = self.nodes[0].z_sendmany(ua0, recipients, 1, fee)
txid = wait_and_assert_operationid_status(self.nodes[0], opid)
ua0orchard_balance -= Decimal('1') + fee
# The wallet should detect the spent note as belonging to the UA.
tx_details = self.nodes[0].z_viewtransaction(txid)
@ -248,8 +256,8 @@ class WalletAccountsTest(BitcoinTestFramework):
# that transaction has been created and broadcast, and _might_ get mined up until
# the transaction expires), or 9 (if we include the unmined transaction).
self.sync_all()
self.check_balance(0, 0, ua0, {'sapling': 9})
self.check_balance(0, 0, ua0, {'sapling': 9, 'orchard': 9}, 0)
self.check_balance(0, 0, ua0, {'sapling': ua0sapling_balance})
self.check_balance(0, 0, ua0, {'sapling': ua0sapling_balance, 'orchard': ua0orchard_balance}, 0)
if __name__ == '__main__':

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -7,7 +7,9 @@ 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, LEGACY_DEFAULT_FEE
sync_blocks, sync_mempools
from test_framework.zip317 import conventional_fee
from decimal import Decimal
class WalletAnchorForkTest (BitcoinTestFramework):
@ -51,9 +53,9 @@ class WalletAnchorForkTest (BitcoinTestFramework):
# Node 0 creates a joinsplit transaction
mytaddr0 = get_coinbase_address(self.nodes[0])
myzaddr0 = self.nodes[0].z_getnewaddress()
recipients = []
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{"address": myzaddr0, "amount": Decimal('10.0') - fee}]
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Sync up mempools and mine the transaction. All nodes have the same anchor.
@ -75,9 +77,9 @@ class WalletAnchorForkTest (BitcoinTestFramework):
self.nodes[1].generate(1)
# Partition A, node 0 creates a joinsplit transaction
recipients = []
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{"address": myzaddr0, "amount": Decimal('10.0') - fee}]
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, fee, 'AllowRevealedSenders')
txid = wait_and_assert_operationid_status(self.nodes[0], myopid)
rawhex = self.nodes[0].getrawtransaction(txid)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Zcash developers
# Copyright (c) 2019-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -13,6 +13,7 @@ from test_framework.util import (
start_node,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
@ -25,7 +26,6 @@ class WalletChangeAddressesTest(BitcoinTestFramework):
def setup_network(self):
args = [
'-minrelaytxfee=0',
nuparams(SAPLING_BRANCH_ID, 1),
'-txindex', # Avoid JSONRPC error: No information available about transaction
'-allowdeprecated=getnewaddress',
@ -43,30 +43,32 @@ class WalletChangeAddressesTest(BitcoinTestFramework):
# Obtain some transparent funds
midAddr = self.nodes[0].z_getnewaddress('sapling')
myopid = self.nodes[0].z_shieldcoinbase(get_coinbase_address(self.nodes[0]), midAddr, 0)['opid']
coinbase_fee = conventional_fee(12)
myopid = self.nodes[0].z_shieldcoinbase(get_coinbase_address(self.nodes[0]), midAddr, coinbase_fee)['opid']
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
taddrSource = self.nodes[0].getnewaddress()
for _ in range(6):
recipients = [{"address": taddrSource, "amount": Decimal('2')}]
myopid = self.nodes[0].z_sendmany(midAddr, recipients, 1, 0, 'AllowRevealedRecipients')
for _ in range(6):
myopid = self.nodes[0].z_sendmany(midAddr, recipients, 1, ZIP_317_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
def check_change_taddr_reuse(target, policy):
def check_change_taddr_reuse(target, fee, policy):
recipients = [{"address": target, "amount": Decimal('1')}]
# Send funds to recipient address twice
myopid = self.nodes[0].z_sendmany(taddrSource, recipients, 1, 0, policy)
myopid = self.nodes[0].z_sendmany(taddrSource, recipients, 1, fee, policy)
txid1 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.nodes[1].generate(1)
self.sync_all()
myopid = self.nodes[0].z_sendmany(taddrSource, recipients, 1, 0, policy)
myopid = self.nodes[0].z_sendmany(taddrSource, recipients, 1, fee, policy)
txid2 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.nodes[1].generate(1)
self.sync_all()
@ -88,10 +90,10 @@ class WalletChangeAddressesTest(BitcoinTestFramework):
print()
print('Checking z_sendmany(taddr->Sapling)')
check_change_taddr_reuse(saplingAddr, 'AllowFullyTransparent')
check_change_taddr_reuse(saplingAddr, conventional_fee(3), 'AllowFullyTransparent')
print()
print('Checking z_sendmany(taddr->taddr)')
check_change_taddr_reuse(taddr, 'AllowFullyTransparent')
check_change_taddr_reuse(taddr, conventional_fee(1), 'AllowFullyTransparent')
if __name__ == '__main__':
WalletChangeAddressesTest().main()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -11,6 +11,7 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -23,7 +24,6 @@ class WalletChangeIndicatorTest (BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
]] * self.num_nodes)
@ -34,16 +34,16 @@ class WalletChangeIndicatorTest (BitcoinTestFramework):
zaddr1 = self.nodes[1].z_getnewaddress()
zaddr2 = self.nodes[1].z_getnewaddress()
self.nodes[0].sendtoaddress(taddr, Decimal('1.0'))
fee = conventional_fee(3)
self.nodes[0].sendtoaddress(taddr, Decimal('1.0') + fee)
self.generate_and_sync()
# Send 1 ZEC to a zaddr
wait_and_assert_operationid_status(
self.nodes[1],
self.nodes[1].z_sendmany(
taddr,
[{'address': zaddr1, 'amount': 1.0, 'memo': 'c0ffee01'}],
1, 0, 'AllowRevealedSenders'))
opid = self.nodes[1].z_sendmany(taddr,
[{'address': zaddr1, 'amount': Decimal('1.0'), 'memo': 'c0ffee01'}],
1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[1], opid)
self.generate_and_sync()
# Check that we have received 1 note which is not change
@ -55,14 +55,17 @@ class WalletChangeIndicatorTest (BitcoinTestFramework):
assert_false(listunspent[0]['change'], "Unspent note should not be change")
# Generate some change
wait_and_assert_operationid_status(self.nodes[1], self.nodes[1].z_sendmany(zaddr1, [{'address': zaddr2, 'amount': 0.6, 'memo': 'c0ffee02'}], 1, 0))
fee = conventional_fee(2)
recipients = [{'address': zaddr2, 'amount': Decimal('0.6'), 'memo': 'c0ffee02'}]
opid = self.nodes[1].z_sendmany(zaddr1, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[1], opid)
self.generate_and_sync()
# Check zaddr1 received
sortedreceived1 = sorted(self.nodes[1].z_listreceivedbyaddress(zaddr1, 0), key = lambda received: received['amount'])
assert_equal(2, len(sortedreceived1), "zaddr1 Should have received 2 notes")
assert_equal(Decimal('0.4'), sortedreceived1[0]['amount'])
assert_true(sortedreceived1[0]['change'], "Note valued at 0.4 should be change")
assert_equal(Decimal('0.4') - fee, sortedreceived1[0]['amount'])
assert_true(sortedreceived1[0]['change'], "Note valued at 0.4 - fee should be change")
assert_equal(Decimal('1.0'), sortedreceived1[1]['amount'])
assert_false(sortedreceived1[1]['change'], "Note valued at 1.0 should not be change")
# Check zaddr2 received
@ -73,8 +76,8 @@ class WalletChangeIndicatorTest (BitcoinTestFramework):
# Check unspent
sortedunspent = sorted(self.nodes[1].z_listunspent(), key = lambda received: received['amount'])
assert_equal(2, len(sortedunspent), "Should have 2 unspent notes")
assert_equal(Decimal('0.4'), sortedunspent[0]['amount'])
assert_true(sortedunspent[0]['change'], "Unspent note valued at 0.4 should be change")
assert_equal(Decimal('0.4') - fee, sortedunspent[0]['amount'])
assert_true(sortedunspent[0]['change'], "Unspent note valued at 0.4 - fee should be change")
assert_equal(Decimal('0.6'), sortedunspent[1]['amount'])
assert_false(sortedunspent[1]['change'], "Unspent note valued at 0.6 should not be change")

View File

@ -74,7 +74,7 @@ class WalletDeprecationTest(BitcoinTestFramework):
except JSONRPCException as e:
errorString = e.error['message']
assert_true(
"DEPRECATED" in errorString,
"DISABLED" in errorString,
"'%s' not disabled (%s)" % (
function,
"failed with '%s'" % errorString if len(errorString) > 0 else "succeeded",

View File

@ -1,10 +1,11 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
import shutil
import os.path
from decimal import Decimal
from test_framework.mininode import COIN
from test_framework.test_framework import BitcoinTestFramework
@ -18,6 +19,7 @@ from test_framework.util import (
wait_bitcoinds,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee
# Test wallet behaviour with the Orchard protocol
class WalletDoubleSpendTest(BitcoinTestFramework):
@ -27,7 +29,6 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 201),
]] * self.num_nodes)
@ -45,11 +46,12 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
ua1 = addrRes1['address']
# Create a note matching recipient_type on node 1
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')
coinbase_fee = conventional_fee(3)
original_amount = Decimal('10') - coinbase_fee
recipients = [{"address": ua1, "amount": original_amount}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
acct1_balance = original_amount
self.sync_all()
self.nodes[0].generate(1)
@ -57,7 +59,7 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# Check the value sent to ua1 was received
assert_equal(
{'pools': {recipient_type: {'valueZat': original_amount}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': acct1_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
# Shut down the nodes
@ -75,29 +77,30 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# Verify the balance on node 1
assert_equal(
{'pools': {recipient_type: {'valueZat': original_amount}},
{'pools': {recipient_type: {'valueZat': acct1_balance * COIN}},
'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': original_amount}},
{'pools': {recipient_type: {'valueZat': acct1_balance * COIN}},
'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct1))
# Spend the note from node 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)
fee = conventional_fee(2)
node1_spend_amount = Decimal('1')
recipients = [{"address": ua0a, "amount": node1_spend_amount}]
myopid = self.nodes[1].z_sendmany(ua1, recipients, 1, fee)
txa_id = wait_and_assert_operationid_status(self.nodes[1], myopid)
acct1_balance_1 = acct1_balance - node1_spend_amount - fee
# Spend the note from node 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)
node2_spend_amount = Decimal('2')
recipients = [{"address": ua0b, "amount": node2_spend_amount}]
myopid = self.nodes[2].z_sendmany(ua1, recipients, 1, fee)
txb_id = wait_and_assert_operationid_status(self.nodes[2], myopid)
acct1_balance_2 = acct1_balance - node2_spend_amount - fee
# Mine the conflicting notes in the split
self.sync_all()
@ -105,14 +108,14 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
self.nodes[3].generate(10)
self.sync_all()
# the remaining balance is visible on both sides of the split
# the remaining balance is visible on each side of the split
assert_equal(
{'pools': {recipient_type: {'valueZat': original_amount - node1_spend_amount}},
{'pools': {recipient_type: {'valueZat': acct1_balance_1 * COIN}},
'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
assert_equal(
{'pools': {recipient_type: {'valueZat': original_amount - node2_spend_amount}},
{'pools': {recipient_type: {'valueZat': acct1_balance_2 * COIN}},
'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct1))
@ -126,7 +129,7 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# acct0a will have received the transaction; it can't see node 2's send
assert_equal(
{'pools': {recipient_type: {'valueZat': node1_spend_amount}}, 'minimum_confirmations': 1},
{'pools': {recipient_type: {'valueZat': node1_spend_amount * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0a))
self.join_network()
@ -141,19 +144,20 @@ class WalletDoubleSpendTest(BitcoinTestFramework):
# After the reorg, node 2 wins, so its balance is the consensus for
# both wallets
acct1_balance = acct1_balance_2
assert_equal(
{'pools': {recipient_type: {'valueZat': original_amount - node2_spend_amount}},
{'pools': {recipient_type: {'valueZat': acct1_balance * COIN}},
'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
assert_equal(
{'pools': {recipient_type: {'valueZat': original_amount - node2_spend_amount}},
{'pools': {recipient_type: {'valueZat': acct1_balance * COIN}},
'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct1))
# acct0b will have received the transaction
assert_equal(
{'pools': {recipient_type: {'valueZat': node2_spend_amount}},
{'pools': {recipient_type: {'valueZat': node2_spend_amount * COIN}},
'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0b))

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2021 The Zcash developers
# Copyright (c) 2021-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -17,6 +17,7 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -26,7 +27,6 @@ class WalletIsFromMe(BitcoinTestFramework):
def setup_network(self, split=False):
self.nodes = start_nodes(1, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(OVERWINTER_BRANCH_ID, 1),
nuparams(SAPLING_BRANCH_ID, 1),
nuparams(BLOSSOM_BRANCH_ID, 1),
@ -41,46 +41,37 @@ class WalletIsFromMe(BitcoinTestFramework):
node = self.nodes[0]
node.generate(101)
assert_equal(node.getbalance('', 0), Decimal('6.25'))
assert_equal(Decimal(node.getbalance('', 0)), Decimal('6.25'))
coinbase_addr = get_coinbase_address(node)
coinbase_fee = conventional_fee(3)
# Send all available funds to a z-address.
zaddr = node.z_getnewaddress()
wait_and_assert_operationid_status(
node,
node.z_sendmany(
coinbase_addr,
[
{'address': zaddr, 'amount': Decimal('6.25')},
],
0,
0,
'AllowRevealedSenders',
),
)
recipients = [{'address': zaddr, 'amount': Decimal('6.25') - coinbase_fee}]
opid = node.z_sendmany(coinbase_addr, recipients, 0, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(node, opid)
self.sync_all()
assert_equal(node.getbalance('', 0), 0)
assert_equal(Decimal(node.getbalance('', 0)), Decimal('0'))
# Mine the transaction; we get another coinbase output.
self.nodes[0].generate(1)
self.sync_all()
assert_equal(node.getbalance('', 0), Decimal('6.25'))
assert_equal(Decimal(node.getbalance('', 0)), Decimal('6.25'))
# Now send the funds back to a new t-address.
taddr = node.getnewaddress()
wait_and_assert_operationid_status(
node,
node.z_sendmany(
zaddr,
[
{'address': taddr, 'amount': Decimal('6.25')},
],
1,
0,
'AllowRevealedRecipients',
),
)
fee = conventional_fee(3)
recipients = [{'address': taddr, 'amount': Decimal('6.25') - coinbase_fee - fee}]
# TODO: this fails for ZIP_317_FEE due to a dust threshold problem:
# "Insufficient funds: have 6.24985, need 0.00000054 more to surpass the dust
# threshold and avoid being forced to over-pay the fee. Alternatively, you could
# specify a fee of 0.0001 to allow overpayment of the conventional fee and have
# this transaction proceed.; 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."
opid = node.z_sendmany(zaddr, recipients, 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(node, opid)
self.sync_all()
# At this point we have created the conditions for the bug in
@ -92,7 +83,7 @@ class WalletIsFromMe(BitcoinTestFramework):
assert_equal(len(node.listunspent(0)), 2)
# "getbalance '' 0" should count both outputs. The bug failed here.
assert_equal(node.getbalance('', 0), Decimal('12.5'))
assert_equal(Decimal(node.getbalance('', 0)), Decimal('12.5') - coinbase_fee - fee)
if __name__ == '__main__':
WalletIsFromMe().main ()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -12,8 +12,8 @@ from test_framework.util import (
nuparams,
start_nodes,
wait_and_assert_operationid_status,
LEGACY_DEFAULT_FEE
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -25,7 +25,6 @@ class WalletListNotes(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(4, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 215),
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
@ -46,10 +45,11 @@ 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 - LEGACY_DEFAULT_FEE
fee = conventional_fee(4)
change_amount_2 = receive_amount_1 - receive_amount_2 - 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, LEGACY_DEFAULT_FEE, 'AllowRevealedAmounts')
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, fee, 'AllowRevealedAmounts')
txid_2 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -86,9 +86,10 @@ 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 - LEGACY_DEFAULT_FEE
fee = conventional_fee(4)
change_amount_3 = change_amount_2 - receive_amount_3 - fee
recipients = [{"address": saplingzaddr2, "amount":receive_amount_3}]
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedAmounts')
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, fee, 'AllowRevealedAmounts')
txid_3 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
unspent_tx = self.nodes[0].z_listunspent(0)
@ -146,9 +147,10 @@ class WalletListNotes(BitcoinTestFramework):
# Create an Orchard note.
account0 = self.nodes[0].z_getnewaccount()['account']
ua0 = self.nodes[0].z_getaddressforaccount(account0)['address']
receive_amount_4 = Decimal('10.0')
fee = conventional_fee(3)
receive_amount_4 = Decimal('10.0') - fee
recipients = [{"address": ua0, "amount": receive_amount_4}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, fee, 'AllowRevealedSenders')
txid_4 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -32,7 +32,6 @@ class ListReceivedTest (BitcoinTestFramework):
def setup_network(self):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 225),
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
@ -304,7 +303,7 @@ class ListReceivedTest (BitcoinTestFramework):
opid = self.nodes[1].z_sendmany(taddr, [
{'address': uao, 'amount': 1, 'memo': my_memo},
{'address': uaso, 'amount': 2},
], 1, 0, 'AllowFullyTransparent')
], 1, ZIP_317_FEE, 'AllowFullyTransparent')
txid0 = wait_and_assert_operationid_status(self.nodes[1], opid)
self.sync_all()

View File

@ -1,9 +1,10 @@
#!/usr/bin/env python3
# Copyright (c) 2016-2022 The Zcash developers
# Copyright (c) 2016-2024 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.mininode import COIN
from test_framework.util import (
assert_equal,
get_coinbase_address,
@ -12,6 +13,7 @@ from test_framework.util import (
wait_and_assert_operationid_status,
NU5_BRANCH_ID
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -21,7 +23,6 @@ def unspent_total(unspent):
class WalletListUnspent(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(4, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 201),
'-allowdeprecated=getnewaddress',
]] * 4)
@ -33,24 +34,23 @@ class WalletListUnspent(BitcoinTestFramework):
def expected_matured_at_height(height):
return (height-200)*10 + 250
assert_equal(self.nodes[0].getbalance(), expected_matured_at_height(200))
assert_equal(self.nodes[1].getbalance(), expected_matured_at_height(200))
assert_equal(Decimal(self.nodes[0].getbalance()), expected_matured_at_height(200))
assert_equal(Decimal(self.nodes[1].getbalance()), expected_matured_at_height(200))
# Activate NU5
self.nodes[1].generate(1) # height 201
self.sync_all()
assert_equal(self.nodes[0].getbalance(), expected_matured_at_height(201))
assert_equal(Decimal(self.nodes[0].getbalance()), expected_matured_at_height(201))
# check balances from before the latest tx
assert_equal(self.nodes[0].getbalance("", 1, False, False, 200), expected_matured_at_height(200))
assert_equal(Decimal(self.nodes[0].getbalance("", 1, False, False, 200)), expected_matured_at_height(200))
assert_equal(self.matured_at_height(200), expected_matured_at_height(200))
# Shield some coinbase funds so that they become spendable
n1acct = self.nodes[1].z_getnewaccount()['account']
n1uaddr = self.nodes[1].z_getaddressforaccount(n1acct)['address']
opid = self.nodes[0].z_sendmany(
get_coinbase_address(self.nodes[0]),
[{'address': n1uaddr, 'amount': 10}],
1, 0, 'AllowRevealedSenders')
fee = conventional_fee(3)
recipients = [{'address': n1uaddr, 'amount': Decimal('10') - fee}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
@ -60,60 +60,52 @@ class WalletListUnspent(BitcoinTestFramework):
assert_equal(
self.nodes[1].z_getbalanceforaccount(n1acct, 1)['pools']['orchard']['valueZat'],
Decimal('1000000000'))
(Decimal('10') - fee) * COIN)
# Get a bare legacy transparent address for node 0
n0addr = self.nodes[0].getnewaddress()
# Send funds to the node 0 address so we have transparent funds to spend.
opid = self.nodes[1].z_sendmany(
n1uaddr,
[{'address': n0addr, 'amount': 10}],
1, 0, 'AllowRevealedRecipients')
recipients = [{'address': n0addr, 'amount': Decimal('10') - 2 * fee}]
opid = self.nodes[1].z_sendmany(n1uaddr, recipients, 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[1], opid)
self.sync_all()
self.nodes[1].generate(2)
self.sync_all() # height 205
assert_equal(self.nodes[0].getbalance(), expected_matured_at_height(205) - 10 + 10)
assert_equal(Decimal(self.nodes[0].getbalance()), expected_matured_at_height(205) - 10 + 10 - 2 * fee)
# We will then perform several spends, and then check the list of
# unspent notes as of various heights.
opid = self.nodes[0].z_sendmany(
'ANY_TADDR',
[{'address': n1uaddr, 'amount': 2}],
1, 0, 'AllowFullyTransparent')
recipients = [{'address': n1uaddr, 'amount': Decimal('2')}]
opid = self.nodes[0].z_sendmany('ANY_TADDR', recipients, 1, fee, 'AllowFullyTransparent')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.nodes[0].generate(2)
self.sync_all() # height 207
assert_equal(self.nodes[0].getbalance(), expected_matured_at_height(207) - 10 + 10 - 2)
assert_equal(Decimal(self.nodes[0].getbalance()), expected_matured_at_height(207) - 10 + 10 - 2 - 3 * fee)
opid = self.nodes[0].z_sendmany(
'ANY_TADDR',
[{'address': n1uaddr, 'amount': 3}],
1, 0, 'AllowFullyTransparent')
recipients = [{'address': n1uaddr, 'amount': Decimal('3')}]
opid = self.nodes[0].z_sendmany('ANY_TADDR', recipients, 1, fee, 'AllowFullyTransparent')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.nodes[0].generate(2)
self.sync_all() # height 209
assert_equal(self.nodes[0].getbalance(), expected_matured_at_height(209) - 10 + 10 - 2 - 3)
assert_equal(Decimal(self.nodes[0].getbalance()), expected_matured_at_height(209) - 10 + 10 - 2 - 3 - 4 * fee)
opid = self.nodes[0].z_sendmany(
'ANY_TADDR',
[{'address': n1uaddr, 'amount': 5}],
1, 0, 'AllowRevealedSenders')
recipients = [{'address': n1uaddr, 'amount': Decimal('5') - 5 * fee}]
opid = self.nodes[0].z_sendmany('ANY_TADDR', recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.nodes[0].generate(2)
self.sync_all() # height 211
assert_equal(self.nodes[0].getbalance(), expected_matured_at_height(211) - 10 + 10 - 2 - 3 - 5)
assert_equal(Decimal(self.nodes[0].getbalance()), expected_matured_at_height(211) - 10 + 10 - 2 - 3 - 5)
# check balances at various past points in the chain
assert_equal(self.matured_at_height(205), expected_matured_at_height(205) - 10 + 10)
assert_equal(self.matured_at_height(207), expected_matured_at_height(207) - 10 + 10 - 2)
assert_equal(self.matured_at_height(209), expected_matured_at_height(209) - 10 + 10 - 2 - 3)
assert_equal(self.matured_at_height(205), expected_matured_at_height(205) - 10 + 10 - 2 * fee)
assert_equal(self.matured_at_height(207), expected_matured_at_height(207) - 10 + 10 - 2 - 3 * fee)
assert_equal(self.matured_at_height(209), expected_matured_at_height(209) - 10 + 10 - 2 - 3 - 4 * fee)
assert_equal(self.matured_at_height(211), expected_matured_at_height(211) - 10 + 10 - 2 - 3 - 5)
if __name__ == '__main__':

View File

@ -1,13 +1,13 @@
#!/usr/bin/env python3
# Copyright (c) 2016 The Zcash developers
# Copyright (c) 2016-2024 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 assert_equal, assert_true, bitcoind_processes, \
connect_nodes_bi, start_node, start_nodes, wait_and_assert_operationid_status, \
get_coinbase_address, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
get_coinbase_address
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
@ -31,12 +31,13 @@ class WalletNullifiersTest (BitcoinTestFramework):
# send node 0 taddr to zaddr to get out of coinbase
# Tests using the default cached chain have one address per coinbase output
mytaddr = get_coinbase_address(self.nodes[0])
coinbase_fee = conventional_fee(3)
recipients = []
recipients.append({"address": myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE}) # utxo amount less fee
recipients.append({"address": myzaddr0, "amount": Decimal('10.0') - coinbase_fee}) # utxo amount less fee
wait_and_assert_operationid_status(
self.nodes[0],
self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'),
self.nodes[0].z_sendmany(mytaddr, recipients, 1, coinbase_fee, 'AllowRevealedSenders'),
timeout=120)
self.sync_all()
@ -109,7 +110,7 @@ class WalletNullifiersTest (BitcoinTestFramework):
wait_and_assert_operationid_status(
self.nodes[1],
self.nodes[1].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients'),
self.nodes[1].z_sendmany(myzaddr, recipients, 1, ZIP_317_FEE, 'AllowRevealedRecipients'),
timeout=120)
self.sync_all()
@ -118,7 +119,7 @@ class WalletNullifiersTest (BitcoinTestFramework):
# check zaddr balance
zsendmany3notevalue = Decimal('1.0')
zaddrremaining2 = zaddrremaining - zsendmany3notevalue - LEGACY_DEFAULT_FEE
zaddrremaining2 = zaddrremaining - zsendmany3notevalue - conventional_fee(3)
assert_equal(self.nodes[1].z_getbalance(myzaddr), zaddrremaining2)
assert_equal(self.nodes[2].z_getbalance(myzaddr), zaddrremaining2)

View File

@ -1,9 +1,10 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 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.mininode import COIN
from test_framework.util import (
NU5_BRANCH_ID,
assert_equal,
@ -12,6 +13,7 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -23,7 +25,6 @@ class WalletOrchardTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 210),
]] * self.num_nodes)
@ -52,9 +53,12 @@ class WalletOrchardTest(BitcoinTestFramework):
ua2 = addrRes2['address']
saplingAddr2 = self.nodes[2].z_listunifiedreceivers(ua2)['sapling']
recipients = [{"address": saplingAddr2, "amount": Decimal('10')}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
coinbase_fee = conventional_fee(3)
coinbase_amount = Decimal('10') - coinbase_fee
recipients = [{"address": saplingAddr2, "amount": coinbase_amount}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
acct2_balance = coinbase_amount
# Mine the tx & activate NU5
self.sync_all()
@ -63,14 +67,15 @@ class WalletOrchardTest(BitcoinTestFramework):
# Check the value sent to saplingAddr2 was received in node 2's account
assert_equal(
{'pools': {'sapling': {'valueZat': Decimal('1000000000')}}, 'minimum_confirmations': 1},
{'pools': {'sapling': {'valueZat': acct2_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct2))
# Node 0 shields some funds
# t-coinbase -> Orchard
recipients = [{"address": ua1, "amount": Decimal('10')}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
recipients = [{"address": ua1, "amount": coinbase_amount}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
acct1_balance = coinbase_amount
resp = self.nodes[0].getrawtransaction(mytxid, 1)['orchard']
@ -88,8 +93,8 @@ class WalletOrchardTest(BitcoinTestFramework):
flags = resp['flags']
assert_equal(flags['enableSpends'], True)
assert_equal(flags['enableOutputs'], True)
assert_equal(resp['valueBalance'], Decimal('-10'))
assert_equal(resp['valueBalanceZat'], Decimal('-1000000000'))
assert_equal(resp['valueBalance'], -coinbase_amount)
assert_equal(resp['valueBalanceZat'], -coinbase_amount * COIN)
assert('anchor' in resp)
assert('proof' in resp)
assert('bindingSig' in resp)
@ -99,16 +104,17 @@ class WalletOrchardTest(BitcoinTestFramework):
self.sync_all()
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('1000000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct1_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
# Split the network
self.split_network()
# Send another tx to ua1
recipients = [{"address": ua1, "amount": Decimal('10')}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
# Send another coinbase_amount to ua1
recipients = [{"address": ua1, "amount": coinbase_amount}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
acct1_balance += coinbase_amount
# Mine the tx & generate a majority chain on the 0/1 side of the split
self.sync_all()
@ -116,7 +122,7 @@ class WalletOrchardTest(BitcoinTestFramework):
self.sync_all()
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('2000000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct1_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
# On the other side of the split, send some funds to node 3
@ -125,9 +131,12 @@ class WalletOrchardTest(BitcoinTestFramework):
assert_equal(acct3, addrRes3['account'])
ua3 = addrRes3['address']
fee = conventional_fee(4)
recipients = [{"address": ua3, "amount": Decimal('1')}]
myopid = self.nodes[2].z_sendmany(ua2, recipients, 1, 0, 'AllowRevealedAmounts')
myopid = self.nodes[2].z_sendmany(ua2, recipients, 1, fee, 'AllowRevealedAmounts')
rollback_tx = wait_and_assert_operationid_status(self.nodes[2], myopid)
acct3_balance = Decimal('1')
acct2_balance -= Decimal('1') + fee
self.sync_all()
self.nodes[2].generate(1)
@ -136,11 +145,11 @@ class WalletOrchardTest(BitcoinTestFramework):
# The remaining change from ua2's Sapling note has been sent to the
# account's internal Orchard change address.
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('900000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct2_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct2))
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('100000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct3_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[3].z_getbalanceforaccount(acct3))
# Check that the mempools are empty
@ -153,7 +162,7 @@ class WalletOrchardTest(BitcoinTestFramework):
# split 0/1's chain should have won, so their wallet balance should be consistent
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('2000000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct1_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
# split 2/3's chain should have been rolled back, so their txn should have been
@ -166,9 +175,9 @@ class WalletOrchardTest(BitcoinTestFramework):
{'pools': {}, 'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct2))
# acct2's incoming change (unconfirmed, still in the mempool) is 9 zec
# acct2's incoming change is unconfirmed and still in the mempool
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('900000000')}}, 'minimum_confirmations': 0},
{'pools': {'orchard': {'valueZat': acct2_balance * COIN}}, 'minimum_confirmations': 0},
self.nodes[2].z_getbalanceforaccount(acct2, 0))
# The transaction was un-mined, so acct3 should have no confirmed balance
@ -178,7 +187,7 @@ class WalletOrchardTest(BitcoinTestFramework):
# acct3's unconfirmed balance is 1 zec
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('100000000')}}, 'minimum_confirmations': 0},
{'pools': {'orchard': {'valueZat': acct3_balance * COIN}}, 'minimum_confirmations': 0},
self.nodes[3].z_getbalanceforaccount(acct3, 0))
# Manually resend the transaction in node 2's mempool
@ -191,41 +200,50 @@ class WalletOrchardTest(BitcoinTestFramework):
# The un-mined transaction should now have been re-mined
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('900000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct2_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct2))
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('100000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct3_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[3].z_getbalanceforaccount(acct3))
# Split the network again
self.split_network()
# Spend some of acct3's funds on the 2/3 side of the split
recipients = [{"address": ua2, "amount": Decimal('0.5')}]
myopid = self.nodes[3].z_sendmany(ua3, recipients, 1, 0)
fee = conventional_fee(4)
amount = Decimal('0.5')
recipients = [{"address": ua2, "amount": amount}]
myopid = self.nodes[3].z_sendmany(ua3, recipients, 1, fee)
rollback_tx = wait_and_assert_operationid_status(self.nodes[3], myopid)
acct2_balance += amount
acct3_balance -= amount + fee
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('950000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct2_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct2))
assert_equal(
{'pools': {'orchard': {'valueZat': acct3_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[3].z_getbalanceforaccount(acct3))
# Generate a majority chain on the 0/1 side of the split, then
# re-join the network.
self.nodes[1].generate(10)
self.join_network()
acct2_balance -= amount
# split 2/3's chain should have been rolled back, so their txn should have been
# un-mined and returned to the mempool
assert_equal(set([rollback_tx]), set(self.nodes[3].getrawmempool()))
# acct2's balance is back to not contain the Orchard->Orchard value
# acct2's balance is back to not containing the Orchard->Orchard value
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('900000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct2_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct2))
# acct3's sole Orchard note is spent by a transaction in the mempool, so our
@ -236,6 +254,7 @@ class WalletOrchardTest(BitcoinTestFramework):
# Manually resend the transaction in node 3's mempool
self.nodes[2].resendwallettransactions()
acct2_balance += amount
# Sync the network
self.sync_all()
@ -244,7 +263,7 @@ class WalletOrchardTest(BitcoinTestFramework):
# The un-mined transaction should now have been re-mined
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('950000000')}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': acct2_balance * COIN}}, 'minimum_confirmations': 1},
self.nodes[2].z_getbalanceforaccount(acct2))
if __name__ == '__main__':

View File

@ -1,9 +1,12 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.mininode import COIN
from test_framework.util import (
NU5_BRANCH_ID,
assert_equal,
@ -14,6 +17,7 @@ from test_framework.util import (
wait_and_assert_operationid_status,
wait_bitcoinds,
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
# Test wallet behaviour with the Orchard protocol
class WalletOrchardChangeTest(BitcoinTestFramework):
@ -23,7 +27,6 @@ class WalletOrchardChangeTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 205),
'-regtestwalletsetbestchaineveryblock',
]] * self.num_nodes)
@ -46,8 +49,10 @@ class WalletOrchardChangeTest(BitcoinTestFramework):
acct0 = self.nodes[0].z_getnewaccount()['account']
ua0 = self.nodes[0].z_getaddressforaccount(acct0, ['sapling', 'orchard'])['address']
recipients = [{"address": ua0, "amount": 10}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
coinbase_fee = conventional_fee(3)
balance0 = Decimal('10') - coinbase_fee
recipients = [{"address": ua0, "amount": balance0}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Mine the tx & activate NU5.
@ -56,7 +61,7 @@ class WalletOrchardChangeTest(BitcoinTestFramework):
self.sync_all()
assert_equal(
{'pools': {'sapling': {'valueZat': 10_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'sapling': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0),
)
@ -65,8 +70,12 @@ class WalletOrchardChangeTest(BitcoinTestFramework):
acct1 = self.nodes[1].z_getnewaccount()['account']
ua1 = self.nodes[1].z_getaddressforaccount(acct1, ['orchard'])['address']
recipients = [{"address": ua1, "amount": 1}]
myopid = self.nodes[0].z_sendmany(ua0, recipients, 1, 0, 'AllowRevealedAmounts')
recipients = [{"address": ua1, "amount": Decimal('1')}]
# TODO The z_sendmany call fails when passed `None`/`ZIP_317_FEE` because it calculates
# a fee that is too low, so we have to pass in an explicit fee instead.
# https://github.com/zcash/zcash/issues/6956
fee = conventional_fee(4)
myopid = self.nodes[0].z_sendmany(ua0, recipients, 1, fee, 'AllowRevealedAmounts')
source_tx = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -74,8 +83,9 @@ class WalletOrchardChangeTest(BitcoinTestFramework):
self.sync_all()
# The nodes have the expected split of funds.
balance0 -= Decimal('1') + fee
assert_equal(
{'pools': {'orchard': {'valueZat': 9_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0),
)
assert_equal(
@ -88,8 +98,8 @@ class WalletOrchardChangeTest(BitcoinTestFramework):
'pool': 'orchard',
'outgoing': False,
'walletInternal': True,
'value': 9,
'valueZat': 9_0000_0000,
'value': balance0,
'valueZat': balance0 * COIN,
})
# Shut down the nodes, and restart so that we can check wallet load
@ -99,7 +109,7 @@ class WalletOrchardChangeTest(BitcoinTestFramework):
# The nodes have unaltered balances.
assert_equal(
{'pools': {'orchard': {'valueZat': 9_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0),
)
assert_equal(
@ -108,15 +118,16 @@ class WalletOrchardChangeTest(BitcoinTestFramework):
)
# Send another Orchard transaction from node 0 to node 1.
myopid = self.nodes[0].z_sendmany(ua0, recipients, 1, 0)
myopid = self.nodes[0].z_sendmany(ua0, recipients, 1, ZIP_317_FEE)
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
balance0 -= Decimal('1') + conventional_fee(2)
assert_equal(
{'pools': {'orchard': {'valueZat': 8_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0),
)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -9,6 +9,7 @@ import os.path
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.mininode import COIN
from test_framework.util import (
NU5_BRANCH_ID,
assert_equal,
@ -19,6 +20,7 @@ from test_framework.util import (
wait_bitcoinds,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
# Test wallet behaviour with the Orchard protocol
class OrchardWalletInitTest(BitcoinTestFramework):
@ -28,7 +30,6 @@ class OrchardWalletInitTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 205),
'-regtestwalletsetbestchaineveryblock'
]] * self.num_nodes)
@ -50,8 +51,10 @@ class OrchardWalletInitTest(BitcoinTestFramework):
ua1 = self.nodes[1].z_getaddressforaccount(acct1, ['orchard'])['address']
# Send a transaction to node 1 so that it has an Orchard note to spend.
recipients = [{"address": ua1, "amount": 10}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
coinbase_fee = conventional_fee(3)
balance1 = Decimal('10') - coinbase_fee
recipients = [{"address": ua1, "amount": balance1}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -60,12 +63,12 @@ class OrchardWalletInitTest(BitcoinTestFramework):
# Check the value sent to ua1 was received
assert_equal(
{'pools': {'orchard': {'valueZat': 10_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance1 * COIN}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
# Create an Orchard spend, so that the note commitment tree root gets altered.
recipients = [{"address": ua0, "amount": 1}]
myopid = self.nodes[1].z_sendmany(ua1, recipients, 1, 0)
myopid = self.nodes[1].z_sendmany(ua1, recipients, 1, ZIP_317_FEE)
wait_and_assert_operationid_status(self.nodes[1], myopid)
self.sync_all()
@ -73,8 +76,9 @@ class OrchardWalletInitTest(BitcoinTestFramework):
self.sync_all()
# Verify the balance on both nodes
balance1 -= Decimal('1') + conventional_fee(2)
assert_equal(
{'pools': {'orchard': {'valueZat': 9_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance1 * COIN}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
assert_equal(
@ -103,7 +107,7 @@ class OrchardWalletInitTest(BitcoinTestFramework):
self.setup_network(True)
assert_equal(
{'pools': {'orchard': {'valueZat': 9_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance1 * COIN}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))
# Get a new account with an Orchard UA on node 0
@ -114,7 +118,7 @@ class OrchardWalletInitTest(BitcoinTestFramework):
# the bug causes the state of note commitment tree in the wallet to not match
# the state of the global note commitment tree.
recipients = [{"address": ua0new, "amount": 1}]
myopid = self.nodes[1].z_sendmany(ua1, recipients, 1, 0)
myopid = self.nodes[1].z_sendmany(ua1, recipients, 1, ZIP_317_FEE)
rollback_tx = wait_and_assert_operationid_status(self.nodes[1], myopid)
self.sync_all()
@ -140,21 +144,23 @@ class OrchardWalletInitTest(BitcoinTestFramework):
self.nodes[0].generate(1)
self.sync_all()
balance1 -= Decimal('1') + conventional_fee(2)
assert_equal(
{'pools': {'orchard': {'valueZat': 1_0000_0000}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0new))
# Spend from the note that was just received
recipients = [{"address": ua1, "amount": Decimal('0.3')}]
myopid = self.nodes[0].z_sendmany(ua0new, recipients, 1, 0)
myopid = self.nodes[0].z_sendmany(ua0new, recipients, 1, ZIP_317_FEE)
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
balance1 += Decimal('0.3')
assert_equal(
{'pools': {'orchard': {'valueZat': 8_3000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance1 * COIN}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1))

View File

@ -1,9 +1,10 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 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.mininode import COIN
from test_framework.util import (
NU5_BRANCH_ID,
assert_equal,
@ -14,6 +15,7 @@ from test_framework.util import (
wait_bitcoinds,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
@ -25,7 +27,6 @@ class WalletOrchardPersistenceTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 201),
]] * self.num_nodes)
@ -41,8 +42,10 @@ class WalletOrchardPersistenceTest(BitcoinTestFramework):
acct0 = self.nodes[0].z_getnewaccount()['account']
ua0 = self.nodes[0].z_getaddressforaccount(acct0, ['sapling', 'orchard'])['address']
recipients = [{"address": ua0, "amount": 10}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
coinbase_fee = conventional_fee(3)
balance0 = Decimal('10') - coinbase_fee
recipients = [{"address": ua0, "amount": balance0}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Mine the tx
@ -51,7 +54,7 @@ class WalletOrchardPersistenceTest(BitcoinTestFramework):
self.sync_all()
assert_equal(
{'pools': {'orchard': {'valueZat': 10_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0))
# Send to a new orchard-only unified address
@ -59,15 +62,16 @@ class WalletOrchardPersistenceTest(BitcoinTestFramework):
ua1 = self.nodes[1].z_getaddressforaccount(acct1, ['orchard'])['address']
recipients = [{"address": ua1, "amount": 1}]
myopid = self.nodes[0].z_sendmany(ua0, recipients, 1, 0)
myopid = self.nodes[0].z_sendmany(ua0, recipients, 1, ZIP_317_FEE)
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
balance0 -= Decimal('1') + conventional_fee(2)
assert_equal(
{'pools': {'orchard': {'valueZat': 9_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0))
assert_equal(
{'pools': {'orchard': {'valueZat': 1_0000_0000}}, 'minimum_confirmations': 1},
@ -76,7 +80,7 @@ class WalletOrchardPersistenceTest(BitcoinTestFramework):
# Send another Orchard transaction from node 0 back to itself, so that the
# note commitment tree gets advanced.
recipients = [{"address": ua0, "amount": 1}]
myopid = self.nodes[0].z_sendmany(ua0, recipients, 1, 0)
myopid = self.nodes[0].z_sendmany(ua0, recipients, 1, ZIP_317_FEE)
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -88,20 +92,22 @@ class WalletOrchardPersistenceTest(BitcoinTestFramework):
wait_bitcoinds()
self.setup_network()
balance0 -= conventional_fee(2)
assert_equal(
{'pools': {'orchard': {'valueZat': 9_0000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0))
recipients = [{"address": ua0, "amount": Decimal('0.5')}]
myopid = self.nodes[1].z_sendmany(ua1, recipients, 1, 0)
myopid = self.nodes[1].z_sendmany(ua1, recipients, 1, ZIP_317_FEE)
wait_and_assert_operationid_status(self.nodes[1], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
balance0 += Decimal('0.5')
assert_equal(
{'pools': {'orchard': {'valueZat': 9_5000_0000}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0))
if __name__ == '__main__':

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2023 The Zcash developers
# Copyright (c) 2023-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -16,12 +16,12 @@ from test_framework.util import (
wait_and_assert_operationid_status,
wait_bitcoinds,
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
import time
BASE_ARGS = [
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 210),
'-regtestwalletsetbestchaineveryblock',
]
@ -49,10 +49,11 @@ class WalletOrchardReindexTest(BitcoinTestFramework):
# Create a transaction with an Orchard output to advance the Orchard
# commitment tree.
recipients = [{'address': ua, 'amount': Decimal('10')}]
coinbase_fee = conventional_fee(3)
recipients = [{'address': ua, 'amount': Decimal('10') - coinbase_fee}]
myopid = self.nodes[0].z_sendmany(
get_coinbase_address(self.nodes[0]),
recipients, 1, 0, 'AllowRevealedSenders')
recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Mine the transaction.
@ -62,7 +63,7 @@ class WalletOrchardReindexTest(BitcoinTestFramework):
# Confirm that we see the Orchard note in the wallet.
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('10') * COIN}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': (Decimal('10') - coinbase_fee) * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct))
# Mine blocks to ensure that the wallet's tip is far enough beyond NU5
@ -90,7 +91,7 @@ class WalletOrchardReindexTest(BitcoinTestFramework):
# Confirm that we still see the Orchard note in the wallet.
assert_equal(
{'pools': {'orchard': {'valueZat': Decimal('10') * COIN}}, 'minimum_confirmations': 1},
{'pools': {'orchard': {'valueZat': (Decimal('10') - coinbase_fee) * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct))
if __name__ == '__main__':

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -7,12 +7,13 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
assert_greater_than,
assert_raises_message,
connect_nodes_bi,
get_coinbase_address,
start_nodes,
wait_and_assert_operationid_status,
LEGACY_DEFAULT_FEE
)
from test_framework.zip317 import conventional_fee
from test_framework.authproxy import JSONRPCException
from decimal import Decimal
@ -58,6 +59,7 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Currently at block 195. The next block to be mined 196 is a Sapling block
#
bci = self.nodes[0].getblockchaininfo()
assert_equal(bci['blocks'], 195)
assert_equal(bci['consensus']['chaintip'], '76b809bb')
assert_equal(bci['consensus']['nextblock'], '76b809bb')
assert_equal(bci['upgrades']['2bb40e60']['status'], 'pending')
@ -68,14 +70,14 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
self.sync_all()
# 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, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
fee = conventional_fee(2)
recipients = [{"address": taddr1, "amount": Decimal('0.5')}]
myopid = self.nodes[2].z_sendmany(taddr2, recipients, 0, 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') - LEGACY_DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr2, LEGACY_DEFAULT_FEE, 1)
# Node 0 shields to Node 2, a coinbase utxo of value 10.0 less fee
shield_fee = conventional_fee(3)
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr2, shield_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,8 +88,8 @@ 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') - LEGACY_DEFAULT_FEE)
assert_equal(self.nodes[2].z_getbalance(zaddr2), zsendamount)
assert_equal(self.nodes[2].getbalance(), Decimal('0.5') - fee)
assert_equal(self.nodes[2].z_getbalance(zaddr2), Decimal('10.0') - shield_fee)
# Verify transaction version is 4 (intended for Sapling+)
result = self.nodes[0].getrawtransaction(txid_transparent, 1)
@ -104,32 +106,20 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Currently at block 199. The next block to be mined 200 is a Blossom block
#
bci = self.nodes[0].getblockchaininfo()
assert_equal(bci['blocks'], 199)
assert_equal(bci['consensus']['chaintip'], '76b809bb')
assert_equal(bci['consensus']['nextblock'], '2bb40e60')
assert_equal(bci['upgrades']['2bb40e60']['status'], 'pending')
# Test using expiryheight parameter of createrawtransaction when Blossom is active in the next block
errorString = ""
try:
self.nodes[0].createrawtransaction([], {}, 0, 499999999)
except JSONRPCException as e:
errorString = e.error['message']
assert_equal("", errorString)
try:
self.nodes[0].createrawtransaction([], {}, 0, -1)
except JSONRPCException as e:
errorString = e.error['message']
assert_equal("Invalid parameter, expiryheight must be nonnegative and less than 500000000" in errorString, True)
try:
self.nodes[0].createrawtransaction([], {}, 0, 500000000)
except JSONRPCException as e:
errorString = e.error['message']
assert_equal("Invalid parameter, expiryheight must be nonnegative and less than 500000000" in errorString, True)
try:
self.nodes[0].createrawtransaction([], {}, 0, 200)
except JSONRPCException as e:
errorString = e.error['message']
assert_equal("Invalid parameter, expiryheight should be at least 203 to avoid transaction expiring soon" in errorString, True)
assert_equal(type(self.nodes[0].createrawtransaction([], {}, 0, 499999999)), str)
assert_raises_message(JSONRPCException, "Invalid parameter, expiryheight must be nonnegative and less than 500000000",
self.nodes[0].createrawtransaction, [], {}, 0, -1)
assert_raises_message(JSONRPCException, "Invalid parameter, expiryheight must be nonnegative and less than 500000000",
self.nodes[0].createrawtransaction, [], {}, 0, 500000000)
assert_raises_message(JSONRPCException, "Invalid parameter, expiryheight should be at least 203 to avoid transaction expiring soon",
self.nodes[0].createrawtransaction, [], {}, 0, 200)
# Node 0 sends transparent funds to Node 3
tsendamount = Decimal('1.0')
@ -137,14 +127,12 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
self.sync_all()
# 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, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
recipients = [{"address": taddr1, "amount": Decimal('0.5')}]
myopid = self.nodes[3].z_sendmany(taddr3, recipients, 0, 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') - LEGACY_DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr3, LEGACY_DEFAULT_FEE, 1)
# Node 0 shields to Node 3, a coinbase utxo of value 10.0 less fee
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr3, shield_fee, 1)
txid_shielded = wait_and_assert_operationid_status(self.nodes[0], result['opid'])
# Mine the first Blossom block
@ -156,16 +144,17 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# size_on_disk should be > 0
assert_greater_than(bci['size_on_disk'], 0)
assert_equal(bci['blocks'], 200)
assert_equal(bci['consensus']['chaintip'], '2bb40e60')
assert_equal(bci['consensus']['nextblock'], '2bb40e60')
assert_equal(bci['upgrades']['2bb40e60']['status'], 'active')
# Verify balance
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('1.0'))
assert_equal(self.nodes[3].getbalance(), Decimal('0.5') - LEGACY_DEFAULT_FEE)
assert_equal(self.nodes[3].z_getbalance(zaddr3), zsendamount)
assert_equal(self.nodes[3].getbalance(), Decimal('0.5') - fee)
assert_equal(self.nodes[3].z_getbalance(zaddr3), Decimal('10.0') - shield_fee)
# Verify transaction version is 4 (intended for Sapling+)
# Verify transaction version is 4 (Sapling onward)
result = self.nodes[0].getrawtransaction(txid_transparent, 1)
assert_equal(result["version"], 4)
assert_equal(result["overwintered"], True)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -12,6 +12,8 @@ from test_framework.util import (
initialize_chain_clean, connect_nodes_bi, wait_bitcoinds,
wait_and_assert_operationid_status
)
from test_framework.zip317 import conventional_fee
from decimal import Decimal
class WalletPersistenceTest (BitcoinTestFramework):
@ -22,7 +24,6 @@ class WalletPersistenceTest (BitcoinTestFramework):
def setup_network(self, split=False):
self.nodes = start_nodes(4, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
'-allowdeprecated=z_gettotalbalance',
@ -95,9 +96,9 @@ class WalletPersistenceTest (BitcoinTestFramework):
# Node 0 shields funds to Sapling address
taddr0 = get_coinbase_address(self.nodes[0])
recipients = []
recipients.append({"address": sapling_addr, "amount": Decimal('20')})
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, 0, 'AllowRevealedSenders')
fee = conventional_fee(4)
recipients = [{"address": sapling_addr, "amount": Decimal('20') - fee}]
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -106,15 +107,15 @@ class WalletPersistenceTest (BitcoinTestFramework):
self.sync_all()
# Verify shielded balance
assert_equal(self.nodes[0].z_getbalance(sapling_addr), Decimal('20'))
assert_equal(Decimal(self.nodes[0].z_getbalance(sapling_addr)), Decimal('20') - fee)
# Verify size of pools
chainInfo = self.nodes[0].getblockchaininfo()
pools = chainInfo['valuePools']
check_chain_value(chainInfo['chainSupply'], None, expected_supply) # Supply
check_chain_value(pools[0], 'transparent', expected_supply - Decimal('20')) # Transparent
check_chain_value(pools[0], 'transparent', expected_supply - (Decimal('20') - fee)) # Transparent
check_chain_value(pools[1], 'sprout', Decimal('0'))
check_chain_value(pools[2], 'sapling', Decimal('20'))
check_chain_value(pools[2], 'sapling', Decimal('20') - fee)
check_chain_value(pools[3], 'orchard', Decimal('0'))
# Restart the nodes
@ -126,16 +127,15 @@ class WalletPersistenceTest (BitcoinTestFramework):
chainInfo = self.nodes[0].getblockchaininfo()
pools = chainInfo['valuePools']
check_chain_value(chainInfo['chainSupply'], None, expected_supply) # Supply
check_chain_value(pools[0], 'transparent', expected_supply - Decimal('20')) # Transparent
check_chain_value(pools[0], 'transparent', expected_supply - (Decimal('20') - fee)) # Transparent
check_chain_value(pools[1], 'sprout', Decimal('0'))
check_chain_value(pools[2], 'sapling', Decimal('20'))
check_chain_value(pools[2], 'sapling', Decimal('20') - fee)
check_chain_value(pools[3], 'orchard', Decimal('0'))
# Node 0 sends some shielded funds to Node 1
dest_addr = self.nodes[1].z_getnewaddress('sapling')
recipients = []
recipients.append({"address": dest_addr, "amount": Decimal('15')})
myopid = self.nodes[0].z_sendmany(sapling_addr, recipients, 1, 0)
recipients = [{"address": dest_addr, "amount": Decimal('15') - fee}]
myopid = self.nodes[0].z_sendmany(sapling_addr, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -143,8 +143,8 @@ class WalletPersistenceTest (BitcoinTestFramework):
self.sync_all()
# Verify balances
assert_equal(self.nodes[0].z_getbalance(sapling_addr), Decimal('5'))
assert_equal(self.nodes[1].z_getbalance(dest_addr), Decimal('15'))
assert_equal(Decimal(self.nodes[0].z_getbalance(sapling_addr)), Decimal('5') - fee)
assert_equal(Decimal(self.nodes[1].z_getbalance(dest_addr)), Decimal('15') - fee)
# Restart the nodes
stop_nodes(self.nodes)
@ -152,20 +152,20 @@ class WalletPersistenceTest (BitcoinTestFramework):
self.setup_network()
# Verify balances
assert_equal(self.nodes[0].z_getbalance(sapling_addr), Decimal('5'))
assert_equal(self.nodes[1].z_getbalance(dest_addr), Decimal('15'))
assert_equal(Decimal(self.nodes[0].z_getbalance(sapling_addr)), Decimal('5') - fee)
assert_equal(Decimal(self.nodes[1].z_getbalance(dest_addr)), Decimal('15') - fee)
# Verify importing a spending key will update and persist the nullifiers and witnesses correctly
sk0 = self.nodes[0].z_exportkey(sapling_addr)
self.nodes[2].z_importkey(sk0, "yes")
assert_equal(self.nodes[2].z_getbalance(sapling_addr), Decimal('5'))
assert_equal(Decimal(self.nodes[2].z_getbalance(sapling_addr)), Decimal('5') - fee)
# Verify importing a viewing key will update and persist the nullifiers and witnesses correctly
extfvk0 = self.nodes[0].z_exportviewingkey(sapling_addr)
self.nodes[3].z_importviewingkey(extfvk0, "yes")
assert_equal(self.nodes[3].z_getbalance(sapling_addr), Decimal('5'))
assert_equal(self.nodes[3].z_gettotalbalance()['private'], '0.00')
assert_equal(self.nodes[3].z_gettotalbalance(1, True)['private'], '5.00')
assert_equal(Decimal(self.nodes[3].z_getbalance(sapling_addr)), Decimal('5') - fee)
assert_equal(Decimal(self.nodes[3].z_gettotalbalance()['private']), Decimal('0'))
assert_equal(Decimal(self.nodes[3].z_gettotalbalance(1, True)['private']), Decimal('5') - fee)
# Restart the nodes
stop_nodes(self.nodes)
@ -175,15 +175,14 @@ class WalletPersistenceTest (BitcoinTestFramework):
# Verify nullifiers persisted correctly by checking balance
# Prior to PR #3590, there will be an error as spent notes are considered unspent:
# Assertion failed: expected: <25.00000000> but was: <5>
assert_equal(self.nodes[2].z_getbalance(sapling_addr), Decimal('5'))
assert_equal(self.nodes[3].z_getbalance(sapling_addr), Decimal('5'))
assert_equal(self.nodes[3].z_gettotalbalance()['private'], '0.00')
assert_equal(self.nodes[3].z_gettotalbalance(1, True)['private'], '5.00')
assert_equal(Decimal(self.nodes[2].z_getbalance(sapling_addr)), Decimal('5') - fee)
assert_equal(Decimal(self.nodes[3].z_getbalance(sapling_addr)), Decimal('5') - fee)
assert_equal(Decimal(self.nodes[3].z_gettotalbalance()['private']), Decimal('0'))
assert_equal(Decimal(self.nodes[3].z_gettotalbalance(1, True)['private']), Decimal('5') - fee)
# Verity witnesses persisted correctly by sending shielded funds
recipients = []
recipients.append({"address": dest_addr, "amount": Decimal('1')})
myopid = self.nodes[2].z_sendmany(sapling_addr, recipients, 1, 0)
recipients = [{"address": dest_addr, "amount": Decimal('1')}]
myopid = self.nodes[2].z_sendmany(sapling_addr, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[2], myopid)
self.sync_all()
@ -191,8 +190,8 @@ class WalletPersistenceTest (BitcoinTestFramework):
self.sync_all()
# Verify balances
assert_equal(self.nodes[2].z_getbalance(sapling_addr), Decimal('4'))
assert_equal(self.nodes[1].z_getbalance(dest_addr), Decimal('16'))
assert_equal(Decimal(self.nodes[2].z_getbalance(sapling_addr)), Decimal('4') - 2*fee)
assert_equal(Decimal(self.nodes[1].z_getbalance(dest_addr)), Decimal('16') - fee)
if __name__ == '__main__':
WalletPersistenceTest().main()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2018-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -9,8 +9,8 @@ from test_framework.util import (
get_coinbase_address,
start_nodes,
wait_and_assert_operationid_status,
LEGACY_DEFAULT_FEE
)
from test_framework.zip317 import ZIP_317_FEE, conventional_fee
from decimal import Decimal
@ -19,7 +19,6 @@ class WalletSaplingTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
@ -42,21 +41,21 @@ class WalletSaplingTest(BitcoinTestFramework):
assert_equal(self.nodes[0].z_validateaddress(saplingAddr1)['address_type'], 'sapling')
# Verify balance
assert_equal(self.nodes[0].z_getbalance(saplingAddr0), Decimal('0'))
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal('0'))
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('0'))
assert_equal(Decimal(self.nodes[0].z_getbalance(saplingAddr0)), Decimal('0'))
assert_equal(Decimal(self.nodes[1].z_getbalance(saplingAddr1)), Decimal('0'))
assert_equal(Decimal(self.nodes[1].z_getbalance(taddr1)), Decimal('0'))
# Node 0 shields some funds
# taddr -> Sapling
recipients = []
recipients.append({"address": saplingAddr0, "amount": Decimal('10')})
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
coinbase_fee = conventional_fee(3)
recipients = [{"address": saplingAddr0, "amount": Decimal('10') - coinbase_fee}]
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
# Shield another coinbase UTXO
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 0, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -64,16 +63,17 @@ class WalletSaplingTest(BitcoinTestFramework):
self.sync_all()
# Verify balance
assert_equal(self.nodes[0].z_getbalance(saplingAddr0), Decimal('20'))
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal('0'))
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('0'))
balance0 = Decimal('20') - 2 * coinbase_fee
assert_equal(Decimal(self.nodes[0].z_getbalance(saplingAddr0)), balance0)
assert_equal(Decimal(self.nodes[1].z_getbalance(saplingAddr1)), Decimal('0'))
assert_equal(Decimal(self.nodes[1].z_getbalance(taddr1)), Decimal('0'))
# Node 0 sends some shielded funds to node 1
# Sapling -> Sapling
# -> Sapling (change)
recipients = []
recipients.append({"address": saplingAddr1, "amount": Decimal('15')})
myopid = self.nodes[0].z_sendmany(saplingAddr0, recipients, 1, 0)
myopid = self.nodes[0].z_sendmany(saplingAddr0, recipients, 1, ZIP_317_FEE)
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -81,9 +81,11 @@ class WalletSaplingTest(BitcoinTestFramework):
self.sync_all()
# Verify balance
assert_equal(self.nodes[0].z_getbalance(saplingAddr0), Decimal('5'))
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal('15'))
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('0'))
balance1 = Decimal('15')
balance0 -= balance1 + conventional_fee(2)
assert_equal(Decimal(self.nodes[0].z_getbalance(saplingAddr0)), balance0)
assert_equal(Decimal(self.nodes[1].z_getbalance(saplingAddr1)), balance1)
assert_equal(Decimal(self.nodes[1].z_getbalance(taddr1)), Decimal('0'))
# Node 1 sends some shielded funds to node 0, as well as unshielding
# Sapling -> Sapling
@ -92,7 +94,7 @@ class WalletSaplingTest(BitcoinTestFramework):
recipients = []
recipients.append({"address": saplingAddr0, "amount": Decimal('5')})
recipients.append({"address": taddr1, "amount": Decimal('5')})
myopid = self.nodes[1].z_sendmany(saplingAddr1, recipients, 1, 0, 'AllowRevealedRecipients')
myopid = self.nodes[1].z_sendmany(saplingAddr1, recipients, 1, ZIP_317_FEE, 'AllowRevealedRecipients')
mytxid = wait_and_assert_operationid_status(self.nodes[1], myopid)
self.sync_all()
@ -100,13 +102,16 @@ class WalletSaplingTest(BitcoinTestFramework):
self.sync_all()
# Verify balance
assert_equal(self.nodes[0].z_getbalance(saplingAddr0), Decimal('10'))
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal('5'))
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('5'))
fee = conventional_fee(3)
balance0 += Decimal('5')
balance1 -= Decimal('10') + fee
assert_equal(Decimal(self.nodes[0].z_getbalance(saplingAddr0)), balance0)
assert_equal(Decimal(self.nodes[1].z_getbalance(saplingAddr1)), balance1)
assert_equal(Decimal(self.nodes[1].z_getbalance(taddr1)), Decimal('5'))
# Verify existence of Sapling related JSON fields
# Verify existence of Sapling-related JSON fields
resp = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(resp['valueBalance'], Decimal('5'))
assert_equal(resp['valueBalance'], Decimal('5') + fee)
assert(len(resp['vShieldedSpend']) == 1)
assert(len(resp['vShieldedOutput']) == 2)
assert('bindingSig' in resp)
@ -130,37 +135,38 @@ class WalletSaplingTest(BitcoinTestFramework):
saplingAddrInfo0 = self.nodes[2].z_importkey(sk0, "yes")
assert_equal(saplingAddrInfo0["address_type"], "sapling")
assert_equal(saplingAddrInfo0["address"], saplingAddr0)
assert_equal(self.nodes[2].z_getbalance(saplingAddrInfo0["address"]), Decimal('10'))
assert_equal(Decimal(self.nodes[2].z_getbalance(saplingAddrInfo0["address"])), balance0)
sk1 = self.nodes[1].z_exportkey(saplingAddr1)
saplingAddrInfo1 = self.nodes[2].z_importkey(sk1, "yes")
assert_equal(saplingAddrInfo1["address_type"], "sapling")
assert_equal(saplingAddrInfo1["address"], saplingAddr1)
assert_equal(self.nodes[2].z_getbalance(saplingAddrInfo1["address"]), Decimal('5'))
assert_equal(Decimal(self.nodes[2].z_getbalance(saplingAddrInfo1["address"])), balance1)
# Verify importing a viewing key will update the nullifiers and witnesses correctly
extfvk0 = self.nodes[0].z_exportviewingkey(saplingAddr0)
saplingAddrInfo0 = self.nodes[3].z_importviewingkey(extfvk0, "yes")
assert_equal(saplingAddrInfo0["address_type"], "sapling")
assert_equal(saplingAddrInfo0["address"], saplingAddr0)
assert_equal(self.nodes[3].z_getbalance(saplingAddrInfo0["address"]), Decimal('10'))
assert_equal(Decimal(self.nodes[3].z_getbalance(saplingAddrInfo0["address"])), balance0)
extfvk1 = self.nodes[1].z_exportviewingkey(saplingAddr1)
saplingAddrInfo1 = self.nodes[3].z_importviewingkey(extfvk1, "yes")
assert_equal(saplingAddrInfo1["address_type"], "sapling")
assert_equal(saplingAddrInfo1["address"], saplingAddr1)
assert_equal(self.nodes[3].z_getbalance(saplingAddrInfo1["address"]), Decimal('5'))
assert_equal(Decimal(self.nodes[3].z_getbalance(saplingAddrInfo1["address"])), balance1)
# Verify that z_gettotalbalance only includes watch-only addresses when requested
assert_equal(self.nodes[3].z_gettotalbalance()['private'], '0.00')
assert_equal(self.nodes[3].z_gettotalbalance(1, True)['private'], '15.00')
assert_equal(Decimal(self.nodes[3].z_gettotalbalance()['private']), Decimal('0.00'))
assert_equal(Decimal(self.nodes[3].z_gettotalbalance(1, True)['private']), balance0 + balance1)
# Make sure we get a useful error when trying to send to both sprout and sapling
node4_sproutaddr = self.nodes[3].z_getnewaddress('sprout')
node4_saplingaddr = self.nodes[3].z_getnewaddress('sapling')
fee = conventional_fee(5)
myopid = self.nodes[1].z_sendmany(
taddr1,
[{'address': node4_sproutaddr, 'amount': Decimal('2.5')},
{'address': node4_saplingaddr, 'amount': Decimal('2.5') - LEGACY_DEFAULT_FEE}],
1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'
{'address': node4_saplingaddr, 'amount': Decimal('2.5') - fee}],
1, fee, 'AllowRevealedSenders'
)
wait_and_assert_operationid_status(self.nodes[1], myopid, "failed", "Sending funds into the Sprout pool is no longer supported.")

View File

@ -1,11 +1,12 @@
#!/usr/bin/env python3
# Copyright (c) 2020 The Zcash developers
# Copyright (c) 2020-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
LEGACY_DEFAULT_FEE,
assert_equal,
assert_raises_message,
connect_nodes_bi,
@ -13,7 +14,7 @@ from test_framework.util import (
sync_blocks,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import ZIP_317_FEE
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
TX_EXPIRY_DELTA = 10
TX_EXPIRING_SOON_THRESHOLD = 3
@ -22,7 +23,6 @@ TX_EXPIRING_SOON_THRESHOLD = 3
class WalletSendManyAnyTaddr(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-txexpirydelta=%d' % TX_EXPIRY_DELTA,
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
@ -43,44 +43,42 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
node3taddr2 = self.nodes[3].getnewaddress()
# Prepare some non-coinbase UTXOs
fee = conventional_fee(27)
wait_and_assert_operationid_status(
self.nodes[3],
self.nodes[3].z_shieldcoinbase("*", node3zaddr, 0, None, None, 'AllowLinkingAccountAddresses')['opid'],
self.nodes[3].z_shieldcoinbase("*", node3zaddr, fee, None, None, 'AllowLinkingAccountAddresses')['opid'],
)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(self.nodes[3].z_getbalance(node3zaddr), 250)
assert_equal(Decimal(self.nodes[3].z_getbalance(node3zaddr)), Decimal('250') - fee)
wait_and_assert_operationid_status(
self.nodes[3],
self.nodes[3].z_sendmany(
node3zaddr,
[
{'address': node3taddr1, 'amount': 60},
{'address': node3taddr2, 'amount': 75},
{'address': node3taddr1, 'amount': Decimal('60')},
{'address': node3taddr2, 'amount': Decimal('75')},
],
1,
LEGACY_DEFAULT_FEE,
'AllowRevealedRecipients',
),
1, ZIP_317_FEE, 'AllowRevealedRecipients'),
)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
# Check the various balances.
assert_equal(self.nodes[1].z_getbalance(recipient), 0)
assert_equal(self.nodes[3].z_getbalance(node3taddr1), 60)
assert_equal(self.nodes[3].z_getbalance(node3taddr2), 75)
assert_equal(Decimal(self.nodes[1].z_getbalance(recipient)), Decimal('0'))
assert_equal(Decimal(self.nodes[3].z_getbalance(node3taddr1)), Decimal('60'))
assert_equal(Decimal(self.nodes[3].z_getbalance(node3taddr2)), Decimal('75'))
# We should be able to spend multiple UTXOs at once
wait_and_assert_operationid_status(
self.nodes[3],
self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 100}],
1, LEGACY_DEFAULT_FEE, 'NoPrivacy'),
[{'address': recipient, 'amount': Decimal('100')}],
1, ZIP_317_FEE, 'NoPrivacy'),
)
self.sync_all()
@ -88,19 +86,20 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
self.sync_all()
# The recipient has their funds!
assert_equal(self.nodes[1].z_getbalance(recipient), 100)
assert_equal(Decimal(self.nodes[1].z_getbalance(recipient)), Decimal('100'))
# Change is sent to a new t-address.
assert_equal(self.nodes[3].z_getbalance(node3taddr1), 0)
assert_equal(self.nodes[3].z_getbalance(node3taddr2), 0)
assert_equal(Decimal(self.nodes[3].z_getbalance(node3taddr1)), Decimal('0'))
assert_equal(Decimal(self.nodes[3].z_getbalance(node3taddr2)), Decimal('0'))
# Send from a change t-address.
fee = conventional_fee(3)
wait_and_assert_operationid_status(
self.nodes[3],
self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 20}],
1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent'),
[{'address': recipient, 'amount': Decimal('20')}],
1, fee, 'AllowFullyTransparent'),
)
self.sync_all()
@ -108,18 +107,23 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
self.sync_all()
# The recipient has their funds!
assert_equal(self.nodes[1].z_getbalance(recipient), 120)
assert_equal(Decimal(self.nodes[1].z_getbalance(recipient)), Decimal('120'))
# Check that ANY_TADDR note selection doesn't attempt a double-spend
myopid = self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 20}],
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.")
[{'address': recipient, 'amount': Decimal('20') - fee}],
1, fee, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(self.nodes[3], myopid, "failed", "Insufficient funds: have 14.99965, need 20.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.")
# Create an expired transaction on node 3.
# Create a transaction that will expire on node 3.
self.split_network()
expire_transparent = self.nodes[3].sendtoaddress(node2taddr1, 14)
myopid = self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': node2taddr1, 'amount': Decimal('14')}],
1, ZIP_317_FEE, 'AllowFullyTransparent')
expire_transparent = wait_and_assert_operationid_status(self.nodes[3], myopid)
assert(expire_transparent in self.nodes[3].getrawmempool())
self.sync_all()
assert_equal('waiting', self.nodes[2].gettransaction(expire_transparent)['status'])
@ -133,26 +137,27 @@ 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",
assert_raises_message(AssertionError, "tx unpaid action limit exceeded: 50 action(s) exceeds limit of 0",
wait_and_assert_operationid_status,
self.nodes[2],
self.nodes[2].z_shieldcoinbase("*", node2zaddr, 0, None, None, 'AllowLinkingAccountAddresses')['opid'],
self.nodes[2].z_shieldcoinbase("*", node2zaddr, conventional_fee(2), None, None, 'AllowLinkingAccountAddresses')['opid'],
)
wait_and_assert_operationid_status(
self.nodes[2],
self.nodes[2].z_shieldcoinbase("*", node2zaddr, ZIP_317_FEE, None, None, 'AllowLinkingAccountAddresses')['opid'],
)
self.sync_all()
assert_equal(0, self.nodes[2].getbalance())
assert_equal(Decimal('0'), Decimal(self.nodes[2].getbalance()))
# Check that ANY_TADDR doesn't select an expired output.
fee = conventional_fee(3)
wait_and_assert_operationid_status(
self.nodes[2],
self.nodes[2].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 13}],
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.)")
[{'address': recipient, 'amount': Decimal('13') - fee}],
1, fee, 'AllowRevealedSenders'),
"failed", "Insufficient funds: have 0.00, need 13.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.)")
if __name__ == '__main__':
WalletSendManyAnyTaddr().main()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The Zcash developers
# Copyright (c) 2017-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -20,7 +20,6 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
def setup_network(self, split=False):
args = [
'-minrelaytxfee=0',
'-regtestprotectcoinbase',
'-debug=zrpcunsafe',
nuparams(NU5_BRANCH_ID, self.nu5_activation),
@ -45,8 +44,8 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
self.nodes[0].generate(4)
self.sync_all()
walletinfo = self.nodes[0].getwalletinfo()
assert_equal(walletinfo['immature_balance'], 50)
assert_equal(walletinfo['balance'], 0)
assert_equal(Decimal(walletinfo['immature_balance']), Decimal('50'))
assert_equal(Decimal(walletinfo['balance']), Decimal('0'))
self.sync_all()
self.nodes[2].generate(1)
self.nodes[2].generate(1)
@ -54,9 +53,9 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
self.sync_all()
self.nodes[1].generate(101)
self.sync_all()
assert_equal(self.nodes[0].getbalance(), 50)
assert_equal(self.nodes[1].getbalance(), 10)
assert_equal(self.nodes[2].getbalance(), 30)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('50'))
assert_equal(Decimal(self.nodes[1].getbalance()), Decimal('10'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('30'))
# create one zaddr that is the target of all shielding
myzaddr = self.test_init_zaddr(self.nodes[0])
@ -102,31 +101,33 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
errorString = e.error['message']
assert_equal("JSON integer out of range" in errorString, True)
# Shield coinbase utxos from node 0 of value 40, standard fee
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr)
# Shield coinbase utxos from node 0 of value 40
fee = conventional_fee(6)
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, fee)
wait_and_assert_operationid_status(self.nodes[0], result['opid'])
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
# 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(6))
assert_equal(self.nodes[1].getbalance(), 20)
assert_equal(self.nodes[2].getbalance(), 30)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('10'))
assert_equal(Decimal(self.nodes[0].z_getbalance(do_not_shield_taddr)), Decimal('10'))
self.test_check_balance_zaddr(self.nodes[0], Decimal('40') - fee)
assert_equal(Decimal(self.nodes[1].getbalance()), Decimal('20'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('30'))
# Shield coinbase utxos from any node 2 taddr, and set fee to 0
result = self.nodes[2].z_shieldcoinbase("*", myzaddr, 0, None, None, 'AllowLinkingAccountAddresses')
# Shield coinbase utxos from any node 2 taddr
fee2 = conventional_fee(5)
result = self.nodes[2].z_shieldcoinbase("*", myzaddr, fee2, 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(6))
assert_equal(self.nodes[1].getbalance(), 30)
assert_equal(self.nodes[2].getbalance(), 0)
assert_equal(Decimal(self.nodes[0].getbalance()), Decimal('10'))
self.test_check_balance_zaddr(self.nodes[0], Decimal('70') - fee - fee2)
assert_equal(Decimal(self.nodes[1].getbalance()), Decimal('30'))
assert_equal(Decimal(self.nodes[2].getbalance()), Decimal('0'))
# Generate 800 coinbase utxos on node 0, and 20 coinbase utxos on node 2
self.nodes[0].generate(800)
@ -139,17 +140,17 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
def verify_locking(first, second, 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))
assert_equal(Decimal(result["shieldingUTXOs"]), Decimal(first))
assert_equal(Decimal(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, ZIP_317_FEE, 0)
assert_equal(result["shieldingValue"], Decimal(remainingValue))
assert_equal(result["shieldingUTXOs"], Decimal(second))
assert_equal(result["remainingValue"], Decimal('0'))
assert_equal(result["remainingUTXOs"], Decimal('0'))
assert_equal(Decimal(result["shieldingValue"]), Decimal(remainingValue))
assert_equal(Decimal(result["shieldingUTXOs"]), Decimal(second))
assert_equal(Decimal(result["remainingValue"]), Decimal('0'))
assert_equal(Decimal(result["remainingUTXOs"]), Decimal('0'))
opid2 = result['opid']
# wait for both async operations to complete
@ -172,14 +173,14 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
self.sync_all()
mytaddr = get_coinbase_address(self.nodes[0], 100)
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'))
assert_equal(Decimal(result["shieldingUTXOs"]), Decimal('50'))
assert_equal(Decimal(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, ZIP_317_FEE, 33, None)
assert_equal(result["shieldingUTXOs"], Decimal('33'))
assert_equal(result["remainingUTXOs"], Decimal('17'))
assert_equal(Decimal(result["shieldingUTXOs"]), Decimal('33'))
assert_equal(Decimal(result["remainingUTXOs"]), Decimal('17'))
wait_and_assert_operationid_status(self.nodes[0], result['opid'])
# Don't sync node 2 which rejects the tx due to its mempooltxinputlimit
sync_blocks(self.nodes[:2])

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2016 The Zcash developers
# Copyright (c) 2016-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
@ -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, LEGACY_DEFAULT_FEE
check_node_log
from test_framework.zip317 import conventional_fee, WEIGHT_RATIO_CAP, ZIP_317_FEE
import sys
@ -36,7 +36,6 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# Start nodes with -regtestshieldcoinbase to set fCoinbaseMustBeShielded to true.
def setup_network(self, split=False):
self.nodes = start_nodes(4, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-regtestshieldcoinbase',
'-debug=zrpcunsafe',
'-allowdeprecated=getnewaddress',
@ -91,7 +90,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# Node 3 will test that watch only address utxos are not selected
self.nodes[3].importaddress(mytaddr)
recipients= [{"address":myzaddr, "amount": Decimal('1')}]
recipients= [{"address": myzaddr, "amount": Decimal('1')}]
try:
myopid = self.nodes[3].z_sendmany(mytaddr, recipients)
except JSONRPCException as e:
@ -103,20 +102,20 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# TODO: After upgrading to unified address support, change will be sent to the most
# recent shielded spend authority corresponding to the account of the source address
# and this send will succeed, causing this test to fail.
recipients = []
recipients.append({"address":myzaddr, "amount":Decimal('1.23456789')})
fee = conventional_fee(2)
recipients = [{"address": myzaddr, "amount": Decimal('1.23456789')}]
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, fee, 'AllowFullyTransparent')
error_result = wait_and_assert_operationid_status_result(
self.nodes[0],
myopid, "failed",
"When shielding coinbase funds, the wallet does not allow any change. The proposed transaction would result in 8.76542211 in change.",
"When shielding coinbase funds, the wallet does not allow any change. The proposed transaction would result in 8.76533211 in change.",
10)
# 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"], LEGACY_DEFAULT_FEE) # default
assert_equal(params["fee"], fee)
assert_equal(params["minconf"], Decimal('10')) # default
assert_equal(params["fromaddress"], mytaddr)
assert_equal(params["amounts"][0]["address"], myzaddr)
@ -126,12 +125,11 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
myviewingkey = self.nodes[0].z_exportviewingkey(myzaddr)
self.nodes[3].z_importviewingkey(myviewingkey, "no")
# 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') - LEGACY_DEFAULT_FEE
recipients = []
recipients.append({"address":myzaddr, "amount": shieldvalue})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
# This send will succeed. We send two coinbase utxos totalling 20.0 less fee, with no change.
fee = conventional_fee(4)
shieldvalue = Decimal('20.0') - fee
recipients = [{"address": myzaddr, "amount": shieldvalue}]
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, fee, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -191,9 +189,10 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# A custom fee of 0 is okay. Here the node will send the note value back to itself.
# (This tx fits within the block unpaid action limit.)
recipients = []
recipients.append({"address":myzaddr, "amount": saplingvalue})
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, Decimal('0.0'))
fee = conventional_fee(2)
saplingvalue -= fee
recipients = [{"address": myzaddr, "amount": saplingvalue}]
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, fee)
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
@ -207,10 +206,10 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
check_value_pool(self.nodes[0], 'sapling', saplingvalue)
# convert note to transparent funds
fee = conventional_fee(3)
unshieldvalue = Decimal('10.0')
recipients = []
recipients.append({"address":mytaddr, "amount": unshieldvalue})
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
recipients = [{"address": mytaddr, "amount": unshieldvalue}]
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, fee, 'AllowRevealedRecipients')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
assert(mytxid is not None)
@ -219,7 +218,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
self.sync_all()
# check balances
saplingvalue -= unshieldvalue + LEGACY_DEFAULT_FEE
saplingvalue -= unshieldvalue + fee
resp = self.nodes[0].z_gettotalbalance()
assert_equal(Decimal(resp["transparent"]), Decimal('30.0'))
assert_equal(Decimal(resp["private"]), saplingvalue)
@ -229,10 +228,10 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# z_sendmany will return an error if there is transparent change output considered dust.
# UTXO selection in z_sendmany sorts in ascending order, so smallest utxos are consumed first.
# At this point in time, unspent notes all have a value of 10.0.
recipients = []
amount = Decimal('10.0') - conventional_fee(2) - Decimal('0.00000001') # this leaves change at 1 zatoshi less than dust threshold
recipients.append({"address":self.nodes[0].getnewaddress(), "amount":amount })
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1)
fee = conventional_fee(2)
amount = Decimal('10.0') - fee - Decimal('0.00000001') # this leaves change at 1 zatoshi less than dust threshold
recipients = [{"address": self.nodes[0].getnewaddress(), "amount": amount}]
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient funds: have 10.00, need 0.00000053 more to avoid creating invalid change output 0.00000001 (dust threshold is 0.00000054); 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 send amount is too big, even when including coinbase utxos
@ -244,12 +243,11 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
assert_equal("Insufficient funds" in errorString, True)
# z_sendmany will fail because of insufficient funds
recipients = []
recipients.append({"address":self.nodes[1].getnewaddress(), "amount":Decimal('10000.0')})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1)
recipients = [{"address": self.nodes[1].getnewaddress(), "amount": Decimal('10000.0')}]
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, fee)
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, 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.")
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient funds: have 9.99955, 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.")
# Send will fail because of insufficient funds unless sender uses coinbase utxos
try:
@ -268,7 +266,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
start_time = timeit.default_timer()
for i in range(0,num_t_recipients):
newtaddr = self.nodes[2].getnewaddress()
recipients.append({"address":newtaddr, "amount":amount_per_recipient})
recipients.append({"address": newtaddr, "amount": amount_per_recipient})
elapsed = timeit.default_timer() - start_time
print("...invoked getnewaddress() {} times in {} seconds".format(num_t_recipients, elapsed))
@ -343,11 +341,13 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
amount_per_recipient = Decimal('0.002')
minconf = 1
send_amount = num_recipients * amount_per_recipient
custom_fee = Decimal('0.00012345')
custom_fee = Decimal('0.00023456')
assert custom_fee >= conventional_fee(4)
zbalance = self.nodes[0].z_getbalance(myzaddr)
for i in range(0,num_recipients):
for i in range(0, num_recipients):
newzaddr = self.nodes[2].z_getnewaddress('sapling')
recipients.append({"address":newzaddr, "amount":amount_per_recipient})
recipients.append({"address": newzaddr, "amount": amount_per_recipient})
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, minconf, custom_fee)
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()

View File

@ -1,12 +1,12 @@
#!/usr/bin/env python3
# Copyright (c) 2016 The Zcash developers
# Copyright (c) 2016-2024 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 assert_equal, initialize_chain_clean, \
start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \
get_coinbase_address, LEGACY_DEFAULT_FEE
get_coinbase_address
from test_framework.zip317 import conventional_fee
import time
@ -21,7 +21,6 @@ class WalletTreeStateTest (BitcoinTestFramework):
# Start nodes with -regtestshieldcoinbase to set fCoinbaseMustBeShielded to true.
def setup_network(self, split=False):
self.nodes = start_nodes(3, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-regtestshieldcoinbase',
'-debug=zrpc',
'-allowdeprecated=z_getnewaddress',
@ -45,19 +44,20 @@ class WalletTreeStateTest (BitcoinTestFramework):
myzaddr = self.nodes[0].z_getnewaddress()
# Spend coinbase utxos to create three notes of 10 ZEC minus default fee each
recipients = []
recipients.append({"address": myzaddr, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
fee = conventional_fee(3)
amount = Decimal('10.0') - fee
recipients = [{"address": myzaddr, "amount": amount}]
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, 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, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, 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, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
@ -65,24 +65,25 @@ class WalletTreeStateTest (BitcoinTestFramework):
# Check balance
resp = self.nodes[0].z_getbalance(myzaddr)
assert_equal(Decimal(resp), (Decimal('10.0') - LEGACY_DEFAULT_FEE) * 3)
assert_equal(Decimal(resp), amount * 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,
# which result in the treestate changing whilst creating the transaction.
# 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') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
fee = conventional_fee(3)
amount = Decimal('10.0') - fee
recipients = [{"address": self.nodes[2].z_getnewaddress(), "amount": amount}]
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, 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
# the z_sendmany implementation because there are only two inputs per joinsplit.
recipients = []
recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('18.0')})
recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('12.0') - 4 * conventional_fee(3)})
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1)
recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('12.0') - 4*fee})
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, fee)
# Wait for Tx 2 to begin executing...
for x in range(1, 60):

View File

@ -1,12 +1,11 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Copyright (c) 2022-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
assert_equal,
get_coinbase_address,
@ -14,6 +13,8 @@ from test_framework.util import (
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.mininode import COIN
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
# Test wallet accounts behaviour
class WalletUnifiedChangeTest(BitcoinTestFramework):
@ -23,7 +24,6 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 201),
]] * self.num_nodes)
@ -42,12 +42,14 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
ua1 = self.nodes[1].z_getaddressforaccount(account1)['address']
# 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, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
fee = conventional_fee(3)
amount = Decimal('10') - fee
recipients = [{'address': ua0_sapling, 'amount': amount}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, 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, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
recipients = [{'address': ua0_orchard, 'amount': amount}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
@ -55,18 +57,18 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
self.sync_all()
assert_equal(
{'pools': {'sapling': {'valueZat': 999999000}, 'orchard': {'valueZat': 999999000}}, 'minimum_confirmations': 1},
{'pools': {'sapling': {'valueZat': amount * COIN}, 'orchard': {'valueZat': amount * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(account0))
# Send both amounts to ua1 in fully-shielded transactions. This will result
# in account1 having both Sapling and Orchard balances.
recipients = [{'address': ua1_sapling, 'amount': 5}]
opid = self.nodes[0].z_sendmany(ua0_sapling, recipients, 1, LEGACY_DEFAULT_FEE)
opid = self.nodes[0].z_sendmany(ua0_sapling, recipients, 1, ZIP_317_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, LEGACY_DEFAULT_FEE)
opid = self.nodes[0].z_sendmany(ua0_orchard, recipients, 1, ZIP_317_FEE)
txid_orchard = wait_and_assert_operationid_status(self.nodes[0], opid)
assert_equal(set([txid_sapling, txid_orchard]), set(self.nodes[0].getrawmempool()))
@ -79,13 +81,15 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
assert_equal(1, self.nodes[0].gettransaction(txid_orchard)['confirmations'])
assert_equal(1, self.nodes[0].gettransaction(txid_sapling)['confirmations'])
assert_equal(
{'pools': {'sapling': {'valueZat': 500000000}, 'orchard': {'valueZat': 500000000}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(account1))
assert_equal({
'pools': {'sapling': {'valueZat': 500000000}, 'orchard': {'valueZat': 500000000}},
'minimum_confirmations': 1,
}, self.nodes[1].z_getbalanceforaccount(account1))
# Now send sapling->sapling, generating change.
recipients = [{'address': ua0_sapling, 'amount': Decimal('2.5')}]
opid = self.nodes[1].z_sendmany(ua1_sapling, recipients, 1, 0)
fee = conventional_fee(2)
opid = self.nodes[1].z_sendmany(ua1_sapling, recipients, 1, fee)
txid_sapling = wait_and_assert_operationid_status(self.nodes[1], opid)
self.sync_all()
@ -94,23 +98,25 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
# Since this is entirely sapling->sapling, change should be returned
# to the Sapling pool.
assert_equal(
{'pools': {'sapling': {'valueZat': 250000000}, 'orchard': {'valueZat': 500000000}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(account1))
assert_equal({
'pools': {'sapling': {'valueZat': 250000000 - fee*COIN}, 'orchard': {'valueZat': 500000000}},
'minimum_confirmations': 1,
}, self.nodes[1].z_getbalanceforaccount(account1))
# If we send from an unrestricted UA, change should still not cross
# the pool boundary, since we can build a purely sapling->sapling tx.
recipients = [{'address': ua0_sapling, 'amount': Decimal('1.25')}]
opid = self.nodes[1].z_sendmany(ua1, recipients, 1, 0)
opid = self.nodes[1].z_sendmany(ua1, recipients, 1, fee)
txid_sapling = wait_and_assert_operationid_status(self.nodes[1], opid)
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
assert_equal(
{'pools': {'sapling': {'valueZat': 125000000}, 'orchard': {'valueZat': 500000000}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(account1))
assert_equal({
'pools': {'sapling': {'valueZat': 125000000 - 2*fee*COIN}, 'orchard': {'valueZat': 500000000}},
'minimum_confirmations': 1,
}, self.nodes[1].z_getbalanceforaccount(account1))
if __name__ == '__main__':
WalletUnifiedChangeTest().main()

View File

@ -1,11 +1,10 @@
#!/usr/bin/env python3
# Copyright (c) 2020 The Zcash developers
# Copyright (c) 2020-2024 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 (
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
assert_equal,
assert_greater_than,
@ -18,6 +17,8 @@ from test_framework.util import (
)
from test_framework.authproxy import JSONRPCException
from test_framework.mininode import COIN
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
from decimal import Decimal
# Test wallet address behaviour across network upgrades
@ -28,7 +29,6 @@ class WalletZSendmanyTest(BitcoinTestFramework):
def setup_network(self, split=False):
self.nodes = start_nodes(3, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
nuparams(NU5_BRANCH_ID, 238),
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
@ -41,7 +41,7 @@ class WalletZSendmanyTest(BitcoinTestFramework):
self.is_network_split=False
self.sync_all()
# Check we only have balances in the expected pools.
# Check that an account has expected balances in only the expected pools.
# Remember that empty pools are omitted from the output.
def _check_balance_for_rpc(self, rpcmethod, node, account, expected, minconf):
rpc = getattr(self.nodes[node], rpcmethod)
@ -54,6 +54,8 @@ class WalletZSendmanyTest(BitcoinTestFramework):
assert_equal(actual['minimum_confirmations'], minconf)
return total_balance
# Check that an account has expected balances in only the expected pools, and that
# they are held only in `address`.
def check_balance(self, node, account, address, expected, minconf=1):
acct_balance = self._check_balance_for_rpc('z_getbalanceforaccount', node, account, expected, minconf)
z_getbalance = self.nodes[node].z_getbalance(address, minconf)
@ -63,86 +65,76 @@ class WalletZSendmanyTest(BitcoinTestFramework):
def run_test(self):
# z_sendmany is expected to fail if tx size breaks limit
myzaddr = self.nodes[0].z_getnewaddress()
n0sapling = self.nodes[0].z_getnewaddress()
recipients = []
num_t_recipients = 1000
num_z_recipients = 2100
amount_per_recipient = Decimal('0.00000001')
errorString = ''
for i in range(0,num_t_recipients):
for i in range(0, num_t_recipients):
newtaddr = self.nodes[2].getnewaddress()
recipients.append({"address":newtaddr, "amount":amount_per_recipient})
for i in range(0,num_z_recipients):
recipients.append({"address": newtaddr, "amount": amount_per_recipient})
for i in range(0, num_z_recipients):
newzaddr = self.nodes[2].z_getnewaddress()
recipients.append({"address":newzaddr, "amount":amount_per_recipient})
# Issue #2759 Workaround START
# HTTP connection to node 0 may fall into a state, during the few minutes it takes to process
# loop above to create new addresses, that when z_sendmany is called with a large amount of
# rpc data in recipients, the connection fails with a 'broken pipe' error. Making a RPC call
# to node 0 before calling z_sendmany appears to fix this issue, perhaps putting the HTTP
# connection into a good state to handle a large amount of data in recipients.
self.nodes[0].getinfo()
# Issue #2759 Workaround END
recipients.append({"address": newzaddr, "amount": amount_per_recipient})
try:
self.nodes[0].z_sendmany(myzaddr, recipients)
self.nodes[0].z_sendmany(n0sapling, recipients)
except JSONRPCException as e:
errorString = e.error['message']
assert("size of raw transaction would be larger than limit" in errorString)
# add zaddr to node 2
myzaddr = self.nodes[2].z_getnewaddress()
n2saddr = self.nodes[2].z_getnewaddress()
# add taddr to node 2
mytaddr = self.nodes[2].getnewaddress()
n2taddr = self.nodes[2].getnewaddress()
# send from node 0 to node 2 taddr
mytxid = self.nodes[0].sendtoaddress(mytaddr, 10.0)
mytxid = self.nodes[0].sendtoaddress(n2taddr, Decimal('10'))
self.sync_all()
self.nodes[0].generate(10)
self.sync_all()
# send node 2 taddr to zaddr
recipients = []
recipients.append({"address":myzaddr, "amount":7})
opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
zsendmanynotevalue = Decimal('7.0')
fee = conventional_fee(3)
recipients = [{"address": n2saddr, "amount": zsendmanynotevalue}]
opid = self.nodes[2].z_sendmany(n2taddr, recipients, 1, fee, 'AllowFullyTransparent')
mytxid = wait_and_assert_operationid_status(self.nodes[2], opid)
self.sync_all()
# check balances
zsendmanynotevalue = Decimal('7.0')
zsendmanyfee = LEGACY_DEFAULT_FEE
node2sproutbalance = Decimal('50.00000000')
node2utxobalance = Decimal('210.00000000') - zsendmanynotevalue - zsendmanyfee
n2sprout_balance = Decimal('50.00000000')
# check shielded balance status with getwalletinfo
wallet_info = self.nodes[2].getwalletinfo()
assert_equal(Decimal(wallet_info["shielded_unconfirmed_balance"]), zsendmanynotevalue)
assert_equal(Decimal(wallet_info["shielded_balance"]), node2sproutbalance)
assert_equal(Decimal(wallet_info["shielded_balance"]), n2sprout_balance)
self.nodes[2].generate(10)
self.sync_all()
assert_equal(self.nodes[2].getbalance(), node2utxobalance)
assert_equal(self.nodes[2].getbalance("*"), node2utxobalance)
n0t_balance = self.nodes[0].getbalance()
n2t_balance = Decimal('210.00000000') - zsendmanynotevalue - fee
assert_equal(Decimal(self.nodes[2].getbalance()), n2t_balance)
assert_equal(Decimal(self.nodes[2].getbalance("*")), n2t_balance)
# check zaddr balance with z_getbalance
zbalance = zsendmanynotevalue
assert_equal(self.nodes[2].z_getbalance(myzaddr), zbalance)
n2saddr_balance = zsendmanynotevalue
assert_equal(self.nodes[2].z_getbalance(n2saddr), n2saddr_balance)
# check via z_gettotalbalance
resp = self.nodes[2].z_gettotalbalance()
assert_equal(Decimal(resp["transparent"]), node2utxobalance)
assert_equal(Decimal(resp["private"]), node2sproutbalance + zbalance)
assert_equal(Decimal(resp["total"]), node2utxobalance + node2sproutbalance + zbalance)
assert_equal(Decimal(resp["transparent"]), n2t_balance)
assert_equal(Decimal(resp["private"]), n2sprout_balance + n2saddr_balance)
assert_equal(Decimal(resp["total"]), n2t_balance + n2sprout_balance + n2saddr_balance)
# check confirmed shielded balance with getwalletinfo
wallet_info = self.nodes[2].getwalletinfo()
assert_equal(Decimal(wallet_info["shielded_unconfirmed_balance"]), Decimal('0.0'))
assert_equal(Decimal(wallet_info["shielded_balance"]), node2sproutbalance + zsendmanynotevalue)
assert_equal(Decimal(wallet_info["shielded_balance"]), n2sprout_balance + n2saddr_balance)
# there should be at least one Sapling output
mytxdetails = self.nodes[2].getrawtransaction(mytxid, 1)
@ -150,53 +142,51 @@ class WalletZSendmanyTest(BitcoinTestFramework):
# the Sapling output should take in all the public value
assert_equal(mytxdetails["valueBalance"], -zsendmanynotevalue)
# send from private note to node 0 and node 2
node0balance = self.nodes[0].getbalance()
# The following assertion fails nondeterministically
# assert_equal(node0balance, Decimal('25.99798873'))
node2balance = self.nodes[2].getbalance()
# The following assertion might fail nondeterministically
# assert_equal(node2balance, Decimal('16.99799000'))
# 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, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
recipients = [{"address": self.nodes[0].getnewaddress(), "amount": Decimal('1'), "memo": "DEADBEEF"}]
opid = self.nodes[2].z_sendmany(n2saddr, recipients, 1, ZIP_317_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})
fee = conventional_fee(4)
recipients = [
{"address": self.nodes[0].getnewaddress(), "amount": Decimal('1')},
{"address": self.nodes[2].getnewaddress(), "amount": Decimal('1')},
];
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
opid = self.nodes[2].z_sendmany(n2saddr, recipients, 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[2], opid)
zbalance -= Decimal('2.0') + zsendmanyfee
n2saddr_balance -= Decimal('2') + fee
n0t_balance += Decimal('1')
n2t_balance += Decimal('1')
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
n0t_balance += Decimal('10') # newly mature
node0balance += Decimal('11.0')
node2balance += Decimal('1.0')
assert_equal(Decimal(self.nodes[0].getbalance()), node0balance)
assert_equal(Decimal(self.nodes[0].getbalance("*")), node0balance)
assert_equal(Decimal(self.nodes[2].getbalance()), node2balance)
assert_equal(Decimal(self.nodes[2].getbalance("*")), node2balance)
assert_equal(Decimal(self.nodes[0].getbalance()), n0t_balance)
assert_equal(Decimal(self.nodes[0].getbalance("*")), n0t_balance)
assert_equal(Decimal(self.nodes[2].getbalance()), n2t_balance)
assert_equal(Decimal(self.nodes[2].getbalance("*")), n2t_balance)
assert_equal(self.nodes[2].z_getbalance(n2saddr), n2saddr_balance)
# Get a new unified account on node 2 & generate a UA
n0account0 = self.nodes[0].z_getnewaccount()['account']
n0ua0 = self.nodes[0].z_getaddressforaccount(n0account0)['address']
# Get a new unified account on node 0 & generate a UA
n0account = self.nodes[0].z_getnewaccount()['account']
n0ua0 = self.nodes[0].z_getaddressforaccount(n0account)['address']
n0ua0_balance = Decimal('0')
self.check_balance(0, 0, n0ua0, {})
# Prepare to fund the UA from coinbase
source = get_coinbase_address(self.nodes[2])
recipients = []
recipients.append({"address":n0ua0, "amount":10})
fee = conventional_fee(3)
recipients = [{"address": n0ua0, "amount": Decimal('10') - fee}]
# If we attempt to spend with the default privacy policy, z_sendmany
# fails because it needs to spend transparent coins in a transaction
# involving a Unified Address.
unified_address_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.'
revealed_senders_msg = 'Insufficient funds: have 0.00, need 10.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.'
opid = self.nodes[2].z_sendmany(source, recipients, 1, 0)
opid = self.nodes[2].z_sendmany(source, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[2], opid, 'failed', unified_address_msg)
# We can't create a transaction with an unknown privacy policy.
@ -204,7 +194,7 @@ class WalletZSendmanyTest(BitcoinTestFramework):
JSONRPCException,
'Unknown privacy policy name \'ZcashIsAwesome\'',
self.nodes[2].z_sendmany,
source, recipients, 1, 0, 'ZcashIsAwesome')
source, recipients, 1, fee, 'ZcashIsAwesome')
# If we set any policy that does not include AllowRevealedSenders,
# z_sendmany also fails.
@ -213,31 +203,33 @@ class WalletZSendmanyTest(BitcoinTestFramework):
('AllowRevealedAmounts', revealed_senders_msg),
('AllowRevealedRecipients', revealed_senders_msg),
]:
opid = self.nodes[2].z_sendmany(source, recipients, 1, 0, policy)
opid = self.nodes[2].z_sendmany(source, recipients, 1, fee, policy)
wait_and_assert_operationid_status(self.nodes[2], opid, 'failed', msg)
# By setting the correct policy, we can create the transaction.
opid = self.nodes[2].z_sendmany(source, recipients, 1, 0, 'AllowRevealedSenders')
opid = self.nodes[2].z_sendmany(source, recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[2], opid)
n2t_balance -= Decimal('10.0')
n0ua0_balance += Decimal('10') - fee
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
n0t_balance += Decimal('10.0') # newly mature
node2balance -= Decimal('10.0')
node0balance += Decimal('10.0')
assert_equal(Decimal(self.nodes[2].getbalance()), node2balance)
assert_equal(Decimal(self.nodes[0].getbalance()), node0balance)
self.check_balance(0, 0, n0ua0, {'sapling': 10})
self.check_balance(0, 0, n0ua0, {'sapling': n0ua0_balance})
assert_equal(Decimal(self.nodes[0].getbalance()), n0t_balance)
assert_equal(Decimal(self.nodes[2].getbalance()), n2t_balance)
# Send some funds to a specific legacy taddr that we can spend from
recipients = []
recipients.append({"address":mytaddr, "amount":5})
fee = conventional_fee(3)
recipients = [{"address": n2taddr, "amount": Decimal('5')}]
# If we attempt to spend with the default privacy policy, z_sendmany
# returns an error because it needs to create a transparent recipient in
# a transaction involving a Unified Address.
revealed_recipients_msg = "This transaction would have transparent recipients, which is not enabled by default because it will publicly reveal transaction recipients and amounts. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowRevealedRecipients` or weaker if you wish to allow this transaction to proceed anyway."
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, 0)
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[0], opid, 'failed', revealed_recipients_msg)
# If we set any policy that does not include AllowRevealedRecipients,
@ -248,60 +240,68 @@ class WalletZSendmanyTest(BitcoinTestFramework):
'AllowRevealedSenders',
'AllowLinkingAccountAddresses',
]:
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, 0, policy)
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, fee, policy)
wait_and_assert_operationid_status(self.nodes[0], opid, 'failed', revealed_recipients_msg)
# By setting the correct policy, we can create the transaction.
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, 0, 'AllowRevealedRecipients')
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, fee, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], opid)
n2t_balance += Decimal('5')
n0ua0_balance -= Decimal('5') + fee
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
node2balance += Decimal('5.0')
self.check_balance(0, 0, n0ua0, {'sapling': 5})
assert_equal(Decimal(self.nodes[2].getbalance()), node2balance)
self.check_balance(0, 0, n0ua0, {'sapling': n0ua0_balance})
assert_equal(Decimal(self.nodes[2].getbalance()), n2t_balance)
# Send some funds to a legacy sapling address that we can spend from
recipients = []
recipients.append({"address":myzaddr, "amount":3})
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, 0)
fee = conventional_fee(2)
recipients = [{"address": n2saddr, "amount": Decimal('3')}]
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[0], opid)
n2saddr_balance += Decimal('3')
n0ua0_balance -= Decimal('3') + fee
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
zbalance += Decimal('3.0')
self.check_balance(0, 0, n0ua0, {'sapling': 2})
assert_equal(Decimal(self.nodes[2].z_getbalance(myzaddr)), zbalance)
self.check_balance(0, 0, n0ua0, {'sapling': n0ua0_balance})
assert_equal(self.nodes[2].z_getbalance(n2saddr), n2saddr_balance)
# Send funds back from the legacy taddr to the UA. This requires
# AllowRevealedSenders, but we can also use any weaker policy that
# includes it.
recipients = []
recipients.append({"address":n0ua0, "amount":4})
opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, 0, 'AllowFullyTransparent')
fee = conventional_fee(3)
recipients = [{"address": n0ua0, "amount": Decimal('4')}]
opid = self.nodes[2].z_sendmany(n2taddr, recipients, 1, fee, 'AllowFullyTransparent')
wait_and_assert_operationid_status(self.nodes[2], opid)
n0ua0_balance += Decimal('4')
n2t_balance -= Decimal('4') + fee
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
node2balance -= Decimal('4.0')
self.check_balance(0, 0, n0ua0, {'sapling': 6})
assert_equal(Decimal(self.nodes[2].getbalance()), node2balance)
self.check_balance(0, 0, n0ua0, {'sapling': n0ua0_balance})
assert_equal(Decimal(self.nodes[2].getbalance()), n2t_balance)
# Send funds back from the legacy zaddr to the UA
recipients = []
recipients.append({"address":n0ua0, "amount":2})
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, 0)
fee = conventional_fee(2)
recipients = [{"address": n0ua0, "amount": Decimal('2')}]
opid = self.nodes[2].z_sendmany(n2saddr, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[2], opid)
n0ua0_balance += Decimal('2')
n2saddr_balance -= Decimal('2') + fee
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
zbalance -= Decimal('2.0')
self.check_balance(0, 0, n0ua0, {'sapling': 8})
assert_equal(Decimal(self.nodes[2].z_getbalance(myzaddr)), zbalance)
self.check_balance(0, 0, n0ua0, {'sapling': n0ua0_balance})
assert_equal(self.nodes[2].z_getbalance(n2saddr), n2saddr_balance)
#
# Test that z_sendmany avoids UA linkability unless we allow it.
@ -317,26 +317,34 @@ class WalletZSendmanyTest(BitcoinTestFramework):
taddr = self.nodes[1].z_listunifiedreceivers(ua)['p2pkh']
self.nodes[0].sendtoaddress(taddr, 2)
n0sapling_balance = n0ua0_balance
n1ua0_balance = Decimal('2')
n1ua1_balance = Decimal('2')
n1t_balance = n1ua0_balance + n1ua1_balance
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
self.check_balance(0, 0, n0ua0, {'sapling': n0sapling_balance})
# The account should see all funds.
assert_equal(
self.nodes[1].z_getbalanceforaccount(n1account)['pools'],
{'transparent': {'valueZat': 4 * COIN}},
)
assert_equal(self.nodes[1].z_getbalanceforaccount(n1account)['pools'], {
'transparent': {'valueZat': n1t_balance * COIN},
})
# The addresses should see only the transparent funds sent to them.
assert_equal(self.nodes[1].z_getbalance(n1ua0), 2)
assert_equal(self.nodes[1].z_getbalance(n1ua1), 2)
assert_equal(Decimal(self.nodes[1].z_getbalance(n1ua0)), n1ua0_balance)
assert_equal(Decimal(self.nodes[1].z_getbalance(n1ua1)), n1ua1_balance)
# If we try to send 3 ZEC from n1ua0, it will fail with too-few funds.
recipients = [{"address":n0ua0, "amount":3}]
# If we try to send 3 ZEC less fee from n1ua0, it will fail with insufficient funds.
fee = conventional_fee(4)
amount = Decimal('3') - fee
recipients = [{"address": n0ua0, "amount": amount}]
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)
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[1], opid, 'failed', revealed_amounts_msg)
# If we try it again with any policy that is too strong, it also fails.
@ -347,45 +355,50 @@ class WalletZSendmanyTest(BitcoinTestFramework):
('AllowRevealedSenders', linked_addrs_without_coinbase_note_msg),
('AllowFullyTransparent', linked_addrs_without_coinbase_note_msg),
]:
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, 0, policy)
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee, policy)
wait_and_assert_operationid_status(self.nodes[1], opid, 'failed', msg)
# If we try to send just a bit less than we have, it will fail, complaining about dust
opid = self.nodes[1].z_sendmany(n1ua0, [{"address":n0ua0, "amount":3.9999999}], 1, 0, 'AllowLinkingAccountAddresses')
opid = self.nodes[1].z_sendmany(n1ua0,
[{"address": n0ua0, "amount": Decimal('3.9999999') - fee}],
1, fee, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(self.nodes[1], opid, 'failed', 'Insufficient funds: have 4.00, need 0.00000044 more to avoid creating invalid change output 0.0000001 (dust threshold is 0.00000054).')
# Once we provide a sufficiently-weak policy, the transaction succeeds.
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, 0, 'AllowLinkingAccountAddresses')
# Once we provide a sufficiently weak policy, the transaction succeeds.
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee, 'AllowLinkingAccountAddresses')
wait_and_assert_operationid_status(self.nodes[1], opid)
n0ua0_balance += amount
# Change should be sent to the Sapling change address (because NU5 is not active).
n1sapling_balance = n1t_balance - amount - fee
del n0sapling_balance
del n1t_balance
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
# The account should see the remaining funds, and they should have been
# sent to the Sapling change address (because NU5 is not active).
assert_equal(
self.nodes[1].z_getbalanceforaccount(n1account)['pools'],
{'sapling': {'valueZat': 1 * COIN}},
)
self.check_balance(0, 0, n0ua0, {'sapling': n0ua0_balance})
assert_equal(self.nodes[1].z_getbalanceforaccount(n1account)['pools'], {
'sapling': {'valueZat': n1sapling_balance * COIN},
})
# The addresses should both show the same balance, as they both show the
# Sapling balance.
assert_equal(self.nodes[1].z_getbalance(n1ua0), 1)
assert_equal(self.nodes[1].z_getbalance(n1ua1), 1)
# z_getbalance behaves inconsistently between transparent and shielded
# addresses: for a shielded address it gives the account balance.
assert_equal(Decimal(self.nodes[1].z_getbalance(n1ua0)), n1sapling_balance)
assert_equal(Decimal(self.nodes[1].z_getbalance(n1ua1)), n1sapling_balance)
#
# Test Orchard-only UA before NU5
#
n0orchard_only = self.nodes[0].z_getaddressforaccount(n0account0, ["orchard"])['address']
recipients = [{"address":n0orchard_only, "amount":1}]
n0orchard_only = self.nodes[0].z_getaddressforaccount(n0account, ["orchard"])['address']
recipients = [{"address": n0orchard_only, "amount": Decimal('1')}]
for (policy, msg) in [
('FullPrivacy', '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.'),
('AllowRevealedAmounts', 'This transaction would send to a transparent receiver of a unified address, which is not enabled by default because it will publicly reveal transaction recipients and amounts. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowRevealedRecipients` or weaker if you wish to allow this transaction to proceed anyway.'),
('AllowRevealedRecipients', 'Could not send to an Orchard-only receiver despite a lax privacy policy, because NU5 has not been activated yet.'),
]:
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, 0, policy)
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee, policy)
wait_and_assert_operationid_status(self.nodes[1], opid, 'failed', msg)
#
@ -394,26 +407,34 @@ class WalletZSendmanyTest(BitcoinTestFramework):
# Send some legacy transparent funds to n1ua0, creating Sapling outputs.
source = get_coinbase_address(self.nodes[2])
recipients = [{"address":n1ua0, "amount":10}]
fee = conventional_fee(3)
recipients = [{"address": n1ua0, "amount": Decimal('10') - fee}]
# This requires the AllowRevealedSenders policy, but we specify only AllowRevealedAmounts...
opid = self.nodes[2].z_sendmany(source, recipients, 1, 0, 'AllowRevealedAmounts')
opid = self.nodes[2].z_sendmany(source, recipients, 1, fee, 'AllowRevealedAmounts')
wait_and_assert_operationid_status(self.nodes[2], opid, 'failed', revealed_senders_msg)
# ... which we can always override with the NoPrivacy policy.
opid = self.nodes[2].z_sendmany(source, recipients, 1, 0, 'NoPrivacy')
opid = self.nodes[2].z_sendmany(source, recipients, 1, fee, 'NoPrivacy')
wait_and_assert_operationid_status(self.nodes[2], opid)
n1sapling_balance += Decimal('10') - fee
self.sync_all()
self.nodes[2].generate(1)
self.sync_all()
assert_equal(self.nodes[1].z_getbalanceforaccount(n1account)['pools'], {
'sapling': {'valueZat': n1sapling_balance * COIN},
})
# Send some funds from node 1's account to a transparent address.
recipients = [{"address":mytaddr, "amount":5}]
fee = conventional_fee(3)
recipients = [{"address": n2taddr, "amount": Decimal('5')}]
# This requires the AllowRevealedRecipients policy...
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, 0)
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[1], opid, 'failed', revealed_recipients_msg)
# ... which we can always override with the NoPrivacy policy.
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, 0, 'NoPrivacy')
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee, 'NoPrivacy')
wait_and_assert_operationid_status(self.nodes[1], opid)
n1sapling_balance -= Decimal('5') + fee
# Activate NU5
@ -421,80 +442,94 @@ class WalletZSendmanyTest(BitcoinTestFramework):
self.nodes[1].generate(10)
self.sync_all()
assert_equal(self.nodes[1].z_getbalanceforaccount(n1account)['pools'], {
'sapling': {'valueZat': n1sapling_balance * COIN},
})
#
# Test sending Sprout funds to Orchard-only UA
#
sproutAddr = self.nodes[2].listaddresses()[0]['sprout']['addresses'][0]
recipients = [{"address":n0orchard_only, "amount":100}]
recipients = [{"address": n0orchard_only, "amount": Decimal('100')}]
for (policy, msg) in [
('FullPrivacy', '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.'),
('AllowRevealedAmounts', 'This transaction would send to a transparent receiver of a unified address, which is not enabled by default because it will publicly reveal transaction recipients and amounts. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowRevealedRecipients` or weaker if you wish to allow this transaction to proceed anyway.'),
('AllowRevealedRecipients', 'Could not send to an Orchard-only receiver despite a lax privacy policy, because you are sending from the Sprout pool and there is no transaction version that supports both Sprout and Orchard.'),
('NoPrivacy', 'Could not send to an Orchard-only receiver despite a lax privacy policy, because you are sending from the Sprout pool and there is no transaction version that supports both Sprout and Orchard.'),
]:
opid = self.nodes[2].z_sendmany(sproutAddr, recipients, 1, 0, policy)
opid = self.nodes[2].z_sendmany(sproutAddr, recipients, 1, ZIP_317_FEE, policy)
wait_and_assert_operationid_status(self.nodes[2], opid, 'failed', msg)
#
# Test AllowRevealedAmounts policy
#
assert_equal(
{'pools': {'sapling': {'valueZat': 600000000}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(n1account))
# Sending some funds to the Orchard pool in n0account0 ...
n0ua1 = self.nodes[0].z_getaddressforaccount(n0account0, ["orchard"])['address']
recipients = [{"address":n0ua1, "amount": 6}]
# Sending some funds to the Orchard pool in n0account ...
n0ua1 = self.nodes[0].z_getaddressforaccount(n0account, ["orchard"])['address']
fee = conventional_fee(4)
recipients = [{"address": n0ua1, "amount": Decimal('5')}]
# Should fail under default and 'FullPrivacy' policies ...
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)
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[1], opid, 'failed', revealed_amounts_msg)
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, 0, 'FullPrivacy')
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee, 'FullPrivacy')
wait_and_assert_operationid_status(self.nodes[1], opid, 'failed', revealed_amounts_msg)
# Should succeed under 'AllowRevealedAmounts'
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, 0, 'AllowRevealedAmounts')
# Should succeed under 'AllowRevealedAmounts'. The change will go to Orchard.
opid = self.nodes[1].z_sendmany(n1ua0, recipients, 1, fee, 'AllowRevealedAmounts')
wait_and_assert_operationid_status(self.nodes[1], opid)
n0sapling_balance = n0ua0_balance
n0orchard_balance = Decimal('5')
n1orchard_balance = n1sapling_balance - Decimal('5') - fee
del n0ua0_balance
del n1sapling_balance
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
assert_equal(
{'pools': {'sapling': {'valueZat': 1100000000}, 'orchard': {'valueZat': 600000000}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(n0account0))
assert_equal(self.nodes[0].z_getbalanceforaccount(n0account)['pools'], {
'sapling': {'valueZat': n0sapling_balance * COIN},
'orchard': {'valueZat': n0orchard_balance * COIN},
})
assert_equal(self.nodes[1].z_getbalanceforaccount(n1account)['pools'], {
'orchard': {'valueZat': n1orchard_balance * COIN},
})
# A total that requires selecting from both pools should fail under default and
# FullPrivacy policies...
recipients = [{"address":n1ua0, "amount": 15}]
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, 0)
fee = conventional_fee(3)
recipients = [{"address": n1ua0, "amount": Decimal('15')}]
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, fee)
wait_and_assert_operationid_status(self.nodes[0], opid, 'failed', revealed_amounts_msg)
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, 0, 'FullPrivacy')
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, fee, 'FullPrivacy')
wait_and_assert_operationid_status(self.nodes[0], opid, 'failed', revealed_amounts_msg)
# Should succeed under 'AllowRevealedAmounts'
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, 0, 'AllowRevealedAmounts')
# All funds should be received to the Orchard pool, and all change should
# be optimistically shielded.
fee = conventional_fee(6)
opid = self.nodes[0].z_sendmany(n0ua0, recipients, 1, fee, 'AllowRevealedAmounts')
wait_and_assert_operationid_status(self.nodes[0], opid)
n0orchard_balance += n0sapling_balance - Decimal('15') - fee
n1orchard_balance += Decimal('15')
del n0sapling_balance
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
# All funds should be received to the Orchard pool
assert_equal(
{'pools': {'orchard': {'valueZat': 1500000000}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(n1account))
# And all change should be optimistically shielded
assert_equal(
{'pools': {'orchard': {'valueZat': 200000000}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(n0account0))
assert_equal(self.nodes[0].z_getbalanceforaccount(n0account)['pools'], {
'orchard': {'valueZat': n0orchard_balance * COIN},
})
assert_equal(self.nodes[1].z_getbalanceforaccount(n1account)['pools'], {
'orchard': {'valueZat': n1orchard_balance * COIN},
})
self.sync_all()
self.nodes[1].generate(1)
@ -504,15 +539,25 @@ class WalletZSendmanyTest(BitcoinTestFramework):
# Test transparent change
#
recipients = [{"address":n0ua1, "amount": 4}]
fee = conventional_fee(3)
recipients = [{"address": n0ua1, "amount": Decimal('4')}]
# Should fail because this generates transparent change, but we dont have
# `AllowRevealedRecipients`
opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, 0, 'AllowRevealedSenders')
opid = self.nodes[2].z_sendmany(n2taddr, recipients, 1, fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[2], opid, 'failed', "This transaction would have transparent change, which is not enabled by default because it will publicly reveal the change address and amounts. THIS MAY AFFECT YOUR PRIVACY. Resubmit with the `privacyPolicy` parameter set to `AllowRevealedRecipients` or weaker if you wish to allow this transaction to proceed anyway.")
# Should succeed once we include `AllowRevealedRecipients`
opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, 0, 'AllowFullyTransparent')
opid = self.nodes[2].z_sendmany(n2taddr, recipients, 1, fee, 'AllowFullyTransparent')
wait_and_assert_operationid_status(self.nodes[2], opid)
n0orchard_balance += Decimal('4')
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
assert_equal(self.nodes[0].z_getbalanceforaccount(n0account)['pools'], {
'orchard': {'valueZat': n0orchard_balance * COIN},
})
if __name__ == '__main__':
WalletZSendmanyTest().main()

View File

@ -0,0 +1,97 @@
#!/usr/bin/env python3
# Copyright (c) 2022-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.mininode import COIN
from test_framework.util import (
CANOPY_BRANCH_ID,
NU5_BRANCH_ID,
assert_equal,
assert_raises_message,
get_coinbase_address,
nuparams,
start_nodes,
wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee, ZIP_317_FEE
# Regression test for https://github.com/zcash/zcash/issues/6956 .
class WalletZip317DefaultTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
nuparams(CANOPY_BRANCH_ID, 205),
nuparams(NU5_BRANCH_ID, 206),
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
'-regtestwalletsetbestchaineveryblock',
]] * self.num_nodes)
def run_test(self):
# Sanity-check the test harness.
assert_equal(self.nodes[0].getblockcount(), 200)
# Create an account with funds in the Sapling receiver.
acct0 = self.nodes[0].z_getnewaccount()['account']
ua0 = self.nodes[0].z_getaddressforaccount(acct0, ['sapling', 'orchard'])['address']
coinbase_fee = conventional_fee(3)
balance0 = Decimal('10') - coinbase_fee
recipients = [{"address": ua0, "amount": balance0}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, coinbase_fee, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
# Mine the tx & activate NU5.
self.sync_all()
self.nodes[0].generate(10)
self.sync_all()
assert_equal(
{'pools': {'sapling': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0),
)
acct1 = self.nodes[1].z_getnewaccount()['account']
ua1 = self.nodes[1].z_getaddressforaccount(acct1, ['orchard'])['address']
# The next z_sendmany call fails when passed `None`/`ZIP_317_FEE` because it
# calculates a fee that is too low.
# https://github.com/zcash/zcash/issues/6956
recipients = [{"address": ua1, "amount": Decimal('1')}]
opid = self.nodes[0].z_sendmany(ua0, recipients, 1, ZIP_317_FEE, 'AllowRevealedAmounts')
# The buggy behaviour.
assert_raises_message(AssertionError,
"Transaction commit failed:: tx unpaid action limit exceeded: 1 action(s) exceeds limit of 0",
wait_and_assert_operationid_status, self.nodes[0], opid)
# If we pass `fee` instead of `None`, it succeeds.
fee = conventional_fee(4)
opid = self.nodes[0].z_sendmany(ua0, recipients, 1, fee, 'AllowRevealedAmounts')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
# The nodes have the expected split of funds.
balance0 -= Decimal('1') + fee
assert_equal(
{'pools': {'orchard': {'valueZat': balance0 * COIN}}, 'minimum_confirmations': 1},
self.nodes[0].z_getbalanceforaccount(acct0),
)
assert_equal(
{'pools': {'orchard': {'valueZat': 1_0000_0000}}, 'minimum_confirmations': 1},
self.nodes[1].z_getbalanceforaccount(acct1),
)
# TODO: also test the case in `wallet_isfromme.py`.
if __name__ == '__main__':
WalletZip317DefaultTest().main()

View File

@ -1,21 +1,23 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The Zcash developers
# Copyright (c) 2017-2024 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from decimal import Decimal
from test_framework.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, \
LEGACY_DEFAULT_FEE
from test_framework.authproxy import JSONRPCException
from test_framework.util import (
assert_equal, assert_greater_than, assert_raises_message, start_nodes,
initialize_chain_clean, connect_nodes_bi, wait_and_assert_operationid_status,
)
from test_framework.zip317 import conventional_fee
from functools import reduce
import logging
import sys
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO, stream=sys.stdout)
fee = LEGACY_DEFAULT_FEE # constant (but can be changed within reason)
class ZkeyImportExportTest (BitcoinTestFramework):
def setup_chain(self):
@ -24,7 +26,6 @@ class ZkeyImportExportTest (BitcoinTestFramework):
def setup_network(self, split=False):
self.nodes = start_nodes(5, self.options.tmpdir, extra_args=[[
'-minrelaytxfee=0',
'-allowdeprecated=getnewaddress',
'-allowdeprecated=z_getnewaddress',
'-allowdeprecated=z_getbalance',
@ -39,28 +40,27 @@ class ZkeyImportExportTest (BitcoinTestFramework):
self.sync_all()
def run_test(self):
[alice, bob, charlie, david, miner] = self.nodes
[alice, bob, charlie, daira, miner] = self.nodes
fee = conventional_fee(2)
# the sender loses 'amount' plus fee; to_addr receives exactly 'amount'
def z_send(from_node, from_addr, to_addr, amount):
global fee
opid = from_node.z_sendmany(from_addr,
[{"address": to_addr, "amount": Decimal(amount)}], 1, int(fee))
recipients = [{"address": to_addr, "amount": amount}]
opid = from_node.z_sendmany(from_addr, recipients, 1, fee)
wait_and_assert_operationid_status(from_node, opid)
self.sync_all()
miner.generate(1)
self.sync_all()
def verify_utxos(node, amts, zaddr):
amts.sort(reverse=True)
def verify_utxos(node, amounts, zaddr):
amounts.sort(reverse=True)
txs = node.z_listreceivedbyaddress(zaddr)
txs.sort(key=lambda x: x["amount"], reverse=True)
print("Sorted txs", txs)
print("amts", amts)
print("amounts", amounts)
try:
assert_equal(amts, [tx["amount"] for tx in txs])
assert_equal(amounts, [tx["amount"] for tx in txs])
for tx in txs:
# make sure Sapling outputs exist and have valid values
assert_equal("outindex" in tx, True)
@ -68,7 +68,7 @@ class ZkeyImportExportTest (BitcoinTestFramework):
except AssertionError:
logging.error(
'Expected amounts: %r; txs: %r',
amts, txs)
amounts, txs)
raise
def get_private_balance(node):
@ -91,8 +91,8 @@ class ZkeyImportExportTest (BitcoinTestFramework):
# Now get a pristine z-address for receiving transfers:
bob_zaddr = bob.z_getnewaddress()
verify_utxos(bob, [], bob_zaddr)
# TODO: Verify that charlie doesn't have funds in addr
# verify_utxos(charlie, [])
assert_raises_message(JSONRPCException, "From address does not belong to this node",
charlie.z_listreceivedbyaddress, bob_zaddr)
# the amounts of each txn embodied which generates a single UTXO:
amounts = list(map(Decimal, ['2.3', '3.7', '0.1', '0.5', '1.0', '0.19']))
@ -114,7 +114,8 @@ class ZkeyImportExportTest (BitcoinTestFramework):
z_send(alice, alice_zaddr, bob_zaddr, amount)
verify_utxos(bob, amounts[:4], bob_zaddr)
# verify_utxos(charlie, [])
assert_raises_message(JSONRPCException, "From address does not belong to this node",
charlie.z_listreceivedbyaddress, bob_zaddr)
logging.info("Importing bob_privkey into charlie...")
# z_importkey rescan defaults to "whenkeyisnew", so should rescan here
@ -141,26 +142,24 @@ class ZkeyImportExportTest (BitcoinTestFramework):
verify_utxos(charlie, amounts, ipk_zaddr["address"])
verify_utxos(charlie, amounts, ipk_zaddr2["address"])
# keep track of the fees incurred by bob (his sends)
bob_fee = Decimal("0")
# keep track of bob's expected balance
bob_balance = sum(amounts)
# Try to reproduce zombie balance reported in #1936
# At generated zaddr, receive ZEC, and send ZEC back out. bob -> alice
for amount in amounts[:2]:
print("Sending amount from bob to alice: ", amount)
z_send(bob, bob_zaddr, alice_zaddr, amount)
bob_fee += fee
bob_balance = sum(amounts[2:]) - int(bob_fee)
bob_balance -= amount + fee
assert_equal(bob.z_getbalance(bob_zaddr), bob_balance)
# z_import onto new node "david" (blockchain rescan, default or True?)
d_ipk_zaddr = david.z_importkey(bob_privkey)
# z_import onto new node "daira" (rescans by default because the key is new)
d_ipk_zaddr = daira.z_importkey(bob_privkey)
# Check if amt bob spent is deducted for charlie and david
# Check if amount bob spent is deducted for charlie and daira
assert_equal(charlie.z_getbalance(ipk_zaddr["address"]), bob_balance)
assert_equal(david.z_getbalance(d_ipk_zaddr["address"]), bob_balance)
assert_equal(daira.z_getbalance(d_ipk_zaddr["address"]), bob_balance)
if __name__ == '__main__':
ZkeyImportExportTest().main()

View File

@ -579,6 +579,11 @@ via its methods (one of which is now usable with the new MSRV) instead of via
casting.
"""
[[audits.crossbeam-utils]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "0.8.20 -> 0.8.21"
[[audits.crypto-common]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
@ -712,6 +717,18 @@ notes = """
used as the ZST `SyncUnsafeCell<PhantomData<()>>` to fix an LLVM miscompilation.
"""
[[audits.cxx]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.128 -> 1.0.136"
notes = """
- Change to build script is to raise MSRV.
- Changes to `unsafe` blocks are a refactor to expose pointers from `UniquePtr`.
The existing usages are effectively unaltered.
- The hasher is changed from SipHash-1-3 to foldhash-q. This means the hasher is
faster, but no longer resistant to HashDoS.
"""
[[audits.cxxbridge-flags]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
@ -778,6 +795,16 @@ who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.121 -> 1.0.122"
[[audits.cxxbridge-flags]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.135 -> 1.0.136"
[[audits.cxxbridge-flags]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.146 -> 1.0.158"
[[audits.cxxbridge-macro]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
@ -873,6 +900,15 @@ who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.126 -> 1.0.128"
[[audits.cxxbridge-macro]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.128 -> 1.0.136"
notes = """
Changes to generated `unsafe` code are to add the new `unsafe` annotations added
in Rust 1.82 to the `extern` blocks.
"""
[[audits.der]]
who = "Daira-Emma Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
@ -1062,6 +1098,15 @@ criteria = "safe-to-deploy"
delta = "0.3.29 -> 0.3.30"
notes = "Removes `build.rs` now that it can rely on the `target_has_atomic` attribute."
[[audits.futures-channel]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "0.3.30 -> 0.3.31"
notes = """
Changes to `unsafe` code are only to wrap the internals of some `unsafe fn`s int
`unsafe` blocks for added clarity.
"""
[[audits.futures-core]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -1369,6 +1414,11 @@ who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "2.9.0 -> 2.10.0"
[[audits.ipnet]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "2.10.0 -> 2.10.1"
[[audits.itoa]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -1519,6 +1569,12 @@ who = "Daira-Emma Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "0.4.20 -> 0.4.21"
[[audits.macro_find_and_replace]]
who = "Daira-Emma Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
version = "1.0.0"
notes = "Fully reviewed. No problems found other than a few typos in documentation (filed https://github.com/lord-ne/rust-macro-find-and-replace/pull/1 )."
[[audits.maybe-rayon]]
who = "Sean Bowe <ewillbefull@gmail.com>"
criteria = "safe-to-deploy"
@ -1560,6 +1616,12 @@ criteria = "safe-to-deploy"
delta = "0.2.0 -> 0.2.1"
notes = "Exposes an existing macro. Note that I am the author of the crate."
[[audits.memuse]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "0.2.1 -> 0.2.2"
notes = "Adds no-std support; no other changes. Note that I am the author of the crate."
[[audits.metrics]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -2172,6 +2234,11 @@ criteria = "safe-to-deploy"
delta = "0.38.28 -> 0.38.32"
notes = "Cursory review."
[[audits.rustversion]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.18 -> 1.0.19"
[[audits.ryu]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
@ -2265,6 +2332,11 @@ who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.193 -> 1.0.194"
[[audits.serde]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.216 -> 1.0.217"
[[audits.serde_derive]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -2306,6 +2378,11 @@ who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.193 -> 1.0.194"
[[audits.serde_derive]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
delta = "1.0.216 -> 1.0.217"
[[audits.serde_json]]
who = "Jack Grigg <jack@electriccoin.co>"
criteria = "safe-to-deploy"
@ -2738,6 +2815,22 @@ criteria = "safe-to-deploy"
delta = "1.35.1 -> 1.37.0"
notes = "Cursory review, but new and changed uses of `unsafe` code look fine, as far as I can see."
[[audits.tokio]]
who = "Daira-Emma Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "1.40.0 -> 1.42.0"
notes = """
Changes to unsafe code look reasonable. There are new unsafe APIs but their safety requirements are documented.
This release has a vulnerability (https://rustsec.org/advisories/RUSTSEC-2025-0023) but it is not a regression relative
to 1.40.0. Update to 1.42.1 to fix that.
"""
[[audits.tokio]]
who = "Daira-Emma Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "1.42.0 -> 1.42.1"
notes = "Plausible fix to https://rustsec.org/advisories/RUSTSEC-2025-0023 ."
[[audits.toml_datetime]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -3044,7 +3137,7 @@ end = "2024-09-21"
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2022-07-22"
end = "2024-09-21"
end = "2025-10-02"
[[trusted.equihash]]
criteria = "safe-to-deploy"
@ -3056,7 +3149,7 @@ end = "2024-09-21"
criteria = ["safe-to-deploy", "crypto-reviewed"]
user-id = 6289 # Jack Grigg (str4d)
start = "2021-09-22"
end = "2024-09-21"
end = "2026-01-02"
[[trusted.halo2_gadgets]]
criteria = ["safe-to-deploy", "crypto-reviewed"]
@ -3064,47 +3157,59 @@ user-id = 1244 # ebfull
start = "2022-05-10"
end = "2024-09-21"
[[trusted.halo2_gadgets]]
criteria = ["safe-to-deploy", "crypto-reviewed"]
user-id = 6289 # Jack Grigg (str4d)
start = "2022-02-15"
end = "2026-01-02"
[[trusted.halo2_legacy_pdqsort]]
criteria = ["safe-to-deploy", "crypto-reviewed"]
user-id = 199950 # Daira Emma Hopwood (daira)
user-id = 199950 # Daira-Emma Hopwood (daira)
start = "2023-02-24"
end = "2024-09-21"
[[trusted.halo2_poseidon]]
criteria = ["safe-to-deploy", "crypto-reviewed"]
user-id = 6289 # Jack Grigg (str4d)
start = "2024-12-13"
end = "2026-01-02"
[[trusted.halo2_proofs]]
criteria = ["safe-to-deploy", "crypto-reviewed"]
user-id = 1244 # ebfull
start = "2022-05-10"
end = "2024-09-21"
[[trusted.incrementalmerkletree]]
criteria = "safe-to-deploy"
user-id = 6289 # Jack Grigg (str4d)
start = "2021-12-17"
end = "2024-09-21"
[[trusted.incrementalmerkletree]]
criteria = "safe-to-deploy"
user-id = 1244 # ebfull
start = "2021-06-24"
end = "2024-09-21"
[[trusted.incrementalmerkletree]]
criteria = "safe-to-deploy"
user-id = 6289 # Jack Grigg (str4d)
start = "2021-12-17"
end = "2024-09-21"
[[trusted.incrementalmerkletree]]
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2023-02-28"
end = "2024-09-21"
end = "2025-10-02"
[[trusted.incrementalmerkletree-testing]]
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2024-09-27"
end = "2025-09-27"
start = "2024-09-25"
end = "2025-10-02"
[[trusted.orchard]]
criteria = ["safe-to-deploy", "crypto-reviewed", "license-reviewed"]
user-id = 6289 # Jack Grigg (str4d)
start = "2021-01-07"
end = "2024-09-21"
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2024-08-12"
end = "2025-10-02"
[[trusted.orchard]]
criteria = ["safe-to-deploy", "crypto-reviewed", "license-reviewed"]
@ -3112,12 +3217,30 @@ user-id = 1244 # ebfull
start = "2022-10-19"
end = "2024-09-21"
[[trusted.orchard]]
criteria = ["safe-to-deploy", "crypto-reviewed", "license-reviewed"]
user-id = 6289 # Jack Grigg (str4d)
start = "2021-01-07"
end = "2024-09-21"
[[trusted.sapling-crypto]]
criteria = ["safe-to-deploy", "crypto-reviewed"]
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2024-08-12"
end = "2025-10-02"
[[trusted.sapling-crypto]]
criteria = ["safe-to-deploy", "crypto-reviewed", "license-reviewed"]
user-id = 6289 # Jack Grigg (str4d)
start = "2024-01-26"
end = "2025-03-18"
[[trusted.sinsemilla]]
criteria = ["safe-to-deploy", "crypto-reviewed"]
user-id = 6289 # Jack Grigg (str4d)
start = "2024-12-13"
end = "2026-01-02"
[[trusted.windows-sys]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
@ -3202,6 +3325,12 @@ user-id = 1244 # ebfull
start = "2022-10-19"
end = "2024-09-21"
[[trusted.zcash_encoding]]
criteria = "safe-to-deploy"
user-id = 6289 # Jack Grigg (str4d)
start = "2021-08-31"
end = "2026-01-02"
[[trusted.zcash_history]]
criteria = "safe-to-deploy"
user-id = 1244 # ebfull
@ -3221,10 +3350,16 @@ start = "2023-03-22"
end = "2024-09-21"
[[trusted.zcash_primitives]]
criteria = ["safe-to-deploy", "crypto-reviewed", "license-reviewed"]
criteria = "safe-to-deploy"
user-id = 6289 # Jack Grigg (str4d)
start = "2021-03-26"
end = "2024-09-21"
end = "2025-10-02"
[[trusted.zcash_primitives]]
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2024-08-20"
end = "2025-08-26"
[[trusted.zcash_primitives]]
criteria = ["safe-to-deploy", "crypto-reviewed", "license-reviewed"]
@ -3233,6 +3368,18 @@ start = "2019-10-08"
end = "2024-09-21"
[[trusted.zcash_primitives]]
criteria = ["safe-to-deploy", "crypto-reviewed", "license-reviewed"]
user-id = 6289 # Jack Grigg (str4d)
start = "2021-03-26"
end = "2024-09-21"
[[trusted.zcash_proofs]]
criteria = "safe-to-deploy"
user-id = 6289 # Jack Grigg (str4d)
start = "2021-03-26"
end = "2025-10-02"
[[trusted.zcash_proofs]]
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2024-08-20"
@ -3244,12 +3391,6 @@ user-id = 6289 # Jack Grigg (str4d)
start = "2021-03-26"
end = "2024-09-21"
[[trusted.zcash_proofs]]
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2024-08-20"
end = "2025-08-26"
[[trusted.zcash_protocol]]
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
@ -3262,6 +3403,12 @@ user-id = 6289 # Jack Grigg (str4d)
start = "2023-12-07"
end = "2025-03-18"
[[trusted.zcash_transparent]]
criteria = "safe-to-deploy"
user-id = 169181 # Kris Nuttycombe (nuttycom)
start = "2024-12-17"
end = "2026-05-08"
[[trusted.zip32]]
criteria = "safe-to-deploy"
user-id = 6289 # Jack Grigg (str4d)

View File

@ -2,7 +2,7 @@
# cargo-vet config file
[cargo-vet]
version = "0.9"
version = "0.10"
[imports.bytecode-alliance]
url = "https://raw.githubusercontent.com/bytecodealliance/wasmtime/main/supply-chain/audits.toml"
@ -55,7 +55,7 @@ version = "1.0.1"
criteria = "safe-to-deploy"
[[exemptions.bech32]]
version = "0.8.1"
version = "0.11.0"
criteria = "safe-to-deploy"
[[exemptions.bellman]]
@ -63,7 +63,7 @@ version = "0.13.0"
criteria = "safe-to-deploy"
[[exemptions.bip0039]]
version = "0.9.0"
version = "0.12.0"
criteria = "safe-to-deploy"
[[exemptions.bip32]]
@ -106,18 +106,18 @@ criteria = "safe-to-deploy"
version = "0.9.0"
criteria = "safe-to-deploy"
[[exemptions.cipher]]
version = "0.3.0"
criteria = "safe-to-deploy"
[[exemptions.clearscreen]]
version = "1.0.9"
version = "4.0.1"
criteria = "safe-to-deploy"
[[exemptions.const-oid]]
version = "0.9.6"
criteria = "safe-to-deploy"
[[exemptions.core2]]
version = "0.3.3"
criteria = "safe-to-deploy"
[[exemptions.cpufeatures]]
version = "0.2.13"
criteria = "safe-to-deploy"
@ -127,7 +127,7 @@ version = "0.5.6"
criteria = "safe-to-deploy"
[[exemptions.crossbeam-deque]]
version = "0.8.2"
version = "0.8.6"
criteria = "safe-to-deploy"
[[exemptions.crossbeam-epoch]]
@ -147,11 +147,11 @@ version = "0.1.0"
criteria = "safe-to-deploy"
[[exemptions.cxx]]
version = "1.0.126"
version = "1.0.158"
criteria = "safe-to-deploy"
[[exemptions.cxxbridge-macro]]
version = "1.0.126"
version = "1.0.158"
criteria = "safe-to-deploy"
[[exemptions.der]]
@ -162,14 +162,6 @@ criteria = "safe-to-deploy"
version = "0.9.0"
criteria = "safe-to-deploy"
[[exemptions.dirs]]
version = "2.0.2"
criteria = "safe-to-deploy"
[[exemptions.dirs-sys]]
version = "0.3.7"
criteria = "safe-to-deploy"
[[exemptions.ed25519]]
version = "2.2.1"
criteria = "safe-to-deploy"
@ -178,6 +170,10 @@ criteria = "safe-to-deploy"
version = "3.0.0"
criteria = "safe-to-deploy"
[[exemptions.env_home]]
version = "0.1.0"
criteria = "safe-to-deploy"
[[exemptions.ff]]
version = "0.12.0"
criteria = "safe-to-deploy"
@ -210,8 +206,8 @@ criteria = "safe-to-deploy"
version = "0.2.6"
criteria = "safe-to-deploy"
[[exemptions.gimli]]
version = "0.29.0"
[[exemptions.getset]]
version = "0.1.4"
criteria = "safe-to-deploy"
[[exemptions.group]]
@ -270,24 +266,20 @@ criteria = "safe-to-deploy"
version = "0.9.0"
criteria = "safe-to-deploy"
[[exemptions.known-folders]]
version = "1.2.0"
criteria = "safe-to-deploy"
[[exemptions.libc]]
version = "0.2.159"
version = "0.2.172"
criteria = "safe-to-deploy"
[[exemptions.libm]]
version = "0.2.2"
criteria = "safe-to-deploy"
[[exemptions.libredox]]
version = "0.0.1"
[[exemptions.linux-raw-sys]]
version = "0.4.14"
criteria = "safe-to-deploy"
[[exemptions.linux-raw-sys]]
version = "0.4.14"
version = "0.9.4"
criteria = "safe-to-deploy"
[[exemptions.memchr]]
@ -346,16 +338,12 @@ criteria = "safe-to-deploy"
version = "1.17.0"
criteria = "safe-to-deploy"
[[exemptions.orchard]]
version = "0.9.0"
criteria = "safe-to-deploy"
[[exemptions.pairing]]
version = "0.22.0"
criteria = "safe-to-deploy"
[[exemptions.password-hash]]
version = "0.3.2"
version = "0.5.0"
criteria = "safe-to-deploy"
[[exemptions.pasta_curves]]
@ -363,7 +351,7 @@ version = "0.4.0"
criteria = "safe-to-deploy"
[[exemptions.pbkdf2]]
version = "0.9.0"
version = "0.12.2"
criteria = "safe-to-deploy"
[[exemptions.phf]]
@ -402,8 +390,16 @@ criteria = "safe-to-deploy"
version = "0.12.2"
criteria = "safe-to-deploy"
[[exemptions.proc-macro-error-attr2]]
version = "2.0.0"
criteria = "safe-to-deploy"
[[exemptions.proc-macro-error2]]
version = "2.0.1"
criteria = "safe-to-deploy"
[[exemptions.proptest]]
version = "1.5.0"
version = "1.6.0"
criteria = "safe-to-deploy"
[[exemptions.quanta]]
@ -418,10 +414,6 @@ criteria = "safe-to-deploy"
version = "0.7.0"
criteria = "safe-to-deploy"
[[exemptions.rand]]
version = "0.8.5"
criteria = "safe-to-deploy"
[[exemptions.raw-cpuid]]
version = "10.6.0"
criteria = "safe-to-deploy"
@ -430,10 +422,6 @@ criteria = "safe-to-deploy"
version = "0.3.0"
criteria = "safe-to-deploy"
[[exemptions.redox_users]]
version = "0.4.6"
criteria = "safe-to-deploy"
[[exemptions.regex]]
version = "1.10.6"
criteria = "safe-to-deploy"
@ -462,12 +450,12 @@ criteria = "safe-to-deploy"
version = "0.38.34"
criteria = "safe-to-deploy"
[[exemptions.rusty-fork]]
version = "0.3.0"
[[exemptions.rustix]]
version = "1.0.7"
criteria = "safe-to-deploy"
[[exemptions.sapling-crypto]]
version = "0.2.0"
[[exemptions.rusty-fork]]
version = "0.3.0"
criteria = "safe-to-deploy"
[[exemptions.secp256k1]]
@ -482,14 +470,6 @@ criteria = "safe-to-deploy"
version = "0.8.0"
criteria = "safe-to-deploy"
[[exemptions.sha2]]
version = "0.10.8"
criteria = "safe-to-deploy"
[[exemptions.shlex]]
version = "1.3.0"
criteria = "safe-to-deploy"
[[exemptions.siphasher]]
version = "0.3.10"
criteria = "safe-to-deploy"
@ -510,16 +490,12 @@ criteria = "safe-to-deploy"
version = "0.7.3"
criteria = "safe-to-deploy"
[[exemptions.subtle]]
version = "2.4.1"
criteria = "safe-to-deploy"
[[exemptions.syn]]
version = "1.0.102"
criteria = "safe-to-deploy"
[[exemptions.syn]]
version = "2.0.75"
version = "2.0.94"
criteria = "safe-to-deploy"
[[exemptions.tempfile]]
@ -527,7 +503,15 @@ version = "3.12.0"
criteria = "safe-to-deploy"
[[exemptions.terminfo]]
version = "0.8.0"
version = "0.9.0"
criteria = "safe-to-deploy"
[[exemptions.thiserror]]
version = "2.0.12"
criteria = "safe-to-deploy"
[[exemptions.thiserror-impl]]
version = "2.0.12"
criteria = "safe-to-deploy"
[[exemptions.time]]
@ -570,10 +554,6 @@ criteria = "safe-to-deploy"
version = "0.9.5"
criteria = "safe-to-deploy"
[[exemptions.visibility]]
version = "0.1.1"
criteria = "safe-to-deploy"
[[exemptions.wait-timeout]]
version = "0.2.0"
criteria = "safe-to-deploy"
@ -607,7 +587,7 @@ version = "0.3.70"
criteria = "safe-to-deploy"
[[exemptions.which]]
version = "6.0.3"
version = "7.0.3"
criteria = "safe-to-deploy"
[[exemptions.winapi]]
@ -638,10 +618,6 @@ criteria = "safe-to-deploy"
version = "2.5.0"
criteria = "safe-to-deploy"
[[exemptions.zcash_encoding]]
version = "0.2.1"
criteria = "safe-to-deploy"
[[exemptions.zerocopy]]
version = "0.7.35"
criteria = "safe-to-deploy"
@ -649,11 +625,3 @@ criteria = "safe-to-deploy"
[[exemptions.zerocopy-derive]]
version = "0.7.35"
criteria = "safe-to-deploy"
[[exemptions.zeroize]]
version = "1.8.1"
criteria = "safe-to-deploy"
[[exemptions.zeroize_derive]]
version = "1.3.2"
criteria = "safe-to-deploy"

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