Commit Graph

1524 Commits

Author SHA1 Message Date
Jack Grigg 19c7742318 qa: `cargo vet init` 2022-06-09 14:50:23 +00:00
str4d e66f768e5d
Merge pull request #5976 from nuttycom/bug/block_wallet_init_on_reindex
Scan wallet from genesis when reindexing
2022-06-01 18:21:10 +01:00
Jack Grigg c1343d1807 qa: Fix sprout_sapling_migration RPC test to handle wallet RPC change
Co-authored-by: ying tong <yingtong@z.cash>
2022-06-01 13:51:26 +00:00
Kris Nuttycombe f3a9dcc0cf Mark the `dumpwallet` RPC method as disabled.
Fixes #5513
2022-05-26 14:31:26 -06:00
Kris Nuttycombe 9691d86047 Add a CLI flag to preferentially send V4 tx.
Since the wallet ecosystem may not be fully updated to handle
v5 transaction parsing at the point of NU5 activation, some
nodes may prefer to construct V4 transactions when not including
Orchard transaction components.

This change adds a CLI flag that allows node users to specify
that preference.
2022-05-26 07:26:38 -06:00
Kris Nuttycombe 15d1bb6ce9 scripted-diff: Add 2020-2022 copyright headers for files added/modified in 2020
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM 6a08c225674df23f1c7f214bcb94732dba688d39..a960e896dd4c0b6d96db3d5ebbb1caa6c92a9f39 -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2020-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:32:39 -06:00
Kris Nuttycombe 940dd0d426 scripted-diff: Add 2019-2022 copyright headers for files added/modified in 2019
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM 8df7a073ce13ec057b94b5a813bb5534cdfa6809..6a08c225674df23f1c7f214bcb94732dba688d39 -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2019-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:29:59 -06:00
Kris Nuttycombe 73fcef8035 scripted-diff: Add 2018-2022 copyright headers for files added/modified in 2018
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM b2a114a8c99947b66d1fbdc70278f13e7a415d2a..8df7a073ce13ec057b94b5a813bb5534cdfa6809 -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2018-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:28:03 -06:00
Kris Nuttycombe d9aeefc54a scripted-diff: Add 2017-2022 copyright headers for files added/modified in 2017
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM 94f427a211bb337200c29a1e19be0f5ad2f171b0..b2a114a8c99947b66d1fbdc70278f13e7a415d2a -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2017-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:25:51 -06:00
Kris Nuttycombe 28040f9ce4 scripted-diff: Add 2016-2022 copyright headers for files added/modified in 2016
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM bitcoin-v0.11.2..94f427a211bb337200c29a1e19be0f5ad2f171b0 -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2016-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:23:09 -06:00
Kris Nuttycombe 1b8a9af946 Add tests to check auth data commitments committing to Orchard actions.
In the process of adding these tests, I also found and fixed a number
of type errors in Orchard auth data root computation.

Fixes #5223
2022-05-09 21:01:11 -06:00
Kris Nuttycombe 580bbc0b35 Postpone dependency updates prior to v5.0.0-rc1 2022-05-09 08:52:59 -06:00
Kris Nuttycombe 5c1a99a288
Merge pull request #5917 from nuttycom/feature/wallet_orchard-checkpoint_depth
Select anchors at `-anchorconfirmations` depth.
2022-05-09 08:29:55 -06:00
Kris Nuttycombe c920077a46 Use default anchor confirmations for minconf in z_mergetoaddress.
z_mergetoaddress doesn't currently have any mechanism for specifying
the minconf value. We don't want to default back to a minconf of 1,
as before, because we'll be selecting anchors with at least 3
confirmations by default, so the simplest change here is to make
the minconf value default to the number of anchor confirmations, and
add a configurable minconf at some point in the future. It's likely
that `z_mergetoaddress` will end up being deprecated in any case,
so this works for now.

Also, ensure that anywhere that we're attempting to obtain the Orchard
anchor that we don't attempt to get an anchor from a height below NU5
activation.
2022-05-06 22:15:20 -06:00
Kris Nuttycombe 66fad22873 Fix missing handling for imported transparent multisig addresses. 2022-05-06 13:29:05 -06:00
Taylor Hornby b900c4827b Reproduce an assertion failure in the listaddresses RPC 2022-05-06 11:59:28 -06:00
Kris Nuttycombe fefea8fe29 Fix RPC tests that depend upon -anchorconfirmations=1 2022-05-04 18:00:34 -06:00
Kris Nuttycombe f285a39063
Merge pull request #5410 from LarryRuane/2021-12-06-test-python-standalone
Allow rpc python tests to be run standalone
2022-05-04 17:41:42 -06:00
Kris Nuttycombe 63e4addd9a Select Orchard anchors at `-orchardanchorconfirmations` depth.
This changes anchor selection and Orchard authentication path generation
to default to select anchors at a the depth specified by the
`-orchardanchorconfirmations` CLI argument, with a default anchor
selection depth of 10 blocks.

If the value of `minconf` used for a particular call to `z_sendmany` is
less than the the set number of Orchard anchor confirmations, `minconf`
will be used instead for the Orchard anchor confirmations depth,
so that the selected anchor will be certain to contain any notes
selected to be spent.

Fixes #5644
2022-05-04 14:16:43 -06:00
Kris Nuttycombe 717b253a01 Remove `-allowdeprecated=all`
We've decided to remove the option to allow all deprecated features,
because this has the effect that, if a user enables this flag, they
won't get the warning (and hence may forget to take action) at the time
that a feature is moved from the default-allowed set to the
default-denied set.

Co-authored-by: str4d <thestr4d@gmail.com>
2022-05-03 20:32:10 -06:00
Kris Nuttycombe 4ea9de5ff6 Remove zcrawreceive, zcrawjoinsplit, zcrawkeygen from default-allowed deprecated methods. 2022-04-28 15:21:13 -06:00
Kris Nuttycombe d6d3be9bf2 Allow deprecated wallet features to be preemptively disabled.
This adds an `-allowdeprecated` CLI parameter whose value is a flag
indicating a deprecated feature that should be explicitly enabled.
Multiple instances of this argument may be provided. In the case that
this parameter is not provided, all currently deprecated RPC methods
that are not slated for removal in the next release remain available.
A user may disable all deprecated features entirely by providing the
string "none" as the argument to this parameter, or enable all
deprecated features, including those slated for removal, by providing
the string "all" as the argument to this parameter. In the case that
"all" or "none" is specified, multiple invocations of `-allowdeprecated`
are not permitted.

To explicitly enable only a specific set of deprecated features, use
`-allowdeprecated=<flag1> -allowdeprecated=<flagN> ...` when starting
zcashd. The following flags are recognized:

- "all" - enables all deprecated features.
- "none" - disables all deprecated features.
- "legacy_privacy" - enables the use of the deprecated "legacy" privacy
  policy for z_sendmany. This causes the default behavior to conform to
  the `FullPrivacy` directive in all cases instead of just for
  transactions involving unified addresses.
- "getnewaddress" - enables the `getnewaddress` RPC method.
- "z_getnewaddress" - enables the `z_getnewaddress` RPC method.
- "zcrawreceive" - enables the `zcrawreceive` RPC method.
- "zcrawjoinsplit" - enables the `zcrawjoinsplit` RPC method.
- "zcrawkeygen" - enables the `zcrawkeygen` RPC method.
- "addrtype" - when this option is set, the deprecated `type` attribute
  is returned in addition to `pool` or `address_type` (which contain the
  same information) in the results of RPC methods that return address metadata.
2022-04-28 15:20:05 -06:00
Larry Ruane c5752c7ea2 Allow rpc python tests to be run standalone
That is, without having to launch with test_runner.py. There are
several places where the BITCOIND environment variable determines the
executable, but the default is "bitcoind"; change the default to
"src/zcashd". This does require running the test from the top-level
directory.

Also change the environment variable from BITCOIND to ZCASHD. This could
conceivable break someone, but it just makes too much sense not to do.
2022-04-26 15:06:31 -06:00
Kris Nuttycombe 57d9d9ee05 Update boost dependencies to version 1.79.0 2022-04-14 13:31:14 -06:00
Kris Nuttycombe f8f698086b qa: postpone native_clang, libcxx, boost, and native_b2 upgrades before 4.7.0 release 2022-04-13 20:49:32 -06:00
sasha cf4de9d03d
Merge pull request #5741 from zcash/nu5-consensus
NU5 consensus changes; merge requested by @nuttycom
2022-04-13 18:09:21 -07:00
Kris Nuttycombe 9ca0a41cf7 Update protocol version to 170050 for v4.7.0 release. 2022-04-13 08:22:56 -06:00
sasha d153f27f52 fix smoke_tests.py accounting math to remove the warning before test 4r
the warning before test 4r is generated by the check_z_mergetoaddress
at line 459, which moves all the sapling funds into taddr_2 and thus
expects (sapling_balance - DEFAULT_FEE) to show up into taddr_2.

However, the check_z_mergetoaddress_parallel at line 418 had already
funded taddr_2 (with the sum of taddr_1 and taddr_3), and so we need to
add that to the amount of money that check_z_mergetoaddress at line 459
expects to find.
2022-04-12 23:21:38 -07:00
sasha ce6e8fd5f4 add walletrequirebackup=false to the zcash argument list in smoke_tests.py 2022-04-11 13:16:41 -07:00
Jack Grigg b01fe74161 qa: Update Berkeley DB release listener regex
Oracle have altered their downloads page to not list the actual download
filename, so we now extract the version from the changelog URL.
2022-04-09 14:43:32 +00:00
Kris Nuttycombe 866b3c7900 Merge remote-tracking branch 'upstream/master' into nu5-consensus_merge-master 2022-04-08 21:08:39 -06:00
Kris Nuttycombe 0f9868ef14
Merge pull request #5852 from nuttycom/bug/consistent_finalstate_encoding
Make Orchard finalState serialization format match Sapling.
2022-04-08 21:07:37 -06:00
Kris Nuttycombe f86a65d7cb Make Orchard `finalState` serialization format match Sapling.
For consistency, we serialize the `finalState` field in the
same (sparse) encoding as Sapling and Sprout use. In the future
we may want to update this to the dense encoding that
incrementalmerkletree::bridgetree::Frontier uses, but that's not
necessary for the moment.
2022-04-08 19:48:40 -06:00
Kris Nuttycombe b38189adcd
Merge pull request #5791 from therealyingtong/z_listaccounts
Add z_listaccounts API.
2022-04-08 15:30:57 -06:00
Kris Nuttycombe f98b2393a1 Fix error in z_listaccounts help text. 2022-04-08 13:06:41 -06:00
Jack Grigg c4006a7f24 qa: Postpone update to Rust 1.60
Rust 1.60 migrates to LLVM 14, and we want to keep our Clang and Rust
compilers on matching LLVM versions.
2022-04-07 15:01:26 +00:00
Kris Nuttycombe 369fc78e0b Use DEFAULT_FEE consistently in wallet_unified_change test
This fixes a nondeterministic error where zero-fee transactions
may be excluded due to minimum-block-size rules.
2022-04-07 08:57:48 -06:00
Kris Nuttycombe dada8b38bc Add 'AllowRevealedAmounts' in tests where it is now necessary. 2022-04-07 08:47:47 -06:00
Kris Nuttycombe 51defe9f96 Make all privacy policy checks after note selection.
This adds tests to wallet_z_sendmany that demonstrates conditions
where pool-crossing transfers were not being caught by the privacy
policy checks, which were validating only against the transfer
request rather than the actual transfer selected. This missed
cases where sending funds between unified addresses would reveal
amounts via the turnstile.

Making all privacy policy checks after note selection guards against
this error.
2022-04-07 08:47:47 -06:00
therealyingtong dcc2a68682 Inline z_listaccounts check in wallet_accounts.py 2022-04-07 18:06:41 +08:00
Kris Nuttycombe a48aa0195c Add logging to the miner to provide more detail on tx selection. 2022-04-05 20:47:37 -06:00
Kris Nuttycombe 1d2f1d6689 Add a test demonstrating that change may cross the pool boundary without permission. 2022-04-05 18:16:57 -06:00
Kris Nuttycombe 5b7370c55e Update test to verify rewind behavior. 2022-04-04 13:05:42 -06:00
Kris Nuttycombe d9de6b64fc Adds a test demonstrating an Orchard wallet initialization bug.
If a new Orchard wallet is created after the first Orchard spend
post NU5 activation, it causes an assertion failure because the root
of the wallet's empty note commitment tree does not match the global
note commitment tree root.
2022-04-04 12:04:32 -06:00
Steven c8e0503c69
Merge pull request #5797 from nuttycom/feature/z_listunspent_account
Add account ID to z_listunspent results.
2022-04-04 07:17:53 -07:00
Kris Nuttycombe 0a0ac9989e Add a test demonstrating that z_listaddresses reveals internal addrs. 2022-04-01 12:46:55 -06:00
Kris Nuttycombe 0a5dbc10d4 Add account ID to z_listunspent results.
Fixes #5795
2022-04-01 10:02:13 -06:00
Kris Nuttycombe f7b11f6da1
Merge pull request #5775 from nuttycom/feature/orchard_list_unspent
Add Orchard support to z_listunspent.
2022-04-01 07:39:25 -06:00
Jack Grigg e5756cc198 qa: Add test for Orchard support in `z_listunspent` 2022-04-01 02:44:56 +00:00
Kris Nuttycombe 866278f79a Merge remote-tracking branch 'upstream/master' into nu5-consensus_merge-master 2022-03-31 20:29:28 -06:00
str4d fbd2912885 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
2022-03-31 16:07:05 +00:00
Jack Grigg 0255964559 qa: Add RPC test testing Orchard note position persistence
The test fails during the final `z_sendmany`, because it is selecting a
note that was detected before restarting the node. Because we force the
wallet to call `SetBestChain` on every block, the wallet doesn't need to
rescan on restart, and thus doesn't repopulate the `position` field of
the in-memory note.

This issue went unnoticed in existing tests that exercise node restarts,
because the RPC tests are fast enough that they never pass the 10-minute
timeout for writing the wallet state. This commit adds a regtest-only
config option that disables the lazy writing.
2022-03-30 23:23:27 +00:00
Kris Nuttycombe 53cc7ecceb Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-30 10:10:28 -06:00
Kris Nuttycombe 72b27fb906 Add independent wallet persistence tests.
Co-authored by: @therealyingtong
2022-03-30 08:27:41 -06:00
sasha 9befdb2c45
Merge pull request #5767 from daira/postpone-deps
Postpone native_clang and libcxx 14.0.0; admin merge as requested by @nuttycom
2022-03-29 11:12:02 -07:00
Kris Nuttycombe 72e7d2b83f
Merge pull request #5765 from nuttycom/doc/rpc_release_notes
Update release notes to include all RPC changes since 4.6.0
2022-03-29 11:25:55 -06:00
Daira Hopwood 5abe1b82b4 Postpone native_clang and libcxx 14.0.0.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-29 17:02:47 +01:00
Daira Hopwood c28b004256 qa/zcash/updatecheck.py: print status code and response of failed http requests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-29 17:02:32 +01:00
Kris Nuttycombe db315fd693 Update release notes to include all RPC changes since 4.6.0
This also corrects some minor errors in the help text for
a few of the RPC methods.
2022-03-29 09:41:03 -06:00
Marshall Gaucher 0ba5ccaa79
Merge pull request #5746 from defuse/do-not-print-exceptions
Only send exceptions to the log, not stderr
2022-03-29 07:10:10 -07:00
Kris Nuttycombe a574f6042b
Merge pull request #5759 from nuttycom/fix/restore_imported_addrs
Ensure that legacy imported addresses are properly restored to the wallet.
2022-03-29 07:33:36 -06:00
Kris Nuttycombe e8f23e3629 Add a test verifying the default addr is added when importing a Sapling key. 2022-03-28 19:47:19 -06:00
Kris Nuttycombe ad97298637 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-28 19:46:21 -06:00
Kris Nuttycombe 0b8ee33bbd Add an RPC test that attempts a double-spend. 2022-03-28 19:46:21 -06:00
Kris Nuttycombe 0daa540128 Merge remote-tracking branch 'upstream/master' into nu5-consensus 2022-03-28 10:13:51 -06:00
Daira Hopwood dfea6c69d2 Repair `feature_zip239` RPC test by checking the debug log of node 0 rather than its stderr.
Since we no longer redirect stderr, this will correctly fail if stderr has unexpected output.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-27 08:37:03 +01:00
Steven Smith e375f4ace2 Remove the fExperimentalOrchardWallet flag and related logic 2022-03-25 21:46:09 -07:00
Kris Nuttycombe 9f4e5ef2cc Add test for rollback of an Orchard spend. 2022-03-25 15:10:42 -06:00
Kris Nuttycombe dc4afca405 Correctly return p2pkh/p2sh labels for z_listunifiedreceivers 2022-03-25 10:44:18 -06:00
Kris Nuttycombe 8630891c5a Improve consistency of RPC parameter and result attribute naming.
Make consistent use of "pool", "address type" and "receiver type",
in RPC documentaion, and deprecate bare uses of "type" in RPC APIs.

Fixes #5534

Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-25 10:44:18 -06:00
Kris Nuttycombe 881e0f2ca8 Rename unifiedaddress->address in z_getaddressforaccount results
Fixes #5432
2022-03-25 08:29:56 -06:00
Jack Grigg ac7dd3acca qa: Remove pinned action indices from wallet_listreceived
Orchard output ordering is no longer deterministic, as we now shuffle
spends and outputs during bundle building. But we _can_ still check that
the action index of a note being spent is correct.
2022-03-23 20:56:22 +00:00
Jack Grigg 165901c654 qa: Remove hard-coded consensus branch IDs from RPC tests
Also fixes a bug in the `nuparams` helper, which would have caused MSB
zeroes in consensus branch IDs to not be rendered in the `-nuparams`
option. This hadn't been encountered because we haven't yet generated a
consensus branch ID with a zero MSB.
2022-03-23 20:28:31 +00:00
Jack Grigg e5210d50c9 Set NU5 protocol version for regtest to 170040, bump protocol version
We need to bump the `zcashd` protocol version because the new rules are
not compatible with existing rules followed by 170015 nodes, but we
_also_ need to ensure we can still bump it again once we set the testnet
reactivation height (changing node network behaviour again). This commit
also enables RPC tests to run (because previously the nodes considered
each other to be too old for NU5 to be active, and were disconnecting).
2022-03-23 18:37:56 +00:00
Jack Grigg 9e9f58b26f Merge branch 'master' into unify-nu5-consensus-changes 2022-03-23 02:57:16 +00:00
Jack Grigg 77a971fbc1 Migrate to latest `zcash/librustzcash` revision
This includes:
- `orchard =0.1.0-beta.3` which includes the final circuit changes.
- The new NU5 consensus branch ID.
- Updated ZIP 244 test vectors (which use the NU5 consensus branch ID).
2022-03-23 02:05:06 +00:00
Jack Grigg 479b10364b qa: Exclude `native_libtinfo` from dependency update checks
We are pinning a specific version to get Arch builds working.
2022-03-22 19:33:14 +00:00
Jack Grigg e576f6616f Fix bugs in wallet_addresses RPC test
- The legacy_random source should only contain Sprout addresses (as
  zcashd now only derives transparent addresses from the mnemonic seed).
- Sapling addresses should appear in the mnemonic_seed source, not the
  legacy_seed source (as zcashd no longer ever generates keys there).

The RPC test also now has several additional checks:

- `listaddresses` does not return duplicate addresses (an address can
  only come from a single source).
- Address sets are now explicitly checked (to ensure that there are no
  unexpected addresses under the checked sources).
2022-03-22 14:55:39 +00:00
Larry Ruane e575e0f217 update listaddresses RPC for UAs, Orchard
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-03-22 14:55:17 +00:00
Kris Nuttycombe ba3594f9ee Uncomment addtional tests that depend on z_viewtransaction. 2022-03-19 12:11:27 -06:00
Kris Nuttycombe b32c8d3f0f Fix missing AllowRevealedSenders flag in test. 2022-03-18 21:41:38 -06:00
Kris Nuttycombe fabff30d88
Merge pull request #5700 from nuttycom/5186-updates-to-z_viewtransaction
Add Orchard and Unified Address support to z_viewtransaction
2022-03-18 17:19:31 -06:00
Kris Nuttycombe 2d673ca704 Update z_viewtransaction documentation to correctly represent field names. 2022-03-18 11:05:48 -06:00
Kris Nuttycombe 0c977076bc Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-18 08:34:27 -06:00
Steven Smith e1e480e9c4 Ensure z_viewtransaction returns Orchard details 2022-03-18 08:31:51 -06:00
Steven Smith 445f4de0f4 Add Orchard & unified address support to z_viewtransaction.
Fixes #5186
2022-03-18 08:31:48 -06:00
Kris Nuttycombe 28210791a1
Merge pull request #5693 from str4d/z_sendmany-privacy-policy
z_sendmany: Replace `allowRevealedAmount` with `privacyStrategy`
2022-03-18 08:09:43 -06:00
Jack Grigg 65cb79e023 z_sendmany: Expand `privacyPolicy` cases
We now have a full roster of privacy policies. We can graph the
relationships between the policies; arrows point from more-private to
less-private, and each policy is permitted to reveal information covered
by all policies pointing to it (in addition to the extra information it
is permitted to reveal).

                       FullPrivacy
                            v
                   AllowRevealedAmounts
                        v           v
    AllowRevealedRecipients   ---- AllowRevealedSenders
               v             /               v
     AllowFullyTransparent <-  AllowLinkingAccountAddresses
                        v       v
                        NoPrivacy

The synthetic `LegacyCompat` policy now uses the `AllowFullyTransparent`
policy for backwards compatibility, and the `FullPrivacy` policy if the
sender or recipients involve Unified Addresses.

Closes zcash/zcash#5677.
Closes zcash/zcash#5678.
2022-03-18 02:45:23 +00:00
Jack Grigg 1505121877 z_sendmany: Replace `allowRevealedAmount` with `privacyStrategy`
This replaces the bool argument with a string argument, enabling us to
add additional privacy strategies. We also alter the default to be
backwards-compatible with existing RPC method usage, by only enabling
the strongest checks if a Unified Address is involved.

Closes zcash/zcash#5676.
2022-03-18 00:58:13 +00:00
Kris Nuttycombe 80324bc653 Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard-merge_master 2022-03-17 16:52:49 -06:00
str4d 12b37d5a11
Merge pull request #5665 from str4d/5657-z_sendmany-orchard-spends
Add support for sending Orchard funds in `z_sendmany`
2022-03-16 18:12:56 +00:00
ying tong 1cd92e579c Style improvements in RPC tests.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-15 16:22:05 -06:00
therealyingtong c1cd8a7e2d Adapt RPC tests to use z_getbalance for UAs. 2022-03-15 16:22:05 -06:00
Jack Grigg c2220f4eb9 Add support for sending Orchard funds in `z_sendmany`
Closes zcash/zcash#5665.
2022-03-15 19:53:30 +00:00
Daira Hopwood 6ee6692c83 qa/zcash/full_test_suite.py: enable `test_rpath_runpath` for Rust binaries, and
reenable `test_fortify_source` for C++ binaries.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-14 08:05:59 +00:00
Kris Nuttycombe f5b23b3336 Modify `join_network` in tests to skip mempool resync.
Prior to this change, calling `join_network` after a network split
only worked in the case that no new non-coinbase transactions were
created during the network partition; in the case that such a
transaction was created, `join_network` would fail when waiting
for mempool synchronization, because zcashd nodes do not.
automatically broadcast their mempool contents on restart.

This change modifies `setup_network` to wait for mempool synchronization
or not on the basis of a newly added do_mempool_sync flag. In the
case of `join_network`, this flag is set to `False`; the default value
is set to `True` to preserve previous functionality elsewhere.

Tests should explicitly use the `resendwallettransactions` RPC method
to ensure that mempool transactions are rebroadcast before attempting
to synchronize the network after a `join_network` call.
2022-03-11 22:39:06 -07:00
Kris Nuttycombe 8bf99eaacc Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard-merge_master 2022-03-09 22:17:49 -07:00
Kris Nuttycombe ca34a97a37 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-09 13:26:10 -07:00
Kris Nuttycombe 98ee3bd733 Update tests with rollback checks. 2022-03-09 09:26:37 -07:00
sasha ced825edec
Merge pull request #5587 from nuttycom/feature/wallet_orchard-record_spends 2022-03-08 18:38:47 -08:00
str4d 7129827509
Merge pull request #5601 from str4d/feature/wallet_orchard-shielded_coinbase
Select Orchard receivers from UA miner addresses once NU5 activates
2022-03-08 15:32:32 +00:00
Kris Nuttycombe c3cf141936 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-07 19:11:43 -07:00
Kris Nuttycombe 6171f27b02 Add a test for Orchard note detection.
We can't actually test rollback via RPC tests until
wallet persistence is implemented. This implements
a rollback scenario that will should pass after wallet
persistence is implemented.
2022-03-07 19:05:00 -07:00
str4d 13351ff31d
Merge pull request #5609 from str4d/bump-deps-4.7.0-rc1
Bump dependencies ahead of 4.7.0-rc1
2022-03-05 13:37:28 +00:00
Kris Nuttycombe cf4d0f3d2d Add test for Orchard contribution to z_gettotalbalance 2022-03-03 17:41:30 -07:00
Jack Grigg 3fa58149b0 Select Orchard receivers from UA miner addresses once NU5 activates
Closes zcash/zcash#5023.
2022-03-03 15:57:40 +00:00
Jack Grigg 9a60cdeed9 Add RPC test for the Orchard commitment tree bug on first NU5 testnet 2022-03-03 13:36:42 +00:00
therealyingtong cedf2b5ecb wallet_sendmany_any_taddr.py: Expect expired tx to be ignored. 2022-03-03 01:31:32 +08:00
therealyingtong 98cd4bab0b wallet_sendmany_any_taddr.py: Test sending output from expired tx. 2022-03-03 01:31:32 +08:00
Kris Nuttycombe bd50fbbb94 Filter returned Orchard notes by minimum confirmations. 2022-03-01 16:30:29 -07:00
therealyingtong 4a8bdabb2f wallet_sendmany_any_taddr.py: Test sending from a change taddr. 2022-03-01 11:33:54 +08:00
Jack Grigg 21430b13ac depends: Update Rust to 1.59.0 2022-03-01 00:09:18 +00:00
Jack Grigg adb7d074d5 qa: Postpone recent CCache release 2022-03-01 00:05:01 +00:00
Jack Grigg 4c49af7750 qa: Bump all postponed dependencies
We have a pending PR to address the `native_ccache` and `googletest`
dependencies, and we aren't going to touch `bdb`.
2022-03-01 00:03:42 +00:00
Jack Grigg d4078c8d25 Select Orchard receivers preferentially from UAs
The addition of `OrchardRawAddress` to `RecipientAddress` drives most of
the changes in this commit, which enable `z_sendmany` to send funds to
addresses in the Orchard pool once NU5 activates.
2022-02-25 00:52:52 +00:00
Jack Grigg bb4e792c84 Merge branch 'master' into feature/wallet_orchard-orchard_sendmany 2022-02-25 00:33:28 +00:00
Jack Grigg b0769e3f1d Add Orchard to default UA receiver types
We also add Orchard-specific information to several RPCs in order for
tests to pass:

- `z_listunifiedreceivers`
- `z_getbalanceforaccount`
- `z_getbalanceforviewingkey`
2022-02-24 02:17:52 +00:00
Larry Ruane ba9e020fcd add functional test 2022-02-17 16:47:59 -07:00
Larry Ruane 698f7ba770 z_listreceivedbyaddress: reject UA component addr (#5537) 2022-02-15 09:19:09 -07:00
sasha e568a190f3
Merge pull request #5419 from zcash/feature/wallet_unified_addresses 2022-02-14 08:17:36 -08:00
Kris Nuttycombe b1ab30c8d9 Rename sapling-specific zip32 FFI methods.
Also addresses a couple of other minor comments from code review.
2022-02-12 15:24:48 -07:00
Larry Ruane 326dafeebe fix wallet_listreceived.py, add blockdata to taddr output 2022-02-12 13:01:58 -07:00
Kris Nuttycombe 007f05493a Add change field to z_listreceivedbyaddress for transparent addrs.
This updates the `IsChange` method to check the HD keypath associated
with the key for whether the address was generated as internal
or external.
2022-02-11 12:48:35 +00:00
Larry Ruane c48e35bb66 Update z_listreceivedbyaddress to support unified addresses (5467) 2022-02-11 12:48:23 +00:00
Jack Grigg 89b9bbaf33 wallet: Separate counters for external and internal transparent keys
This fixes a potential bug with importing the mnemonic into a third
party transparent wallet. Previously, if a user called `getnewaddress`,
made a bunch of transactions that generated at least 20 change
addresses, and then called `getnewaddress` again, the two external
addresses would be separated by a gap of more than 20. If this mnemonic
were imported into a third party transparent wallet, the wallet would
not detect any funds in the second (or subsequent) transparent addresses
because it would detect 20 unused addresses in a row (via the BIP 44
default gap limit).

Now, we track external and internal keys separately; repeated calls to
`getnewaddress` will return addresses for sequential keys. This has the
added benefit that the sequence of `getnewaddress` outputs will be the
same after restoring from a backup.
2022-02-10 21:26:29 +00:00
Jack Grigg 11e62fa997 wallet: Remove `CWallet::GetKeyFromPool`
Legacy transparent addresses for external use are now obtained directly
via `GenerateNewKey(true)`.
2022-02-10 21:26:29 +00:00
Kris Nuttycombe 2aad87e147
Merge pull request #5526 from str4d/wallet-unified-addrs-in-rpcs
Handle wallet Unified Addresses in RPCs
2022-02-09 21:11:41 -07:00
Jack Grigg 88dde127f4 wallet: Show UAs instead of Sapling receivers in `z_listunspent`
We also add a `type` field to the output objects (matching the field in
`z_viewtransaction`), now that the output type can't be distinguished
solely from the address encoding.
2022-02-10 02:32:56 +00:00
Kris Nuttycombe bf79be2b57 Replace z_getbalanceforaddress with z_getbalanceforviewingkey 2022-02-09 16:58:55 -07:00
str4d 9439c79bab
Merge pull request #5469 from nuttycom/feature/wallet_unified_addresses-z_sendmany
Add support for unified addresses to z_sendmany
2022-02-08 23:42:59 +00:00
Kris Nuttycombe 3f84067658 Fix nondeterministic test failure in wallet_listreceivedby.py 2022-02-08 14:18:18 -07:00
Kris Nuttycombe 1890758b27 Apply suggestions from code review.
Co-authored-by: str4d <thestr4d@gmail.com>
2022-02-08 10:59:15 -07:00
Kris Nuttycombe cf271473eb Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <thestr4d@gmail.com>
2022-02-07 16:52:31 -07:00
Kris Nuttycombe 13ee447a42 Merge branch 'test_wallet_listreceived' into feature/wallet_unified_addresses-z_sendmany 2022-02-07 15:08:35 -07:00
Kris Nuttycombe fa0d4eb473 Use z_shieldcoinbase for Sprout funds in wallet_listreceived tests.
After release 4.7.0, z_sendmany will no longer support sending
funds to Sprout. By using z_shieldcoinbase, we can avoid this
limitation.
2022-02-07 15:06:19 -07:00
Larry Ruane 1e165b8396 allow UA as z_shieldcoinbase destination 2022-02-03 08:31:26 -07:00
zancas ca04cb0a58
All implementations of ComparisonTestFramework were overriding num_nodes
Moreover, they were all overriding it to the same value (1).
Set the default to 1 and remove redundant subclass constructor code.
2022-02-01 10:27:16 -07:00
zancas 4dce020678
enforce usage of the get_tests comptool interface as ComparisonTestFramework method
In practice all-and-only subclasses of ComparisonTestFramework implement get_tests.
This commit enforces this relation.
2022-02-01 10:27:10 -07:00
Kris Nuttycombe 214567be2c Add a few additional cases to z_sendmany RPC tests. 2022-02-01 08:24:31 -07:00
Kris Nuttycombe a0c27bf254 Address TODOs in rpc-tests/wallet-accounts.py 2022-02-01 08:24:31 -07:00
Kris Nuttycombe 9afea4f10b Add failing tests for z_sendmany ANY_TADDR -> UA and UA -> <legacy_taddr> 2022-01-30 11:07:00 -07:00
Kris Nuttycombe 71f17fa05c Add a check for internal vs. external outputs to wallet_listreceived test. 2022-01-27 21:29:40 -07:00
str4d 992a47103d
Merge pull request #5500 from str4d/ua-wallet-balance-rpcs
Implement balance RPC methods that support Unified Addresses
2022-01-27 20:11:38 +00:00
Kris Nuttycombe d17a0bb9de Merge remote-tracking branch 'upstream/master' into feature/wallet_unified_addresses 2022-01-25 20:27:33 -07:00
Jack Grigg 756f4fc840 wallet: Implement `z_getbalanceforaddress`
Closes zcash/zcash#5182.
2022-01-26 00:34:45 +00:00
Jack Grigg ca0dad0a8c wallet: Implement `z_getbalanceforaccount`
Closes zcash/zcash#5183.
2022-01-25 23:54:30 +00:00
Kris Nuttycombe 28eddb7c21
Merge pull request #5474 from LarryRuane/2022-01-disable-sprout-addr-gen
rpc: Disable Sprout address generation at Canopy #5368
2022-01-25 10:05:44 -07:00
Charlie O'Keefe 19bfc2f3b8
Merge pull request #5463 from zingolabs/drop_pyblake2_dep
Drop pyblake2 dependency
2022-01-25 09:32:08 -07:00
Kris Nuttycombe c4a74087b7 Modify CWallet::FindSpendableInputs to use ZTXOSelector 2022-01-24 13:10:31 -07:00
str4d a6f9c9c0bc Merge pull request #5458 from nuttycom/cleanup/sendmany_txbuilder
Use the transaction builder to implement z_sendmany.
2022-01-21 20:14:58 -07:00