Commit Graph

17619 Commits

Author SHA1 Message Date
Kris Nuttycombe 0b9126a846
Merge pull request #6448 from sellout/zcash-cli-conversion
Improve zcash-cli argument handling
2023-04-13 14:37:18 -06:00
Greg Pfeil 5a7c36c868
Rename Arg* to Param
Some of these are newly-introduced names in this PR, others are ones that I had
renamed from param -> arg in an earlier commit.

Also restores `strMethod` where it had been changed to `method`.
2023-04-13 13:28:28 -06:00
Greg Pfeil 2596b4920b
Fix edge case revealed by #6409
Without `AllowRevealedRecipients`, we can’t send transparent change, but previously we asserted if
we couldn’t get a transparent change address. Now it returns a new `TransparentChangeNotAllowed`
failure, which is just a more specific `TransparentRecipientNotAllowed` to avoid confusion when
there are no explicit unshielded recipients.
2023-04-13 12:47:52 -06:00
Jack Grigg 1f8887e0b6 qa: Postpone dependencies we aren't updating 2023-04-13 17:01:03 +00:00
Jack Grigg b3332c6273 depends: `cxx 1.0.94` 2023-04-13 17:01:03 +00:00
Jack Grigg b1de4909e8 depends: `native_zstd 1.5.5` 2023-04-13 16:47:44 +00:00
Jack Grigg 90b4366824 depends: Rust 1.68.2 2023-04-13 16:43:52 +00:00
Jack Grigg 93dddd2104 depends: CMake 3.26.3 2023-04-13 16:41:19 +00:00
Jack Grigg 30f258e2a6 qa: Fix update checker to handle `native_clang` version format 2023-04-13 16:32:10 +00:00
Kris Nuttycombe 504c63089f
Merge pull request #6548 from str4d/6462-orchard-0.4
Migrate to published `orchard 0.4`
2023-04-12 16:33:00 -06:00
Jack Grigg 002ed29c72 Migrate to published `orchard 0.4`
Part of zcash/zcash#6462.
2023-04-12 21:26:37 +00:00
Kris Nuttycombe 6f59cc9d10
Merge pull request #6545 from sellout/eliminate-ZTXOSelector-cycles
Eliminate LegacyCompat–ZTXOSelector cycle
2023-04-12 14:47:28 -06:00
str4d 6274da265d
Merge pull request #6547 from str4d/fix-cargo-vet
Fix `cargo vet`
2023-04-12 21:38:30 +01:00
Greg Pfeil 0fca843a5b
Simplify some vector initialization
Also simplify some calls to use `tl::make_unexpected`.
2023-04-12 14:20:37 -06:00
Jack Grigg c468437e31 More crate audits 2023-04-12 19:24:23 +00:00
Greg Pfeil 8d6dabd46a
Use examine instead of std::visit 2023-04-12 12:11:49 -06:00
Jack Grigg ad51f74d6e cargo-vet: Switch to Google's aggregated audits 2023-04-12 18:08:37 +00:00
Jack Grigg 878037af6a cargo-vet: Regenerate imports 2023-04-12 18:07:00 +00:00
Jack Grigg 279c82b093 Tell `cargo-vet` to ignore patched dependencies
The book page on Rust is updated to describe how to patch dependencies,
so `cargo-vet` can be kept passing while patches are present.
2023-04-12 18:04:29 +00:00
Greg Pfeil 2e0eb32892
Remove unnecessary explicit privacy policy
This was added in c1dbe12d77 as an inadvertent
workaround for the bug fixed by the commit before this one.
2023-04-12 11:43:26 -06:00
Greg Pfeil 1c00591699
Fix accidental reversion of #6409
Rearranging some code caused a partial reversion.
2023-04-12 10:32:30 -06:00
Greg Pfeil 2ab17586d6
Better messages on client-side zcash-cli errors
The other changes in this PR push more errors to the client side, where error messages have been
minimal. Also if a request made it to the server _then_ errored, it would return the help text, but
not specific failure information.

Now, client-side errors make a help RPC call for the method, resulting in a message with both the
specific failure plus the help text, whereas previously we only ever received one or the other.
2023-04-12 10:11:56 -06:00
Greg Pfeil 2435b974ee
Enrich zcash-cli arg conversion
Instead of storing the indices of args to convert from string, store two
`vector<bool>` (per operation), the first containing an entry for each required
parameter (`true` if we should convert it), and the second containing an entry
for each optional parameter.

This allows us to check a few more things on the client side:
- does the operation exist
- have enough arguments been passed
- have too many arguments been passed

This is ostensibly a fix for `zcash-cli` to be able to use `asOfHeight` where
available, but it also caught a few bugs in the old implementation:
- `submitblock` didn’t convert its optional (but ignored) second arg;
- `z_getpaymentdisclosure` docs claimed all the args were strings, but two are
  actually ints;`
- `listreceivedbyaddress` didn’t convert the optional `includeImmatureCodebase`;
- `listsinceblock` didn’t convert the optional `includeRemoved` and
  `includeChange`;`
- `gettransaction` didn’t convert `verbose`;
- `listunspent` didn’t convert `includeUnsafe` or `queryOptions`;
- `z_getbalanceforviewingkey` didn’t convert minconf; and
- a minor non-bug – `z_getbalanceforaddress` had a handler even though the
  operation has been removed.

`getblockdeltas` also incorrectly tries to convert its required string argument,
but correcting that would be a breaking API change. Instead, it is deferred to

Fixes #6429.
2023-04-12 10:11:56 -06:00
Greg Pfeil d1ba9c423e
Simplify client.cpp
There was a lot of indirection to build a `set<pair<string, int>>` that should
have been a `map<string, set<int>>` from a `[pair<string, int>]`, when it could
just be initialized directly.
2023-04-12 10:11:56 -06:00
Greg Pfeil c9ffa6e8ae
Eliminate LegacyCompat–ZTXOSelector cycle
This now determines the meaning of “LegacyCompat” in advance, then always has a
known `TransactionStrategy` when we create the `ZTXOSelector`. With the addition
of `TransparentCoinbasePolicy`, there were two different ways that the selector
depended on the strategy, so it became more complicated to manage the cycle. And
the coinbase policy was overly conservative when there were no transparent
recipients or UAs in the tx. So this resolves that as well.

Fixes #6541.
2023-04-12 10:01:39 -06:00
Greg Pfeil f7a27e8089
Revert "Add `AllowRevealedSenders` to fix `mempool_nu_activation.py`"
This reverts commit 6f5360fbd8.
2023-04-12 09:22:19 -06:00
Greg Pfeil c6001268c5
Address review feedback re: ZIP 317 in wallet 2023-04-11 13:21:48 -06:00
Jack Grigg b1dc94249c rust: Migrate Ed25519 FFI to `cxx` 2023-04-11 16:36:26 +00:00
str4d 035e21a610
Merge pull request #6536 from str4d/6397-cxx-orchard-bundle
Use `cxx` bridge for all Orchard bundle inspection and validation
2023-04-11 17:33:23 +01:00
str4d 6ca34c2f0c
Merge pull request #6538 from Anish-M-code/master
use SOURCES_PATH instead of local git DEPENDS_SOURCES_DIR
2023-04-10 15:51:52 +01:00
Kris Nuttycombe df77acb218
Merge pull request #6535 from str4d/6534-tolerate-split-llvm-versions
build: Tolerate split LLVM versions
2023-04-10 07:24:58 -06:00
Greg Pfeil dac6c014d4
Correct change handling for ZIP 317 fees 2023-04-10 00:23:22 -06:00
Greg Pfeil fc6eca86e2
Support ZIP 317 fees in the zcashd wallet
- still support explicit fixed fees everywhere – if a caller provides a fee, we
  don’t adjust it
- treat negative fees as signifier for use of ZIP 317 fees when a fee needs to
  be provided because of additional positional arguments
2023-04-10 00:20:29 -06:00
Greg Pfeil 7f0592a664
Simplify canResolveOrchard logic
When deciding whether we can pay Orchard receivers, rather than checking
whether we have “sufficient non-Sprout funds”, we can just check whether the
selector selects Sprout – if it doesn’t then we can select Orchard receivers
regardless, and we’ll catch insufficient funds later.

This is also helpful for ZIP 317, because in that case we don’t even know the
total non-Sprout funds necessary until after we decide which receivers to pay.
2023-04-10 00:19:39 -06:00
Kris Nuttycombe 881ab6b46a
Merge pull request #6540 from daira/rpconnect-doc
Correct the documentation of `-rpcconnect` in the example `zcash.conf`
2023-04-09 22:38:15 -06:00
Kris Nuttycombe 6d06ddd84d
Merge pull request #6409 from sellout/wallet_tx_builder/restrict-transparent-change
Require `AllowRevealedRecipients` for transparent change
2023-04-09 22:35:11 -06:00
Kris Nuttycombe 6f5360fbd8 Add `AllowRevealedSenders` to fix `mempool_nu_activation.py` 2023-04-09 20:58:01 -06:00
Daira Emma Hopwood 2620e6e08c Correct the documentation of `-rpcconnect` in the example `zcash.conf`.
`-rpcconnect` is only used by `zcash-cli`.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-09 15:21:33 +01:00
Kris Nuttycombe b3b616fbe5
Merge pull request #6539 from Anish-M-code/AN_git_metric_screen
report the git-derived version in metrics screen
2023-04-07 16:10:07 -06:00
ANISH M 777d346e19
Update src/metrics.cpp by removing v prefix.
Co-authored-by: str4d <thestr4d@gmail.com>
2023-04-07 20:59:16 +05:30
ANISH M 835c6a2745
report the git-derived version in metrics screen
An attempt to fix issue #5639 by using version derived from git "build" field of getinfo.
2023-04-07 20:07:25 +05:30
ANISH M 9dfef39e18
use SOURCES_PATH instead of local git DEPENDS_SOURCES_DIR 2023-04-07 19:26:33 +05:30
Jack Grigg ccbda94b30 gtest: Minor improvements to `CoinsTests`
These were implemented while debugging the previous commit.
2023-04-07 12:17:00 +00:00
Jack Grigg 19fed267e3 Use `cxx` bridge for all Orchard bundle inspection and validation
zcash/zcash#5987 added a bridge to `orchard::Bundle<Authorized, Amount>`
for `getrawtransaction`. This commit expands it to also cover the
consensus rules, by migrating over missing functionality from the
hand-written FFI methods, and exposing the Orchard `BatchValidator` type
directly (as with Sapling) instead of via the C++ `AuthValidator`
intermediary.

Part of zcash/zcash#6397.
2023-04-07 12:16:28 +00:00
Jack Grigg bc2d144c68 build: Tolerate split LLVM versions
This makes it easier to use different LLVM point releases for different
hosts (as available), and ensures that `$(package)_major_version` is set
correctly when using a different major release on a Tier 3 platform.

Closes zcash/zcash#6534.
2023-04-07 11:16:27 +00:00
str4d 3ef6e96fa6
Merge pull request #6533 from str4d/6397-cxx-rust-streams
Expand `CppStream` to cover all `Stream`-like C++ types
2023-04-07 09:42:08 +01:00
Jack Grigg c301e321e4 Migrate `OrchardMerkleFrontier` to use new `CppStream` APIs 2023-04-06 21:30:38 +00:00
Jack Grigg 7b005aaa7a Expand `CppStream` to cover all `Stream`-like C++ types
In its existing usage, `CppStream` was only used in a context where the
C++ `READWRITE` macro was being called with a `CDataStream`. However, in
other contexts the macro can be called with various other types with a
stream-like interface. Since we can't expose C++ templates across the
`cxx` bridge (or FFI generally), we instead turn `CppStream` into an
enum that covers all of the stream-like types we may want to use.
2023-04-06 21:30:38 +00:00
Kris Nuttycombe 83dc372394
Merge pull request #6531 from str4d/cxx-merge-bridges
Merge most `cxx::bridge` definitions into a single bridge
2023-04-05 09:12:57 -06:00
Jack Grigg 33367709f7 Merge most `cxx::bridge` definitions into a single bridge
This enables us to use Rust types across more bridged APIs, which we
can't do with multiple bridge definitions until `cxx` adds support.
2023-04-05 10:50:35 +00:00