Jack Grigg
6161709441
Hide unstable `orchard` feature flag in rustdoc
...
It is not part of the public API for `zcash_client_backend 0.11.0` and
`zcash_client_sqlite 0.9.0`.
2024-03-01 01:12:07 +00:00
Kris Nuttycombe
9ea027150a
zcash_client_sqlite: Allow use of `zcash_client_backend::data_api::wallet::spend` in tests
2024-02-29 17:57:24 -07:00
Kris Nuttycombe
a4b951d193
Apply suggestions from code review
...
Co-authored-by: str4d <thestr4d@gmail.com>
2024-02-29 15:19:07 -07:00
Kris Nuttycombe
939cfcce70
zcash_client_sqlite: Temporarily hardcode an empty response for `get_orchard_nullifiers`
2024-02-29 12:06:25 -07:00
Kris Nuttycombe
27f6207a7c
zcash_client_backend: Pass nullifiers separately from scanning keys.
2024-02-29 12:06:22 -07:00
Kris Nuttycombe
7e8723bea9
zcash_client_backend: Add Orchard support to batch scanning.
2024-02-29 12:04:53 -07:00
Kris Nuttycombe
880c24c45d
zcash_client_backend: Generalize key source metadata.
2024-02-29 11:55:44 -07:00
Kris Nuttycombe
802c01002a
zcash_client_backend: Rework scanning key identifiers.
...
In the process of making the internals of `scan_block_with_runner`
reusable across Sapling and Orchard, it became evident that key
identifier abstraction along the lines of #1175 is needed more
generally. This commit refactors the use of ZIP 32 account identifiers
and key scopes to better separate scanning concerns from ZIP 32 key
derivation. In the process, this removes a fair amount of unnecessary
polymorphism from `zcash_client_backend::wallet::WalletTx` and related
types.
2024-02-29 11:55:25 -07:00
Kris Nuttycombe
688c36166a
Address comments from code review.
2024-02-29 07:50:31 -07:00
Kris Nuttycombe
41b050f1e9
zcash_client_backend: Make `AccountId` an associated type of `WalletRead`
...
This PR was extracted from https://github.com/zcash/librustzcash/pull/1175
in order to make the changes to `zcash_client_backend` usable without
the additional generalizations to `zcash_client_sqlite` made by that PR.
Co-authored-by: Andrew Arnott <andrewarnott@live.com>
2024-02-28 21:06:14 -07:00
Kris Nuttycombe
2a6330f2ea
Apply suggestions from code review
...
Co-authored-by: str4d <thestr4d@gmail.com>
2024-02-23 09:16:26 -07:00
Kris Nuttycombe
9b98f46bf6
zcash_keys: Add `sapling` and `transparent-inputs` feature flags.
...
Fixes #1160
2024-02-23 09:16:25 -07:00
Kris Nuttycombe
184286c430
Apply suggestions from code review
...
Co-authored-by: str4d <thestr4d@gmail.com>
2024-02-21 17:36:08 -07:00
Kris Nuttycombe
050a124cb6
Address comments from code review.
2024-02-21 11:55:00 -07:00
Kris Nuttycombe
4e3d99f1d0
zcash_client_backend: Allow proposer to specify fallback change pool.
...
In the event that the pool to which change should be sent cannot
automatically be determined based upon the inputs and outputs of a
transaction, it is up to the caller to specify where change should
be sent.
2024-02-15 21:44:59 -07:00
Kris Nuttycombe
daf88a12e5
zcash_client_backend: Add support for creation of Orchard outputs.
2024-02-15 21:30:07 -07:00
Kris Nuttycombe
f27f601b7d
zcash_client_backend: Add Orchard spends to `create_proposed_transaction`
2024-02-15 21:29:15 -07:00
Kris Nuttycombe
74b487e4c9
Apply suggestions from code review
...
Co-authored-by: str4d <thestr4d@gmail.com>
2024-02-15 20:51:24 -07:00
Kris Nuttycombe
6aabe60d21
zcash_client_backend: Add validation to the `Proposal::multi_step` constructor.
2024-02-15 13:09:52 -07:00
Kris Nuttycombe
beeea7b44e
zcash_client_backend: Modify `Proposal` to make multi-step transactions representable.
2024-02-14 19:30:52 -07:00
Kris Nuttycombe
1db3109cb4
zcash_client_backend: Move the `Proposal` types to a `proposal` module.
...
This separation is in preparation for modifying the `Proposal` type
to wrap a vector of proposal steps.
2024-02-14 19:04:47 -07:00
Kris Nuttycombe
7a5852598e
zcash_keys, zcash_client_backend: feature-flag off transparent-input WalletRead methods.
...
This also moves the `TransparentAddressMetadata` type behind the
`transparent-inputs` feature flag and performs associated cleanup.
2024-02-14 17:38:52 -07:00
Andrew Arnott
f1b6dd0636
Switch out `AddressMetadata` for new struct
2024-02-13 18:34:33 -07:00
Andrew Arnott
9f221f869d
Fail instead of swallow on database corruption
2024-02-13 11:39:06 -07:00
Andrew Arnott
918f5cc812
Change `WalletRead::get_transparent_receivers` signature
...
It needn't return the account id that was given as an input, and it shouldn't return an 11-byte diversifier index when a 31-bit child index is more appropriate.
2024-02-13 11:39:06 -07:00
Kris Nuttycombe
7c0b9da9b7
zcash_client_sqlite: Do not request transparent UA components if "transparent-inputs" feature is disabled.
2024-02-07 14:49:48 -07:00
Kris Nuttycombe
2360609f1a
zcash_primitives: Rename `TransparentAddress` variants.
...
This resolves an old TODO.
2024-02-02 10:52:17 -07:00
Kris Nuttycombe
11f5589595
zcash_client_backend: Allow serialization of empty transaction requests.
2024-01-30 16:42:31 -08:00
Kris Nuttycombe
ea1d3a35db
zcash_keys: Remove `UnifiedAddressRequest::DEFAULT`
...
This default only made sense in the context of what was supported by
`zcash_client_sqlite`, and not in any other context. Unified address
requests no longer have their parts conditioned by what feature flags
are available; instead, if a request is constructed for which the
required key parts are not supported under a particular selection of
feature flags, address generation will raise a runtime error.
2024-01-27 07:59:55 -07:00
str4d
961f902795
Merge pull request #1127 from nuttycom/fix/migrate_scope_without_raw_tx
...
receiving_key_scopes migration: Fall back to note commitment matching for scope determination
2024-01-26 03:31:27 +00:00
Jack Grigg
d0a27eda90
zcash_client_sqlite: Add test for `receiving_key_scopes` migration
2024-01-26 03:10:36 +00:00
Kris Nuttycombe
0aebaf1345
receiving_key_scopes migration: Fall back to note commitment matching for scope determination.
...
Fixes #1117
2024-01-26 03:10:31 +00:00
str4d
14408e4eed
Merge pull request #1132 from zcash/rusqlite-dependency-warning
...
zcash_client_sqlite: Add warning about `rusqlite` version constraint
2024-01-25 19:27:42 +00:00
str4d
610b19bcd2
Merge pull request #1129 from zcash/wallet/orchard_compiler_flag
...
Add `zcash_unstable` compiler flag to fully gate `orchard` functionality
2024-01-25 19:15:53 +00:00
Jack Grigg
e85aac82b6
zcash_client_sqlite: Add warning about `rusqlite` version constraint
2024-01-25 19:06:08 +00:00
str4d
fe902f74bc
Add documentation about the `None` fully scanned height case
...
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2024-01-25 17:43:52 +00:00
Kris Nuttycombe
184e3c741f
Add `zcash_unstable` compiler flag to fully gate `orchard` functionality
2024-01-24 17:48:10 -07:00
Jack Grigg
d07f6d4336
zcash_client_sqlite: Make `get_wallet_summary` entirely transactional
2024-01-24 20:33:55 +00:00
Jack Grigg
db071f2e1f
zcash_client_backend: Add desired Sapling shard index to `WalletSummary`
...
Closes zcash/librustzcash#1124 .
2024-01-24 18:06:31 +00:00
Jack Grigg
11355e4095
zcash_client_sqlite: Get fully-scanned height from scan queue
2024-01-24 18:06:31 +00:00
Jack Grigg
ff724317f6
zcash_client_sqlite: Add test for `WalletDb::block_fully_scanned`
2024-01-24 18:06:31 +00:00
Jack Grigg
0ccc126315
zcash_client_sqlite: Instrument `put_shard_roots`
2024-01-22 23:55:19 +00:00
Jack Grigg
ae2a18db93
zcash_client_sqlite: Instrument `get_wallet_summary`
2024-01-22 23:55:19 +00:00
Daira Emma Hopwood
76f92268c3
Remove notices about the BOSL license exception, which are no longer needed.
...
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2024-01-17 23:28:15 +00:00
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
Kris Nuttycombe
a0935b5ecd
zcash_client_backend: remove `WalletRead::is_valid_account_extfvk`
2023-10-27 15:01:26 -06:00
Kris Nuttycombe
9627c806e4
zcash_client_backend: Pass `Proposal` values by reference.
2023-10-26 16:11:10 -06:00
Kris Nuttycombe
570ea48588
Apply suggestions from code review
...
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-10-26 15:24:45 -06:00
Kris Nuttycombe
f1c08693a5
zcash_client_backend: Add propose_standard_transfer.
2023-10-25 08:08:49 -06:00
Kris Nuttycombe
cc0cc2de84
zcash_primitives: add StandardFeeRule
...
`StandardFeeRule` is an enumeration of the standard fees that have
existed in the history of Zcash zips. It is provided to simplify
transition to new fee strategies; legacy elements of this enumeration
are introduced already-deprecated.
2023-10-25 08:08:49 -06:00
Kris Nuttycombe
f7527e14c9
Use `NonNegativeAmount` for note and utxo value fields
2023-10-23 12:59:26 -06:00