Commit Graph

66 Commits

Author SHA1 Message Date
str4d 579ab92b93
Merge branch 'main' into 823-secp256k1-0.26 2023-05-08 18:53:33 +01:00
Jack Grigg 3db0395e5b zcash_client_sqlite 0.7.0 2023-04-28 01:47:20 +00:00
Jack Grigg 8b53d4a0c4 zcash_client_backend 0.9.0 2023-04-28 01:46:28 +00:00
Kris Nuttycombe c15a185454 Remove deprecated APIs & rename Sapling-specific data structures to include "Sapling"
This helps to clarify the Sapling-specific nature of a number of
operations in wallet code.
2023-04-26 14:47:10 -06:00
Jack Grigg ec1c1bcf21 Migrate to `secp256k1 0.26`, `hdwallet 0.4`
Closes zcash/librustzcash#823.
2023-04-19 19:33:34 +00:00
Jack Grigg adeb19ab40 zcash_client_sqlite 0.6.0 2023-04-15 00:02:00 +00:00
Jack Grigg 4dbb9c01e5 zcash_client_backend 0.8.0 2023-04-15 00:00:40 +00:00
Jack Grigg a419b56e80 zcash_primitives 0.11.0 2023-04-14 23:56:16 +00:00
Jack Grigg 7be5d1bf7d Update changelogs 2023-04-14 23:49:13 +00:00
Kris Nuttycombe cb1be45f22 Update CHANGELOGs to reflect the addition of the zcash_primitives/multicore feature. 2023-03-20 15:11:05 -06:00
Kris Nuttycombe 77fbd8cb4f Update dependencies to reflect changes in ff 0.13 2023-03-20 14:35:45 -06:00
Jack Grigg 5f7cae1762 zcash_client_sqlite 0.5.0 2023-02-01 02:12:47 +00:00
Jack Grigg d8cb20e091 zcash_client_backend 0.7.0 2023-02-01 02:11:56 +00:00
Jack Grigg 9852c31970 zcash_primitives 0.10.0 2023-02-01 02:10:42 +00:00
Jack Grigg 5b00699d66 Update changelogs 2023-02-01 01:58:45 +00:00
Francisco Gindre bf73ed3a00 Adds `limit` parameter to `validate_chain()`
This allows callers to validate smaller intervals of the given
`BlockSourceT` shortening processing times of the function call at the
expense of obtaining a partial result on a given section of interest of
the block source.

`params: &ParamsT` has been removed from the arguments since they were
only needed to fall back to `sapling_activation_height` when `None` as
passed as the `validate_from` argument. Passing `None` as validation
start point on a pre-populated `block_source` would result in an error
`ChainError::block_height_discontinuity(sapling_activation_height - 1, current_height)`

With this new API callers must specify a concrete `validate_from`
argument and assume that `validate_chain` will not take any default
fallbacks to chain `ParamsT`.

The addition of a `limit` to the chain validation function changes the
meaning of its successful output, being now a `BlockHeight, BlockHash)`
tuple indicating the block height and block hash up to which the chain
as been validated on its continuity of heights and hashes. Callers
providing a `limit` aregument are responsible of subsequent calls to
`validate_chain()` to complete validating the remaining blocks stored on
the `block_source`.

Closes zcash/librustzcash#705
2023-01-31 13:14:04 -07:00
Francisco Gindre e9eb5f8c0f Remove unstable function `WalletWrite::remove_unmined_tx`
Closes #622

Used PR https://github.com/zcash/librustzcash/pull/621 as reference to
know what had been added and remove it.
2023-01-31 15:21:46 -03:00
Jack Grigg 9226c98dd5 zcash_client_sqlite: `impl {Clone, Copy, Debug, PartialEq, Eq} for BlockMeta` 2023-01-25 15:33:02 +00:00
Jack Grigg e37f458a70 zcash_client_sqlite: Add `FsBlockDb::find_block` 2023-01-25 15:33:01 +00:00
Francisco Gindre 22351f46ee
Merge branch 'main' into blockmeta_rewind_to_height 2023-01-23 06:23:24 -03:00
Jack Grigg 49b1cb3e69 Bump MSRV for `zcash_primitives` and dependents to 1.60
The MSRVs of the component crates are left as-is, partly because our
dependencies don't require us to bump them, and partly because those
crates have no pending changes and are relatively stable. We also plan
to split the component crates out into a separate repository, where it
will be easier to have a separate MSRV.

Closes zcash/librustzcash#759.
2023-01-19 23:48:24 +00:00
Francisco Gindre 7306b9d2a9 [#751] add support for rewind_to_height to FsBlockDb
Closes #751

Ran `cargo fmt`

return the result as an error rather than unwrap

Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2023-01-17 14:43:33 -03:00
Jack Grigg a3e612e9de zcash_client_sqlite 0.4.2 2022-12-13 05:31:40 +00:00
Jack Grigg 9d50c0726e zcash_client_sqlite 0.4.1 2022-12-06 08:19:14 +00:00
Jack Grigg 7e71cc5353 Add `tracing` spans to light client chain scanning
This enables downstream users to profile how much time is spent in each
of the main subcomponents of the current chain scanner.
2022-12-06 08:17:49 +00:00
Jack Grigg 86cef4158b zcash_client_sqlite 0.4.0 2022-11-11 20:47:21 +00:00
Jack Grigg 98dd130f3a zcash_client_backend 0.6.0 2022-11-11 20:47:21 +00:00
Jack Grigg c3b6e5a72a zcash_primitives 0.9.0 2022-11-11 20:37:55 +00:00
Jack Grigg 318d1b7522 Clean up changelogs 2022-11-11 20:29:26 +00:00
Kris Nuttycombe 847ba49761 Add dust note detection to change selection.
The change selection algorithm has the most useful information for
determining whether or not a note is dust, so this adds a new error case
to `ChangeError` that allows the change selection to report the presence
of input notes without economic value back to its caller.
2022-11-10 12:18:30 -07:00
Kris Nuttycombe 9a7dc0db84 Add traits for fee estimation and input selection
This adds a set of abstractions that allow wallets to provide
independent strategies for fee estimation and note selection, and
implementations of these strategies that perform these operations in the
same fashion as the existing `spend` and `shield_transparent_funds`
functions.

This required a somewhat hefty rework of the error handling in
zcash_client_backend. It fixes an issue with the error types whereby
callees needed to have a bit too much information about the error
types produced by their callers.

Reflect the updated note selection and error handling in zcash_client_sqlite.
2022-11-10 12:17:59 -07:00
Sean Bowe 176e21b015
Update zcash_primitives to orchard 0.3; release zcash_primitives and zcash_proofs 0.8. 2022-10-19 13:32:51 -06:00
Kris Nuttycombe e666e69230 Address comments from code review. 2022-10-11 16:21:17 -06:00
Kris Nuttycombe fd1640c242 Update CHANGELOGs 2022-10-11 13:08:15 -06:00
Kris Nuttycombe 56b2edd498 Simplify sqlite backend storage for sent notes & utxos.
The currently deprecated implementations of `insert_sent_utxo`,
`insert_sent_note`, `put_sent_utxo` and `put_sent_note` all store to the
same `sent_notes` table internally. Since there's no immediate plan to
change this arrangement, it's better to have a single pair of internal
`insert_sent_output` and `put_sent_output` methods instead.
2022-10-11 08:57:44 -06:00
Kris Nuttycombe 6df6fec860 Add utxo received_by_account data to WalletTransparentOutput
Also, this removes wallet::delete_utxos_above.
2022-10-04 13:34:52 -06:00
Kris Nuttycombe f8fd27653c Add a BlockSource implementation that reads blocks from files in the filesystem.
Also, this adds functionality to create and insert records into the
block metadata db that is used as the source for which blocks to read.
2022-09-15 08:27:26 -06:00
Kris Nuttycombe d086c57f2f Make init_accounts_table only permit sequential account identifiers.
Also, check to ensure that account creation does not exceed the
maximum account identifier value.
2022-09-14 13:55:31 -06:00
Kris Nuttycombe b5908dc964
Merge pull request #632 from nuttycom/data_api/get_next_address
Replace `get_address` with `get_current_address` and `get_next_available_address`
2022-09-12 18:43:38 -06:00
Kris Nuttycombe 03b0ff7e0a Replace `get_address` with `get_current_address` and `get_next_available_address`
This updates the data access API to provide diversified address
functionality. In order to support this change, the addresses table
is updated to store diversifier index information in big-endian order
to allow sorting by diversifier index, and account initialization
is updated to store the diversifier index accordingly. The currently
unreleased `addresses_table` migration is updated to reflect this
change.
2022-09-12 17:58:22 -06:00
Kris Nuttycombe 7d1e976d0a Add missing `WalletMigrationError` to changelog. 2022-09-10 17:02:43 -06:00
Kris Nuttycombe 81c948a37e Add views that join transactions & notes for Android SDK support.
Android does not provide a good way to perform outer joins in
its type-safe query builder API, so we expose views build using
those joins instead.
2022-09-09 16:09:04 -06:00
Jack Grigg 154ef077b4 zcash_client_sqlite: Move address data to an `addresses` table
Closes zcash/librustzcash#489.
2022-09-08 18:50:18 +00:00
Jack Grigg 7d404d2747 zcash_client_sqlite: Fix `WalletRead::get_address` return value
Previously it would return an error if the account identifier did not
correspond to a known account.
2022-09-08 18:49:41 +00:00
Jack Grigg 586b7e5bb0 zcash_client_backend: Add `WalletWrite::remove_tx` method
This is to replace the database mutations in the Android SDK. It is
placed behind an `unstable` feature flag until we are satisfied that it
is suitable as a general-purpose API (or replace it).
2022-08-29 21:32:18 +00:00
Kris Nuttycombe e0c919cc68 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-08-18 10:15:58 -06:00
Kris Nuttycombe cdfaa57496 Add migrations to support using UFVKs instead of Sapling extfvks.
Fixes #594
2022-08-18 10:15:58 -06:00
Jack Grigg 76d015ed11 zcash_client_backend: Fix `UnifiedFullViewingKey` Sapling item type
Per ZIP 316, the Sapling FVK Encoding only includes `(ak, nk, ovk, dk)`
which is a subset of the Sapling `ExtendedFullViewingKey`. We therefore
need to use `DiversifiableFullViewingKey` inside `UnifiedFullViewingKey`
in order to make it parseable from the UFVK string encoding.

`zcash_client_sqlite::wallet::get_extended_full_viewing_keys` has been
removed as a consequence of this change: we can no longer reconstruct
the correct `ExtendedFullViewingKey` from the `UnifiedFullViewingKey`.
2022-06-17 10:03:17 +00:00
Jack Grigg 0d0527dbf3 zcash_client_sqlite: Store UFVK/UA instead of Sapling ExtFVK/address
This is a breaking change to the database format. We don't have support
for migrations yet, so existing wallets won't work after this commit
until zcash/librustzcash#489 is done.
2022-06-14 02:18:25 +00:00
Jack Grigg 144512b547 Migrate to `ff 0.12` 2022-05-06 20:03:49 +00:00