Commit Graph

798 Commits

Author SHA1 Message Date
str4d dca890adcd
Merge pull request #1102 from zcash/doc-improvements
Various documentation improvements
2024-01-25 21:02:01 +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
str4d 08d3546f88
Merge pull request #1122 from zcash/light-client-perf
Improve light client performance
2024-01-25 19:04:58 +00:00
Kris Nuttycombe 0ae986cad0 zcash_client_backend: Move features guarded by the `orchard` flag to a separate Unreleased section of the CHANGELOG 2024-01-24 20:19:14 -07:00
Kris Nuttycombe ea4d00a12d Add CHANGELOG entries. 2024-01-24 18:00:55 -07:00
Kris Nuttycombe 184e3c741f Add `zcash_unstable` compiler flag to fully gate `orchard` functionality 2024-01-24 17:48:10 -07: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
str4d 3a0b634101
Merge pull request #1103 from nerdcash/docFixes
Doc improvements
2024-01-23 16:19:50 +00:00
Jack Grigg 72c427487b zcash_client_backend: Add diagram of wallet sync flow 2024-01-23 16:18:28 +00:00
Jack Grigg 193e0b2a29 zcash_client_backend: Enable `zcash_keys/unstable` feature flag
Due to `zcash_keys` being in `zcash_client_backend`'s public API, their
unstable APIs are a common API surface (as they were before `zcash_keys`
was extracted).

This can be reverted once `zcash_keys` types with unstable APIs are not
being re-exported from `zcash_client_backend`.
2024-01-22 17:53:19 +00:00
Kris Nuttycombe 28e36dc57b
Merge pull request #1054 from pacu/regtest-support
Add regtest support to `Parameter` for Mobile SDKs
2024-01-19 12:09:09 -07:00
Andrew Arnott aabee02247
Doc improvements 2024-01-17 21:33:12 -07: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
Francisco Gindre 529fd3d562
Add Regtest variant of `Network` and Parameter
closes #1051

Also:
Adds encoding tests + cargo fmt
Adds tests on ZIP-321
Adds coverage on new code
Supports nu6 activation
`local-consensus` feature is disabled by default
2024-01-17 18:21:06 -03:00
Kris Nuttycombe 876f53e295 zcash_client_backend: Add missing `orchard` feature dependency. 2024-01-17 10:09:12 -07:00
Jack Grigg 05f9252cb0 Fix `zcash_keys` feature flag enabling in `zcash_client_*` crates 2024-01-16 22:47:35 +00:00
Jack Grigg 3206255b8a Various documentation improvements 2024-01-16 22:30:05 +00:00
str4d b6caa483b4
Merge pull request #1116 from zcash/zcash_keys
Split `zcash_keys` crate out from `zcash_client_backend`
2024-01-16 22:09:41 +00:00
Kris Nuttycombe 0ca955336d Split `zcash_keys` crate out from `zcash_client_backend`
This change makes it easier for third parties to make use of the Unified
key infrastructure without incurring a dependency upon the rest of the
`zcash_client_backend` interfaces.
2024-01-16 13:49:42 -07:00
Kris Nuttycombe cc39bf4429 zcash_primitives: Add Orchard bundle metadata to transaction builder. 2024-01-16 13:19:24 -07:00
Andrew Arnott 28ed048c7e
Add punctuation to changelog
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2024-01-11 12:02:24 -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
Kris Nuttycombe 3bce5afea5
Merge pull request #1078 from nerdcash/displayableErrors
Implement Display trait for `DecodingError`
2024-01-08 10:06:43 -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
Kris Nuttycombe 56f2ac573c zcash_client_backend: Add Orchard support to change strategies.
This modifies the `compute_balance` method to operate in a
bundle-oriented fashion, which simplifies the API and makes it easier to
elide Orchard functionality in the case that the `orchard` feature is
not enabled.
2024-01-05 16:59:54 -07:00
Kris Nuttycombe 1b036f1e0d zcash_client_backend: rename `WalletNote` to `Note` 2024-01-05 09:13:53 -07: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 967fd36d39
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2024-01-04 11:56:59 -07:00
Kris Nuttycombe 857e44a11c zcash_client_backend: Use a polymorphic type for `ScannedBlock` note commitment and nullifier data. 2024-01-04 11:19:22 -07: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
Jack Grigg b7bba9bbb2 zcash_primitives: Remove `keys` module 2024-01-03 17:29:59 +00:00
Andrew Arnott a1b644cffa
Implement Display trait for `DecodingError` 2024-01-03 09:05:41 -07:00
Kris Nuttycombe 704e8e1144 zcash_primitives: Updates to reflect `sapling-crypto` and `orchard` builder changes. 2024-01-02 13:00:11 -07:00
Kris Nuttycombe 1ef6bf6656
Merge pull request #1066 from nuttycom/wallet/common_fee_logic
Factor out common logic from zip317 and fixed-fee single output change strategies.
2023-12-20 20:50:53 -07: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
Kris Nuttycombe d74f635d9d zcash_client_backend: Factor out common single-output change strategy logic. 2023-12-14 12:55:34 -07: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
Kris Nuttycombe 4eaa41affa zcash_primitives: Remove and relocate `InputView` traits. 2023-12-06 20:17:43 -07: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 8c1480304e zcash_client_backend: Wrap entire Sapling note in `SaplingReceivedNote` 2023-12-05 10:49:35 -07:00
Jack Grigg 54e8dd35c1 zcash_primitives: Remove old Sapling re-exports from `zip32` module 2023-12-05 17:31:17 +00: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 c0babd54cd zcash_client_backend: Expose Orchard value in balance API 2023-11-30 12:17:19 -07:00
Kris Nuttycombe 1e5d253c9c Fix dependencies to repair `cargo -p` subproject builds. 2023-11-29 12:37:18 -07:00
Kris Nuttycombe 28174e1ba3 zcash_client_backend: refactor select_key_for_note to avoid needing the extsk
This is in preparation for generalizing how we choose the spending key
for a note to serve `Orchard`.
2023-11-28 10:54:06 -07:00
Kris Nuttycombe 7f3d057a1b zcash_primitives: Avoid passing duplicate diversifier information to Sapling builder.
The note provided to `add_sapling_spend` contains the recipient address,
and we can extract the diversifier from this address, so we should not
pass it separately.
2023-11-28 10:54:06 -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 61bb18d97f zcash_primitives: Refactor `zip32::ChildIndex` to be an opaque struct 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
Jack Grigg c6263d2470 Fix generated protobuf file to match source
A comment change to the source file was made in zcash/librustzcash#891
before merging, but the generated file was not updated to match.
2023-11-21 02:15:12 +00:00
Kris Nuttycombe c5f48f50e1 Apply suggestions from code review
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <thestr4d@gmail.com>
2023-11-15 10:53:23 -07: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
sasha 572563338b Add a protobuf representation for transaction proposals.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2023-11-09 20:02:36 -07:00
Kris Nuttycombe 2d6a02eb2d
Merge pull request #1039 from zcash/736-refactor-sapling-components
Refactor Sapling components and builder into `zcash_primitives::sapling`
2023-11-09 20:00:32 -07:00
Kris Nuttycombe 7720a4fc58 zcash_client_backend::scanning: Use `checked_sub` instead of manual check.
Co-authored-by: str4d <thestr4d@gmail.com>
2023-11-09 15:09:54 -07:00
Kris Nuttycombe 09e37bcc8d Fix comment in zcash_client_backend::scanning
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-11-09 14:00:50 -07:00
Kris Nuttycombe b9ac7c5eda zcash_client_backend: Fix off-by-one in tree heights at NU activation. 2023-11-09 09:44:57 -07:00
Jack Grigg 54eb03e34e zcash_primitives: Move Sapling bundle types into `sapling` module 2023-11-09 04:04:07 +00:00
Jack Grigg f5595122f9 zcash_primitives: Move `builder` module to `zcash_primitives::sapling` 2023-11-09 04:02:19 +00:00
Kris Nuttycombe 8ce8cc8145 zcash_client_backend: Remove duplicative continuity checks. 2023-11-08 16:46:44 -07:00
Kris Nuttycombe ae4cb53c49 Apply suggestions from code review
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-11-08 16:46:44 -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
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
Jack Grigg b20641ae58 zcash_primitives: Remove `sapling::prover::TxProver`
Removed
-------
- `zcash_primitives::sapling`:
  - `prover::TxProver` (use `SpendProver` and `OutputProver` instead).
  - `prover::mock::MockTxProver` (use `MockSpendProver` and `MockOutputProver`
    instead).
2023-11-03 21:08:37 +00:00
Jack Grigg 8e0e77b0a0 zcash_client_backend: Remove `fees::ChangeError::map` from the public API
It is undocumented, unused outside of this crate, and unreleased, so we
make it crate-private for now.
2023-11-03 00:56:56 +00:00
Jack Grigg a77b6c631c Add missing unreleased changelog entries 2023-11-03 00:56:56 +00: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
Kris Nuttycombe 29c676ff12
Merge pull request #1009 from tw0po1nt/fix_txn_builder_panic
Gracefully handle when given an Orchard-only UA
2023-10-12 18:15:36 -06:00
Matthew Watt a788cc4c4d Fix merge conflicts 2023-10-12 06:16:22 -05:00
Kris Nuttycombe bcea060c86 Apply suggestions from code review
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-10-11 14:15:19 -06:00
Kris Nuttycombe 1447d8ea01 zcash_client_backend: Move change memos into the `ChangeValue` components of `Proposal`s.
The existing API limited change outputs to having only a single memo
repeated across each change output. This change makes it so that each
proposed change output can have its own associated memo, and leaves it
up to the input selector to determine how requested change memos are
associated with change outputs.
2023-10-11 14:15:19 -06:00
Kris Nuttycombe a2b5c2c784 zcash_client_backend: Use `NonNegativeAmount` for fee and change amounts.
In order to use `uint64` for amounts that must be nonnegative in the
`proposal.proto` file, it is useful to update fee and change computation
to use `NonNegativeAmount` where possible.
2023-10-10 16:12:47 -06:00
Matthew Watt 2a4d9e06da Run fmt 2023-10-10 07:47:08 -05:00
Matthew Watt 5de3fbb36b Fix logic error 2023-10-10 06:35:38 -05:00
Kris Nuttycombe 5b40ddf072 zcash_client_backend: Use globally unique identifiers for notes.
Update zcash_client_backend error types to use (TxId, output_index)
as the identifier for notes instead of the internal database identifier.
2023-10-09 12:44:27 -06:00
sasha 74840829c8 zcash_client_backend: Make `ReceivedSaplingNote` internals private.
This also adds the txid and index to `ReceivedSaplingNote` for use as a
globally identifier for the note.
2023-10-09 12:22:12 -06:00
Matthew Watt 13a2d5d7d4
Update wallet.rs
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-10-09 10:07:31 -05:00
Matthew Watt 4bbe658f74
Update CHANGELOG.md
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-10-09 10:06:37 -05:00
Matthew Watt a910fb86b6 Revert unnecessary change 2023-10-09 06:57:40 -05:00
Matthew Watt c4175342ac Cleanup 2023-10-09 06:46:12 -05:00
Matthew Watt 029b7f0d69 Document fallback behavior for Orchard-only UAs 2023-10-08 19:27:20 -05:00
Matthew Watt 46ed4964c3 Display for PoolType 2023-10-08 19:19:51 -05:00
Matthew Watt 94f2240e08 Provide PoolType to UnsupportedPoolType case; stylistic changes 2023-10-08 19:05:50 -05:00
Matthew Watt a9d18ec2ce Gracefully handle attempted spend to a UA with neither transparent nor sapling recipients 2023-10-07 15:37:35 -05:00
Kris Nuttycombe e6fa567332
Merge pull request #1000 from zingolabs/add_debugs_to_inputs
add Debug to transaction builder-reported types
2023-10-04 09:15:29 -06:00
zancas b5e24751d6
add Debug to transaction builder-reported types 2023-09-29 12:55:06 -06:00
Jack Grigg 0ddcccdbac zcash_primitives: Move Sapling constants into `sapling` module 2023-09-29 17:39:43 +00:00
Kris Nuttycombe a2e772c93a zcash_client_backend: Return summary information from `scan_cached_blocks`
When scanning, a wallet only needs to update balance and transaction
information shown to users when the scan has resulted in a change to
wallet state. This modifies `scan_cached_blocks` to return the range of
block heights actually scanned, along with the counts of notes spent and
received by the wallet in that range.

Fixes #918
2023-09-28 17:39:59 -06:00
Jack Grigg 7e89300db9 Move common package and dependency configs into workspace config
The MSRV for the main crates is 1.65, which is higher than the Rust
version that stabilised workplace dependencies (1.64). The implicit MSRV
for the component crates is still lower than this, so we don't migrate
these crates.
2023-09-26 22:01:32 +00:00
Jack Grigg 4bc65d66b1 zcash_client_backend 0.10.0 2023-09-25 18:19:52 +00:00
Jack Grigg 1a1abb62aa zcash_proofs 0.13.0 2023-09-25 15:11:00 +00:00
Jack Grigg d35d0961ab zcash_primitives 0.13.0 2023-09-25 15:06:57 +00:00
Jack Grigg 4afc24af6a zcash_client_backend 0.10.0-rc.4 2023-09-22 23:25:19 +01:00
Jack Grigg 513abf8b97 rustfmt 2023-09-22 21:09:23 +00:00
Jack Grigg 71e38fe190 zcash_client_sqlite: Enable `TestState` to mine wallet transactions 2023-09-22 17:20:07 +00:00
Kris Nuttycombe 2d8ece3003 Fix broken intra-doc link 2023-09-20 13:24:53 -06:00
Kris Nuttycombe bdc6886e2d
Apply suggestions from code review.
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-20 13:21:53 -06:00
Kris Nuttycombe d5dc4c6d9c zcash_client_backend: Document `data_api::ScannedBlock`
Fixes #885
2023-09-20 12:53:54 -06:00
Kris Nuttycombe 996fea70ac zcash_client_backend: Add detail to documentation of `suggest_scan_ranges`
Fixes #971
2023-09-20 12:39:43 -06:00
Kris Nuttycombe 6d2c53111a zcash_client_backend 0.10.0-rc.3 2023-09-19 15:00:51 -06:00
Kris Nuttycombe 1575f2db88 zcash_client_backend: make the `SpanningTree` type usable outside of `zcash_client_sqlite`
This adds the `data_api::scanning::spanning_tree` module under
a new `unstable-spanning-tree` feature flag, making it available to
other implementations who want to be able to write their own storage
backends without having to reinvent the spanning tree logic.
2023-09-18 11:22:35 -06:00
Kris Nuttycombe 24068cd63a zcash_client_backend 0.10.0-rc.2 2023-09-12 08:31:39 -06:00
Kris Nuttycombe 1e39daf6f8
Merge pull request #963 from nuttycom/bug/commitment_tree_depth
zcash_client_backend: Fix an error that can occur due to sparse `shardtree` checkpoints.
2023-09-12 08:05:50 -06:00
Kris Nuttycombe f2dcba3a34 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2023-09-11 18:39:27 -06:00
Kris Nuttycombe 24e8c82546 zcash_client_backend: Get commitment tree depth for a given number of confirmations from the database.
This fixes the following bug:

Due to complexities related to non-linear scanning, checkpoints are only
added to the wallet's commitment tree in cases where there are notes
discovered within a scanned block. At present, the `shardtree` API only
makes it possible to add multiple checkpoints of the same tree state
when adding checkpoints at the chain tip, and this functionality is not
used by `zcash_client_backend` because we perform checkpoint insertion
in batches that may contain gaps in the case that multiple blocks
contain no Sapling notes. While it would be possible to fix this by
altering the `shardtree` API to permit explicit insertion of multiple
checkpoints of the same tree state at a given note position, this fix
takes a simpler approach.

Instead of ensuring that a checkpoint exists at every block and
computing the required checkpoint depth directly from the minimum number
of confirmations required when attempting a spend, we alter the
`WalletCommitmentTrees` API to allow internal information of the note
commitment tree to be used to determine this checkpoint depth, given the
minimum number of commitments as an argument. This allows us to select a
usable checkpoint from the sparse checkpoint set that resulted from the
sparse insertion of checkpoints described above.
2023-09-11 18:38:54 -06:00
Kris Nuttycombe 771e4013c3 Move shardtree serialization to the `zcash_client_backend` crate 2023-09-11 18:18:08 -06:00
Jack Grigg 9db68c76ee zcash_client_backend 0.10.0-rc.1 2023-09-08 19:50:53 +00:00
Jack Grigg 87ca71b8db zcash_proofs 0.13.0-rc.1 2023-09-08 19:48:55 +00:00
Jack Grigg 67b84c25e0 zcash_primitives 0.13.0-rc.1 2023-09-08 19:45:54 +00:00
Kris Nuttycombe 46cc6666df Address comments from code review.
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-08 13:03:53 -06:00
Jack Grigg 94c1f2413d Migrate to `incrementalmerkletree 0.5`, `orchard 0.6` 2023-09-08 18:57:25 +00:00
Jack Grigg 6e34e2d113 zcash_client_backend: Migrate to `prost 0.12`, `tonic 0.10` 2023-09-08 16:21:48 +00:00
Kris Nuttycombe 1fe763de5f zcash_client_backend: Update CHANGELOG.md for 0.10.0 release. 2023-09-08 10:15:49 -06:00
Kris Nuttycombe 2131cd547e zcash_client_sqlite: Return a balance for every account from `get_wallet_summary`
Fixes #948
2023-09-07 11:02:59 -06:00
Kris Nuttycombe 65420f59df zcash_client_backend: Add `WalletRead::block_max_scanned`
Fixes #941
2023-09-06 08:49:43 -06:00
str4d 236e9f2cd0
Merge pull request #914 from nuttycom/sbs/nonlinear_sync_aware_balance
Add `get_wallet_summary` to `WalletRead`
2023-09-06 01:04:42 +01:00
Kris Nuttycombe 7abd1324de Apply suggestions from code review
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2023-09-05 16:49:36 -06:00
Kris Nuttycombe f53ea2d778 Add `get_wallet_summary` to `WalletRead`
The intent of this API is to provide a single API which returns in a
single call:

* per-account balances, including pending values
* wallet sync progress

Fixes #865
Fixes #900
2023-09-05 16:06:55 -06:00
Kris Nuttycombe dd60f51d3c Address unresovled code review comments from #907 2023-09-05 09:30:17 -06:00
Kris Nuttycombe 5b3f544102 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-01 10:38:20 -06:00
Kris Nuttycombe 0b0274cdc1 zcash_client_backend: Make wallet and account birthday heights available via the data access API 2023-09-01 10:11:43 -06:00
Kris Nuttycombe 459dc49b54 zcash_client_backend: Accept account birthday as a parameter to `create_account`
This also removes the zcash_client_sqlite-specific database
initialization procedures in favor of a standardized approach using the
methods available via the data access API.
2023-09-01 10:08:17 -06:00