Commit Graph

696 Commits

Author SHA1 Message Date
Jack Grigg 05f9252cb0 Fix `zcash_keys` feature flag enabling in `zcash_client_*` crates 2024-01-16 22:47:35 +00:00
Kris Nuttycombe 60336714f7 Fix Rust formatting. 2024-01-11 14:31:19 -07:00
Andrew Arnott 69d92808f3
Add `WalletRead::get_account_ids` function 2024-01-10 13:01:01 -07:00
Kris Nuttycombe 6cbdd494cf zcash_client_backend: Add receiver type selection to unified address derivation. 2024-01-09 10:48:13 -07:00
Kris Nuttycombe c3a630bac3
Merge pull request #1060 from nuttycom/wallet/generalize_proposals
Add Orchard support to fees & transaction proposals.
2024-01-09 09:20:41 -07:00
Andrew Arnott 52a91a0ee7
Drop unused `mainnet` feature
Nothing seems to have depended on it, and my testing suggests the same build of this crate can work on both networks.
2024-01-08 06:32:21 -07:00
Kris Nuttycombe 24ebe4c643 Address comments from code review.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2024-01-05 17:00:46 -07:00
Kris Nuttycombe adc75566a0 zcash_client_backend: Add Orchard support to transaction proposals. 2024-01-05 16:59:54 -07:00
str4d 0548b3dd9b
Merge pull request #1090 from nuttycom/rename_wallet_note
zcash_client_backend: rename `WalletNote` to `Note`
2024-01-05 17:16:29 +00:00
Kris Nuttycombe 1b036f1e0d zcash_client_backend: rename `WalletNote` to `Note` 2024-01-05 09:13:53 -07:00
Dimitris Apostolou 652c393896
Fix typo 2024-01-05 12:44:57 +02:00
Kris Nuttycombe 28319ffc38
Merge pull request #1085 from nuttycom/wallet/common_input_source
Replace SaplingInputSource and TransparentInputSource with InputSource
2024-01-04 15:07:23 -07:00
Kris Nuttycombe 5126fd6b5f
Merge pull request #1086 from zcash/docs-rs-feature-flags
Show feature flags in documentation
2024-01-04 14:34:40 -07:00
Kris Nuttycombe d4aa2d6f06 Replace SaplingInputSource and TransparentInputSource with InputSource
This unification allows us to better isolate transparent-input dependent
functionality. Previously, `TransparentInputSource` could not be placed
under a feature flag because the interface was needed for proposal
deserialization; by instead making the transparent input source methods
flag-dependent, we can correctly produce an error when proposal
deserializaiton attempts to select transparent inputs and the feature
flag is off.
2024-01-04 14:00:20 -07:00
Jack Grigg 3989ee9926 Show feature flags in documentation
This can be rendered locally with:
    RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --no-deps --workspace --all-features
2024-01-04 19:07:22 +00:00
Kris Nuttycombe f18d082aa3 zcash_client_backend: Introduce an "orchard-client" feature flag.
We plan to also introduce a similar flag to gate access to Sapling
functionality. Since introduction of Orchard functionality is still
nascent, it's the correct time to introduce this isolation, before
there's more functionality that needs to be isolated in this fashion.
2024-01-03 17:05:20 -07:00
Jack Grigg 2ea83243a7 Document the feature flags 2024-01-03 20:15:21 +00:00
Jack Grigg 0df4c6f043 Remove implicit feature flags for optional dependencies
All optional dependencies are enabled as part of dedicated feature
flags.
2024-01-03 20:15:21 +00:00
str4d 20f8b97195
Merge pull request #1063 from nuttycom/backend/parsed_address
zcash_client_backend: Rename `RecipientAddress` to `Address`
2023-12-15 17:40:22 +00:00
Jack Grigg b6907b14e6 Use `sapling-crypto` crate directly outside `zcash_primitives` 2023-12-12 19:50:26 +00:00
Kris Nuttycombe 9ac3594bbb zcash_client_backend: Rename RecipientAddress to Address 2023-12-08 11:34:27 -07:00
Kris Nuttycombe aab9938b53 zcash_client_backend: Rename `RecipientAddress::Shielded` to `RecipientAddress::Sapling` 2023-12-07 15:24:47 -07:00
Jack Grigg 842ce36f7c Fix clippy lint 2023-12-06 18:19:15 +00:00
Jack Grigg d332aacf98 Merge branch 'main' into 1044-extract-zip32 2023-12-06 18:04:36 +00:00
Jack Grigg 3dfd478141 Migrate to published `zip32` crate outside this repository 2023-12-06 18:04:09 +00:00
Kris Nuttycombe ca54b3489d Apply suggestions from code review
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2023-12-05 15:55:52 -07:00
Kris Nuttycombe cad4f25b75 zcash_client_backend: Replace `ReceivedSaplingNote` with `ReceivedNote`
`ReceivedNote` now allows Orchard notes to be represented as received
notes. As part of this change, received notes now track whether they
were received using internally- or externally-scoped viewing keys.
This eliminates the need to trial-regenerate notes using the wallet's
IVKs to determine scope at spend time.
2023-12-05 10:55:06 -07:00
Kris Nuttycombe 6b10a6dc86 zcash_client_backend: Move essential wallet types into the `wallet` module. 2023-12-05 10:55:04 -07:00
Kris Nuttycombe 4a7dd2bed2 zcash_client_sqlite: Add receiving key scope information to received notes. 2023-12-05 10:49:35 -07:00
Kris Nuttycombe 8c1480304e zcash_client_backend: Wrap entire Sapling note in `SaplingReceivedNote` 2023-12-05 10:49:35 -07:00
Kris Nuttycombe 214a3750c5 zcash_client_backend: Make `Balance` and `AccountBalance` fields private.
Public methods for mutation of these fields have been provided that
perform checking for overflow of the valid monetary range as part
of their operation.
2023-12-04 13:53:27 -07:00
Kris Nuttycombe 9aec53eec9 zcash_client_backend: Add Orchard components to `ScannedBlock` 2023-11-30 13:08:17 -07:00
Kris Nuttycombe 1e5d253c9c Fix dependencies to repair `cargo -p` subproject builds. 2023-11-29 12:37:18 -07:00
Jack Grigg 0d06e561bb Update Sapling imports to migrate off re-exports at old paths 2023-11-28 03:40:41 +00:00
Jack Grigg 106f5a353a Remove `MemoBytes` usage from `zcash_primitives::sapling` 2023-11-28 03:25:14 +00:00
Jack Grigg 7badba29ea zcash_primitives: Move `zip32::sapling` to `sapling::zip32` 2023-11-28 01:38:53 +00:00
Jack Grigg eb0b5a1b24 zcash_primitives: Remove `consensus::Parameters` from `sapling` module
Part of zcash/librustzcash#1044.
2023-11-22 04:29:36 +00:00
Kris Nuttycombe 7aab6fd7a7 zcash_client_backend: add `Display` and `Error` impls for proposal parsing errors. 2023-11-14 12:59:40 -07:00
Kris Nuttycombe aeb405ef5d Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-11-14 12:58:22 -07:00
Kris Nuttycombe 33169719ce zcash_client_backend: Add serialization & parsing for protobuf Proposal representation. 2023-11-09 20:07:16 -07:00
Kris Nuttycombe 6077a712e4
Merge pull request #1024 from nuttycom/wallet/orchard_block_metadata
zcash_client_backend: Add Orchard note commitment tree size to block metadata.
2023-11-09 15:44:56 -07:00
Kris Nuttycombe 1ab411ada8 zcash_client_sqlite: Fix broken intra-doc link on `unstable` feature. 2023-11-08 17:31:23 -07:00
Kris Nuttycombe 27f78d1894 zcash_client_backend: Add Orchard note commitment tree size to block metadata. 2023-11-08 16:46:44 -07:00
str4d e4b9d73d0c
Merge pull request #1003 from nuttycom/wallet/reusable_input_selection
zcash_client_backend: Factor out `InputSource` from `WalletRead`
2023-11-08 20:20:03 +00:00
Kris Nuttycombe aa063ae3fd zcash_client_backend: Factor out input source traits from `WalletRead`
Prior to this change, it's necessary to implement the entirety of the
`WalletRead` trait in order to be able to use the input selection
functionality provided by `zcash_client_backend::data_api::input_selection`.
This change factors out the minimal operations required for transaction
proposal construction to better reflect the principle of least authority
and make the input selection code reusable in more contexts.

In order to minimize the operations of the newly-created `InputSource`
and `ShieldingSource` traits, this change also removes the
`min_confirmations` field from transaction proposals, in favor of
storing explicit target and anchor heights. This has the effect of
limiting the lifetime of transaction proposals to `PRUNING_DEPTH -
min_confirmations` blocks.
2023-11-08 12:41:49 -07:00
Kris Nuttycombe e27dcf498e Use the bundled prover rather than local params files for testing by default.
`fetch_params.sh` is now deprecated and the bundled proving parameters
from `wagyu-zcash-parameters` are used everywhere, so the tests should
follow suit.

Fixes #1016
2023-11-03 16:13:34 -06:00
Jack Grigg bed5bc6cf6 Clean up unreleased changelog entries 2023-11-03 00:56:26 +00:00
Jack Grigg b2ff29db78 Refactor Sapling builder to separate out proof generation
Closes zcash/librustzcash#741.
2023-10-31 22:01:34 +00:00
Kris Nuttycombe 13fb0a4819
Merge pull request #1019 from nuttycom/wallet/proposals_with_minconf
zcash_client_backend: Move `min_confirmations` into `Proposal`
2023-10-31 12:59:40 -06:00
Kris Nuttycombe 4cd26b7ea9 zcash_client_backend: Move `min_confirmations` into `Proposal`
This fixes an API issue whereby it was possible to execute a `Proposal`
with a different value of `min_confirmations` than that with which the
`Proposal` was constructed.
2023-10-31 10:38:52 -06:00