Commit Graph

15994 Commits

Author SHA1 Message Date
Kris Nuttycombe 98ee3bd733 Update tests with rollback checks. 2022-03-09 09:26:37 -07:00
Kris Nuttycombe dc1609094d Restore decrypted notes to the wallet. 2022-03-09 09:26:37 -07:00
Kris Nuttycombe 0149451217 Persist Orchard action index/IVK mappings in CWalletTx 2022-03-09 09:26:37 -07:00
Kris Nuttycombe ecd0d24baa Update walletTx with decrypted Orchard action metadata. 2022-03-09 09:26:37 -07:00
Kris Nuttycombe 46c33c68e0
Merge pull request #5642 from nuttycom/feature/wallet_orchard-fix_confirmations
Set number of confirmations & respect maxDepth in Orchard note selection.
2022-03-09 07:58:27 -07:00
therealyingtong 26b8ec5562 coins_tests: Update tests to include Orchard case.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2022-03-09 22:52:39 +08:00
therealyingtong 663f8d434a coins_tests.cpp: Add Orchard nullifier to TxWithNullifiers().
Closes zcash/zcash#5240

Co-authored-by: Jack Grigg <jack@electriccoin.co>
2022-03-09 22:20:46 +08:00
Kris Nuttycombe 38f4afa80c Set number of confirmations for Orchard notes returned by FindSpendableInputs 2022-03-08 22:03:24 -07:00
Kris Nuttycombe 3b5fc4e583 Respect maxDepth for Orchard notes in GetFilteredNotes 2022-03-08 22:00:30 -07:00
sasha ced825edec
Merge pull request #5587 from nuttycom/feature/wallet_orchard-record_spends 2022-03-08 18:38:47 -08:00
Kris Nuttycombe 19ce19155c Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-08 16:27:06 -07:00
Kris Nuttycombe 9284c5552b Track mined-ness instead of spent-ness of notes in the Orchard wallet.
Tracking spentness would require the Orchard wallet to be aware of the
local node's mempool contents; instead, the Orchard wallet now only
tracks whether a note is known to be mined and the C++ wallet checks
selected notes to determine whether any transactions that consume those
notes exist in the mempool.

In addition:
* Locking of notes will be delegated to the C++ side.
* The type of the recipient in wallet::NoteMetadata was
  changed from `*const Address` to `*mut Address` to reflect the
  fact that it is owned memory that must be freed.
* Nullifier data is no longer cleared during rewinds.
2022-03-08 11:55:53 -07: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 51cb37e541 Fix missing update to `last_checkpoint` on rewind. 2022-03-07 22:02:19 -07:00
Charlie O'Keefe 4f04c96f7b
Merge pull request #5632 from steven-ecc/z_sendmany_uniqueness_check
Extend uniqueness check in z_sendmany to UA receivers
2022-03-07 21:56:49 -07: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 c9ef5cd45a Add an `InPoint` type to the Orchard wallet to fix incorrect conflict data. 2022-03-07 19:05:00 -07:00
Kris Nuttycombe 97895a6f6d Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 19:05:00 -07:00
Kris Nuttycombe faffe2e084 Assert we never attempt to checkpoint the Orchard wallet at a negative block height.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 19:05:00 -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
Kris Nuttycombe 9336c5e7f0 Remove assertions that require Orchard wallet persistence to satisfy. 2022-03-07 19:05:00 -07:00
Kris Nuttycombe 23a7314607 Check wallet latest anchor against hashFinalOrchardRoot in ChainTip.
This will cause test failures until note commitment tree persistence
is implemented.
2022-03-07 19:05:00 -07:00
Kris Nuttycombe 6b8ecc8a31 Reset Orchard wallet state when rescanning from below NU5 activation. 2022-03-07 19:05:00 -07:00
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
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