Commit Graph

16333 Commits

Author SHA1 Message Date
Kris Nuttycombe b78c2732ab Record when notes are detected as being spent in the Orchard wallet. 2022-03-07 19:04:58 -07:00
Kris Nuttycombe 5c049b6b13 Fix missing locks for GenerateNewUnifiedSpendingKey tests. 2022-03-07 19:03:02 -07:00
Kris Nuttycombe 8bc4c2aad8 Split LoadWalletTx from AddToWallet
The `CWallet::AddToWallet` method had completely divergent
behavior depending upon the value of the fFromLoadWallet
flag, and `pwalletdb` was unused when this flag was set
to `true`, so this is better represented as two distinct
methods on CWallet.
2022-03-07 19:03:00 -07:00
Kris Nuttycombe f7006e9a33
Merge pull request #5592 from superbaud/gtest-ordering-fixes
fix ordering issues with gtests: WalletZkeysTest, ContextualCheckBlockTest, CheckBlock, Metrics.GetLocalSolPS
2022-03-07 18:54:16 -07:00
Kris Nuttycombe 237384cf2b Update incrementalmerkletree version 2022-03-07 18:32:58 -07:00
Kris Nuttycombe 5a6ef3467e Update MSRV for lints. 2022-03-07 18:21:37 -07:00
Daira Hopwood 9b20105413 Tweak the wording of the fallback messages when the terminal cannot be automatically cleared.
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 19:34:31 +00:00
Daira Hopwood 6fb943d0f6 Refactor use of `export_path` as suggested.
Co-authored-by: Sean Bowe <sean@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 19:33:27 +00:00
Daira Hopwood e940829313 The recovery phrase confirmation and `zcashd-wallet-tool` are being introduced in zcashd v4.7.0.
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 19:32:51 +00:00
Daira Hopwood 6f5efcbb0f Improved error handling.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 18:39:23 +00:00
Daira Hopwood 25792cba93 Move `wallet_tool.rs` from `src/rust/src` into `src/rust/bin`.
Also add a brief description of `zcashd-wallet-tool` to `src/rust/README.md`.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 18:39:23 +00:00
Daira Hopwood 8ec0d854b9 Add some text about choosing location of the physical backup.
Add TODO for better handling of file not found and permission errors.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 18:39:23 +00:00
Daira Hopwood de933c1cb5 Attempt to fix linking problem on ARM.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 18:39:23 +00:00
Daira Hopwood a36fceca70 Make a zcashd-wallet-tool executable.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 18:39:23 +00:00
Steven Smith 7f7d9e6e1f Extend uniqueness check in z_sendmany to UA receivers 2022-03-06 21:24:14 -08:00
sasha f1d652fc78 Call LoadProofParameters() in gtests that need proofs 2022-03-05 21:51:27 -08:00
sasha 8f68166c24 move proof parameter loading out of gtest/main.cpp and into utiltest.cpp 2022-03-05 21:51:27 -08:00
sasha 0e6b004a64 make librustzcash_init_zksnark_params idempotent 2022-03-05 21:51:27 -08: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
Jack Grigg fdb5709e7e depends: Revert to `libc++ 13.0.0-3` for Windows cross-compile
The 13.0.1-1 MSYS2 binaries cause linker errors due to missing `new` and
`delete` symbols. This commit partially reverts the LLVM 13.0.1 upgrade:
Windows cross-compilation still uses `clang 13.0.1`, but is compiled
against `libc++ 13.0.0`.
2022-03-05 03:53:13 +00:00
Jack Grigg 9d5d781a15 libzcash_script: Add more granular errors to the new APIs 2022-03-04 21:36:24 +00:00
str4d 414e74f70a
Merge pull request #5629 from nuttycom/feature/wallet_orchard-minconf_filter
Respect minDepth argument for Orchard notes in GetFilteredNotes
2022-03-04 03:18:52 +00:00
Kris Nuttycombe 6540694845 Respect minDepth argument for Orchard notes in GetFilteredNotes
Fixes #5566
2022-03-03 17:41:30 -07:00
Kris Nuttycombe cf4d0f3d2d Add test for Orchard contribution to z_gettotalbalance 2022-03-03 17:41:30 -07:00
Charlie O'Keefe e33178615c
Merge pull request #5581 from LarryRuane/2022-02-log-getblocktemplate
Log calls to getblocktemplate
2022-03-03 15:56:34 -07:00
Charlie O'Keefe c2b5bf0c42
Merge pull request #5622 from nuttycom/logging/sapling_note_witnesses
Log outpoint for failed Sapling witness lookup.
2022-03-03 15:21:10 -07:00
str4d d4a019e89b
Merge pull request #5621 from nuttycom/test/orchard_tree_ser_roundtrip
Add a roundtrip test for Orchard merkle frontier serialization from the C++ side.
2022-03-03 21:56:41 +00:00
Jack Grigg 8b90d32972 rpc: Handle keypool exhaustion separately in `generate` RPC
A prior commit moved the `IsValidMinerAddress()` call before the keypool
exhaustion check, but `IsValidMinerAddress()` internally handles keypool
exhaustion. We now check it explicitly first to retain the prior error
behaviour (as checked in the `keypool` RPC test).
2022-03-03 21:10:44 +00:00
Kris Nuttycombe 8b44cc7072 Add a roundtrip test for Orchard merkle frontier serialization from the C++ side.
Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-03 11:04:40 -07:00
Kris Nuttycombe ceff068e20
Merge pull request #5625 from therealyingtong/orchard-remove-with-anchor
Orchard: invalidate mempool transactions that use orphaned anchors.
2022-03-03 10:58:08 -07:00
Jack Grigg 613534bbb3 miner: Manually add dummy Orchard output with Orchard miner address
`orchard::Builder` pads to two Actions, but does so using a "no OVK"
policy for dummy outputs, which violates coinbase rules requiring all
shielded outputs to be recoverable. We manually add a dummy output to
sidestep this issue.
2022-03-03 15:57:40 +00: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 1c31a1c7d8 Use `std::optional` in `CValidationInterface::GetAddressForMining`
The initial value for the provided return value is now `std::nullopt`
instead of the default value of the `MinerAddress` variant. This makes
it easier to distinguish "no miner address was provided" from "invalid
miner address".
2022-03-03 15:57:40 +00:00
Kris Nuttycombe 1732a50957
Merge pull request #5624 from str4d/fix-nu5-testnet-bug
Test and fix for chain forks on NU5 testnet
2022-03-03 08:29:40 -07:00
Daira Hopwood 5990853de3
Merge pull request #5623 from str4d/nu5-fix-orchard-commitment-tree-bugs
Fix for chain forks on NU5 testnet
2022-03-03 15:21:58 +00:00
Kris Nuttycombe fd2f5bdc28
Merge pull request #5610 from therealyingtong/debug-any-taddr
Ignore expired transactions in `CWallet::FindSpendableInputs`.
2022-03-03 08:08:06 -07:00
Kris Nuttycombe 65b5b7509c
Merge pull request #5612 from ebfull/feature/persist_orchard_keys
Recover orchard keys and mappings during wallet load
2022-03-03 07:47:16 -07:00
Jack Grigg 35b8c8648f Merge branch 'nu5-fix-orchard-commitment-tree-bugs' into fix-nu5-testnet-bug 2022-03-03 13:36:45 +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
Jack Grigg ae3d2a3525 Add missing `view.PopAnchor(_, ORCHARD)` in `DisconnectBlock`
By forgetting to pop the tree, we were leaving the view in an
inconsistent state, where it believed the best Orchard anchor was for a
tree that didn't correspond to the rest of the view. This would then
propagate in subsequent block connections, and the chain history
commitments to Orchard tree roots eventually result in inconsistent
`blockcommitments` values in subsequent blocks.
2022-03-03 13:26:48 +00:00
Jack Grigg 2230ba912f Ensure the view's best Orchard anchor matches the previous block
`ConnectBlock` was already checking that the given view's "best block"
was the previous block. However, it then assumed the view was correct on
its claimed best anchors.

For Orchard, we know that `hashFinalOrchardRoot` field of `CBlockIndex`
will only ever be set when a block is (attempted to be) connected to the
main chain, and so we can instead add assertions around its value and
ensure the view is consistent with the previous block.
2022-03-03 13:26:48 +00:00
therealyingtong dbb7e027c8 Orchard: invalidate mempool transactions that use orphaned anchors. 2022-03-03 17:37:07 +08:00
Sean Bowe bd137561f2
wallet: add logging for failure cases in unified cache loading 2022-03-02 16:24:08 -07:00
Kris Nuttycombe 681505e9d6 Log outpoint for failed Sapling witness lookup. 2022-03-02 16:00:15 -07:00
sasha 2e52c1623d gtests ordering: clean up wallet files before each WalletZkeysTest
This allows us to use --gtest_repeat= on the WalletZkeysTest group,
otherwise, each test will reuse its previous iteration's wallet file,
causing assertions to be invalidated.

We put the RemoveDb at the beginning of each test because putting it
at the end of the test means it doesn't get run if the test fails.
This would lead to a single failed test causing every instance of that
test thereafter to fail (since it uses the same temporary directory).

The dummyWallet.LoadWallet() ensures that CDB is initialized, otherwise
bitdb.RemoveDb causes the error:
"BDB1565 DB_ENV->dbremove: method not permitted before handle's open
method"
2022-03-02 13:24:55 -08:00
sasha 902187368e gtests ordering: make Metrics.GetLocalSolPS idempotent
we use our new AtomicTimer::zeroize() to reset the miningTimer and
solutionTargetChecks.decrement() thrice to get it back to original value
2022-03-02 11:29:09 -08:00
sasha 0e13aba1b7 implement AtomicTimer::zeroize() that resets start_time and total_time 2022-03-02 11:29:09 -08:00
Sean Bowe c5b87ba163
wallet: rather than assert, error in case of inconsistency between FVK and address 2022-03-02 11:05:04 -07:00
therealyingtong cedf2b5ecb wallet_sendmany_any_taddr.py: Expect expired tx to be ignored. 2022-03-03 01:31:32 +08:00
therealyingtong 454c1eed46 FindSpendableInputs: Add nDepth < 0 check.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2022-03-03 01:31:32 +08:00