Commit Graph

17620 Commits

Author SHA1 Message Date
Greg Pfeil 62ae44a131
Ensure that a WalletTxBuilder tx balances
This also removes the code that stops adding spends if they ever go
`>= targetAmount`. The included note limiting and change calculation should
ensure that it’s always `==` at the end, and we don’t want paper over a mistake
in those earlier calculations.

There are existing tests that fail if either
- the newly-added Orchard increment is missing or
- the assertion is applied when there’s Sprout change.
2023-03-20 09:40:42 -06:00
str4d 598ede46c4
Merge pull request #6499 from str4d/update-deps-5.5.0
Update dependencies again for 5.5.0
2023-03-18 00:43:52 +00:00
Jack Grigg 0b77f8f79a cargo update 2023-03-17 23:22:53 +00:00
Greg Pfeil 5081a8e8fd
Address WalletTxBuilder PR feedback 2023-03-17 16:11:40 -06:00
Jack Grigg fe0b3ee89f depends: Postpone CCache updates again
We can update CCache when we drop support for Ubuntu 18.04.
2023-03-17 20:42:13 +00:00
Jack Grigg 679e77ce3f depends: CMake 3.26.0 2023-03-17 20:40:13 +00:00
Jack Grigg 69ab270480 depends: `cxx 1.0.92` 2023-03-17 20:32:01 +00:00
str4d 6ebf01fa83
Merge pull request #6459 from str4d/zcash_primitives-0.10
Migrate to `zcash_primitives 0.10`
2023-03-17 20:03:37 +00:00
str4d 0e7d61d6dc
Adjust documentation
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2023-03-17 17:16:33 +00:00
Daira Emma Hopwood 1da8a545d8 Adjust indentation to be consistent without changing existing code.
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-03-17 16:55:51 +00:00
Greg Pfeil 77a26692bb
Don’t permit user-provided “internal” payments
The `Payment` type had an `isInternal` field, but it is (and should always be) `false`.
`ResolvedPayment` is the corresponding type internal to the transaction builder that can be either
internal (for change) or external (for user-requested payments).
2023-03-16 19:49:38 -06:00
Jack Grigg 7f35a0da5c Migrate to `zcash_primitives 0.10`
Closes zcash/zcash#6398.
2023-03-17 00:09:45 +00:00
str4d e9e160c7e2
Merge pull request #6474 from str4d/wallet-zcash_note_encryption
Migrate in-wallet Sapling output decryption to `zcash_note_encryption`
2023-03-16 23:19:27 +00:00
Greg Pfeil d90ca22be7
Clarify `AddressResolutionError`
- document and rename the enum cases,
- rewrite some of the exception messages, and
- restructure the UA recipient case.
2023-03-16 17:18:47 -06:00
Greg Pfeil 9f84ce2858
Update WalletTxBuilder based on review
Some of the more significant changes are
- remove release note entry for already-released feature;
- rephrase some error messages and comments;
- add a missing case to `EstimateTxSize`;
- don’t return a selector when we don’t have a UFVK for a UA, which allows some
  simplifications (and elimination of a failure case) to happen; and
- remove a redundant `InsufficientFundsError`.
2023-03-16 13:57:57 -06:00
str4d a37c1b06ec
Merge pull request #6493 from str4d/ci-update-workflows
Update CI workflows
2023-03-16 17:33:25 +00:00
Jack Grigg feb1f41ce6 CI: Check out both the base and PR branches for "recent base" check
This should hopefully ensure that we end up with a single Git repository
that has both branches in it, enabling `git merge-base --is-ancestor` to
work correctly.
2023-03-16 16:22:28 +00:00
Jack Grigg ac3568a557 CI: Provide `write` permission for `pull-requests`
The "recent base" check attempts to remove a label from the PR being
checked, which uses the `issues` API. But a `write` permission for the
`issues` API appears to be insufficient.
2023-03-16 15:51:20 +00:00
Jack Grigg 41bd54c8ae cargo vet prune 2023-03-16 15:45:04 +00:00
Jack Grigg d54f7d001e CI: Migrate to `cargo-vet 0.5` 2023-03-16 15:44:31 +00:00
Jack Grigg 5c316e8d50 CI: Remove most usages of `actions-rs` actions
These actions are unmaintained. The only one we continue to use is
`actions-rs/clippy-check` because there is no suitable alternative.
2023-03-16 15:38:15 +00:00
Greg Pfeil ad26296b89
Make RPC test output more deterministic
* sort the result summary (always)
* add a flag, `--deterministic` (`-d`), to enable other output changes
* don’t print progress `.` (with `-d`)
* don’t print durations/runtime (with `-d`)

This isn’t fully deterministic as tests can still complete out of order, but
even there these changes make it easier to diff regions. Adding `--jobs 1`
should make it fully deterministic at the cost of performance.
2023-03-16 01:32:45 -06:00
Kris Nuttycombe b177eeb89e
Merge pull request #6490 from str4d/book-eos-heights-v5.3.3-v5.4.2
book: Add End-of-Support heights for v5.3.3 and v5.4.2
2023-03-15 18:23:42 -06:00
str4d 207c88474f
Improvements to code comments
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2023-03-15 23:52:09 +00:00
str4d 1b7b73b794
Merge pull request #6489 from str4d/ci-checks-fix-head-ref
CI: Use `github.head_ref` instead of `HEAD` for "recent base" check
2023-03-15 17:56:38 +00:00
Jack Grigg 85c3a701f9 book: Add End-of-Support heights for v5.3.3 and v5.4.2 2023-03-15 17:54:41 +00:00
Jack Grigg 41997a5ac3 CI: Use `github.head_ref` instead of `HEAD` for "recent base" check
The `pull_request_target` event causes `actions/checkout` to check out
the target branch (e.g. the main repo's `master` branch) instead of the
PR's branch. This meant that after zcash/zcash#6487 merged, the check
would always pass (because the queried revision is always present in the
history of `master`). `github.head_ref` correctly points to the tip of
the PR's branch, ensuring that `git merge-base --is-ancestor` performs
the expected comparison.
2023-03-15 15:33:05 +00:00
Kris Nuttycombe 219b9c68b0
Merge pull request #6487 from str4d/ci-checks-more-fixes
CI: More fixes to "recent base" check
2023-03-14 21:48:39 -06:00
str4d 38f7ed3ce4
Merge pull request #6466 from nuttycom/cleanup/params_const_correctness
Improve CChainParams const correctness.
2023-03-15 03:02:35 +00:00
Jack Grigg 8a33c66a68 CI: Include explicit `failure()` condition in "recent base" check
This is necessary to override the default `success()` status check, and
allow the narrowing condition to function correctly.
2023-03-15 02:48:55 +00:00
Jack Grigg 08347f40fc CI: Fetch all history for "recent base" check
This ensures that the branch history containing the commit in question
is present.
2023-03-15 02:44:48 +00:00
Kris Nuttycombe b1240282d6 Explicitly provide CChainParams to `EnforceNodeDeprecation`
This is another step in the long process of removing access to global
state.
2023-03-14 16:15:30 -06:00
Kris Nuttycombe da0a9c1313 Improve const-ness of CChainParams retrieval by network ID
This change ensures that we do not return non-const CChainParams
references.
2023-03-14 16:15:30 -06:00
Jack Grigg d154cd760c wallet: Remove recipient-side `SaplingNotePlaintext::decrypt`
All recipient-side decryption now relies on `zcash_note_encryption`.
2023-03-14 21:50:31 +00:00
Jack Grigg f5ed454f87 wallet: Use `zcash_note_encryption` in `CWalletTx::RecoverSaplingNote` 2023-03-14 21:50:31 +00:00
Jack Grigg 2fd287e73b wallet: Use `zcash_note_encryption` in `CWallet::FindMySaplingNotes`
This method is only used in tests (as the main wallet scanning logic
already uses `zcash_note_encryption` via the batch scanner).
2023-03-14 21:50:31 +00:00
Jack Grigg f622549929 wallet: Use `CWalletTx::DecryptSaplingNote` in more places 2023-03-14 21:50:31 +00:00
Jack Grigg 95157cd97c wallet: Use `zcash_note_encryption` in `CWalletTx::DecryptSaplingNote` 2023-03-14 21:50:31 +00:00
Jack Grigg db600d5863 wallet: Consolidate `CWalletTx` Sapling output decryption methods
`CWalletTx::DecryptSaplingNote` and `CWalletTx::RecoverSaplingNote` were
previously unused, and the variants that skipped the plaintext version
check were only used by `z_viewtransaction` to inspect details about
transactions that had already been added to the wallet.

We now merge the two back together, and use the activation height of the
Canopy NU as the checked height. This re-checks the plaintext version in
`z_viewtransaction` but permits either valid version.
2023-03-14 21:45:19 +00:00
Jack Grigg a95cd3db09 Add `CChainParams::RustNetwork`
The `zcashd` impl of `consensus::Parameters` is moved into a new
`params` module. It still uses the `cxx::bridge` in `wallet_scanner`
because `cxx` doesn't support Rust type aliases yet.
2023-03-14 21:42:54 +00:00
Kris Nuttycombe 659030aa46
Merge pull request #6460 from daira/generalize-weighted-map
Refactoring to split the weighted tx tree out of mempool_limit.{cpp,h} and make it more reusable
2023-03-14 13:47:48 -06:00
str4d d8a89dfacb
Merge pull request #6482 from str4d/ci-checks-fix-permissions
CI: Fix permissions for Checks workflow
2023-03-14 15:28:34 +00:00
Jack Grigg e67a0d746c CI: Fix permissions for Checks workflow 2023-03-14 14:14:47 +00:00
Kris Nuttycombe 98391a3a92
Merge pull request #6478 from zcash/fix/distclean_rust_gen
Fix `make distclean` to recursively remove `rust/gen`
2023-03-13 17:02:33 -06:00
str4d 8bc38e620c
Merge pull request #6480 from str4d/ci-checks
CI: Check that the PR branch has a sufficiently recent base for Tekton
2023-03-13 19:11:33 +00:00
str4d 8c26d91b28
Merge pull request #6476 from nuttycom/fix/build_warnings
Fix a couple of longstanding zcashd build warnings
2023-03-13 17:51:38 +00:00
Jack Grigg 07cdc1cb4a CI: Check that the PR branch has a sufficiently recent base for Tekton
This provides an explicit error message to PR authors telling them if
they need to rebase, avoiding the rediscovery of known breaking changes
to Tekton CI compatibility.
2023-03-13 17:42:48 +00:00
str4d d03a507b5a
Merge pull request #6479 from str4d/fix-disable-wallet
Fix builds with `CONFIGURE_FLAGS=--disable-wallet`
2023-03-13 17:04:02 +00:00
Kris Nuttycombe 245f35e034 Fix `make distclean` to recursively remove `rust/gen`
`make distclean` currently fails with:

```
rm -f rust/gen
rm: cannot remove 'rust/gen': Is a directory
make[2]: *** [Makefile:10025: clean-local] Error 1
```
2023-03-13 10:12:01 -06:00
Kris Nuttycombe 228ba99150 Fix a longstanding zcashd build warning
Fixes zcash/zcash#2348
2023-03-13 10:11:26 -06:00