Commit Graph

103 Commits

Author SHA1 Message Date
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
Kris Nuttycombe 600c06a408 Update MSRV to 1.56.1 2022-02-24 12:26:14 -07:00
Kris Nuttycombe 3699a6df97 Fix typos. 2022-02-02 14:00:05 -07:00
Kris Nuttycombe 488d13fde3 Do not delete sent note data in rewind. 2022-02-02 12:48:22 -07:00
Kris Nuttycombe 9c2d485c80 Address comments from code review.
Co-authored-by: str4d <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-02 10:33:41 -07:00
Kris Nuttycombe 2f1d3da26d Update changelogs. 2022-01-27 16:25:01 -07:00
Jack Grigg 65e1d32774 ff 0.11, group 0.11, etc. 2021-09-09 18:20:37 +01:00
Jack Grigg 636845d0f9 Renames to use lower-case abbreviations (matching Rust convention)
As of our MSRV bump to 1.51.0, we get lints for this.
2021-03-27 19:01:03 +13:00
Jack Grigg afa0b29e62 Bump MSRV to 1.51.0
This is the MSRV for the orchard crate, which we will be depending on
soon.
2021-03-27 08:21:45 +13:00
Jack Grigg 4ff0a81a7f zcash_client_sqlite 0.3.0 2021-03-26 19:01:04 +13:00
Jack Grigg cb631a58ba zcash_client_sqlite: Add no-change fixes to changelog 2021-03-26 10:12:10 +13:00
Jack Grigg 464b533937 Bump MSRV to 1.47.0
We'll be needing it shortly for ff et al.
2021-03-04 17:32:57 +00:00
Jack Grigg 1f6f45bbe7 Add details of unreleased changes to changelogs 2021-02-22 16:59:07 +00:00
Jack Grigg bd3e18984c Changelogs: s/project/library 2021-02-04 15:16:32 +00:00
Jack Grigg b5c7d7f1e7 Add changelogs to the crates
The changelogs are accurate for the 0.4.0 release tag, but don't yet
include changes before or after that tag.
2021-02-04 15:13:22 +00:00
str4d 7176ff077c
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-24 12:05:15 +01:00
Jack Grigg 74bf85641c zcash_client_sqlite 0.2.1 2020-10-24 00:42:24 +01:00