Commit Graph

3022 Commits

Author SHA1 Message Date
Kris Nuttycombe faccf56f04 Split `PoolType` enum into `PoolType` and `ShieldedProtocol`
There are cases where we wish to return informaiton that is relevant to
a specific shielded protocol and `Transparent` is an invalid case. This
is a minor preparatory refactoring that makes this distinction
expressible.
2023-07-05 18:20:43 -06:00
Kris Nuttycombe 1e5b23aeba zcash_client_backend: Add `put_sapling_subtree_roots` to `WalletCommitmentTrees`
Also add the `zcash_client_sqlite` implementation & tests for the new
method.
2023-07-05 18:18:20 -06:00
Kris Nuttycombe d8148f90e7
Merge pull request #831 from nuttycom/feature/pre_dag_sync
Migrations & data storage for pre-DAG-sync
2023-07-04 13:52:10 -06:00
Kris Nuttycombe c13c8c6678 Address comments from code review. 2023-07-03 17:08:01 -06:00
Kris Nuttycombe c363e71fa9 Rename proto::compact::{BlockMetadata => ChainMetadata} 2023-07-03 16:19:13 -06:00
Kris Nuttycombe 42ed6ba2a1 Rename `zcash_client_backend::welding_rig` to `zcash_client_backend::scanning` 2023-07-03 10:49:03 -06:00
Kris Nuttycombe 09a0096c74 Use valid serialized CommitmentTree values for migration tests. 2023-07-03 10:49:03 -06:00
Kris Nuttycombe e3aafdad19 Move chain continuity checks into `scan_block_with_runner`
In preparation for out-of-order range-based scanning, it is necessary
to ensure that the size of the Sapling note commitment tree is carried
along through the scan process and that stored blocks are always
persisted with the updated note commitment tree size.
2023-07-03 10:49:03 -06:00
Kris Nuttycombe 77b638012b Remove `zcash_client_backend::data_api::chain::validate_chain`
Local chain validation will be performed internal to
`scan_cached_blocks`, and as handling of chain reorgs will need to
change to support out-of-order scanning, the `validate_chain` method
will be superfluous. It is removed in advance of other changes in order
to avoid updating it to reflect the forthcoming changes.
2023-07-01 17:58:01 -06:00
Kris Nuttycombe e225a54d2e Use `NonZeroU32` for all `min_confirmations` values. 2023-06-30 12:37:41 -06:00
Kris Nuttycombe 8625e9a777 Handle parsing of the not-present `CommitmentTree` sentinel. 2023-06-30 12:08:06 -06:00
Kris Nuttycombe 70497a241c Only store z->t transaction data once, not once per Sapling output. 2023-06-30 10:42:48 -06:00
Kris Nuttycombe cd939f94c4 Ensure that checkpoints are ordered by position when querying for pruning. 2023-06-30 09:48:19 -06:00
Kris Nuttycombe 95745dd620 Use ruqlite::Rows::mapped to allow `collect` 2023-06-30 09:45:06 -06:00
Kris Nuttycombe 45177a51e1 Fix off-by-one error in scan_block_with_runner. 2023-06-30 09:30:24 -06:00
Kris Nuttycombe c05b3d0c8c Add a test demonstrating off-by-one error in `scan_block_with_runner` 2023-06-30 09:30:24 -06:00
Kris Nuttycombe 8fa3a08c0b Fix indexing error in checkpoint determination. 2023-06-30 09:30:24 -06:00
Kris Nuttycombe d65b129b43 Apply changelog, documentation & style suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2023-06-30 09:30:24 -06:00
Kris Nuttycombe ba709177d3 Reorganize Sapling and Orchard note commitment tree sizes in CompactBlock.
We move thes fields out into a separate BlockMetadata struct to ensure
that future additions to block metadata are structurally separated from
future additions to block data.
2023-06-29 15:35:18 -06:00
Kris Nuttycombe 547634e210 zcash_client_sqlite: Move the SqliteShardStore implementation out of the `wallet::sapling` module. 2023-06-29 15:35:18 -06:00
Kris Nuttycombe 106669d977 zcash_client_sqlite: Generalize SQLite-backed ShardStore impl to make it reusable for Orchard. 2023-06-29 15:35:18 -06:00
Kris Nuttycombe 0a4236f725 zcash_client_sqlite: Add tests for sqlite-backed ShardTree & fix revealed issues. 2023-06-29 15:35:18 -06:00
Kris Nuttycombe 425b5e01d7 zcash_client_sqlite: Support shardtree checkpoint functionality 2023-06-29 15:35:18 -06:00
Kris Nuttycombe c42cffeb1d zcash_client_backend: Replace `WalletWrite::advance_by_block` with `WalletWrite::put_block`
Also, add assertions to prevent attempting the creation of zero-conf
shielded spends.
2023-06-29 15:35:18 -06:00
Kris Nuttycombe d11f3d2acc zcash_client_sqlite: Add shardtree truncation & checkpoint operations. 2023-06-29 15:35:18 -06:00
Kris Nuttycombe ade882d01c zcash_client_sqlite: Add shard & checkpoint insertion. 2023-06-29 15:35:18 -06:00
Kris Nuttycombe 9f2bb94a5e zcash_client_sqlite: Add shard persistence to wallet migration. 2023-06-29 15:35:18 -06:00
Kris Nuttycombe ed2e22b737 zcash_client_sqlite: Add shard serialization & parsing 2023-06-29 15:35:18 -06:00
Kris Nuttycombe 3e358bc1c9 zcash_client_backend: Use `shardtree` for note commitments in block scanning.
Also adds a skeleton `zcash_client_sqlite` implementation of
`shardtree::ShardStore` and a skeleton migration for related
database changes.
2023-06-29 15:35:18 -06:00
str4d fe80d895a0
Merge pull request #864 from zcash/drop-directories
Replace `directories` dependency with `home, known-folders, xdg`
2023-06-28 19:33:33 +01:00
Jack Grigg 6f4d68f935 zcash_proofs 0.12.1 2023-06-28 18:37:37 +01:00
Jack Grigg 3de60c7b91 Replace `directories` dependency with `home, known-folders, xdg`
`directories 5.0.1` added a dependency on `option-ext`, which is
licensed as MPL (a copyleft license). The replacement dependencies
are all licensed as `MIT OR Apache-2.0`.
2023-06-28 18:37:37 +01:00
Kris Nuttycombe 32e2991c4d zcash_client_backend: Add note commitment tree sizes to `CompactBlock` serialization. 2023-06-26 10:19:43 -06:00
str4d fa67d9a645
Merge pull request #841 from zcash/dependabot/github_actions/codecov/codecov-action-3.1.4
Bump codecov/codecov-action from 3.1.3 to 3.1.4
2023-06-23 23:16:31 +01:00
str4d 5e7eea7428
Merge pull request #863 from nuttycom/add_orchard_to_transaction_builder
Add Orchard to transaction builder
2023-06-23 23:01:52 +01:00
Kris Nuttycombe 7fe02f0606 Remove needless bound on `FeeRule` from builder `Error` type. 2023-06-23 15:24:38 -06:00
Kris Nuttycombe 1b4017e0d1
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2023-06-23 15:16:10 -06:00
Kris Nuttycombe 95abfe5836
Improve documentation for `zcash_primitives::transaction::builder::Error::OrchardAnchorNotAvailable`
Co-authored-by: str4d <thestr4d@gmail.com>
2023-06-23 14:56:49 -06:00
Hazel OHearn 4fbdd64c89 Add Orchard support to `zcash_primitives::transaction::builder::Builder`
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2023-06-23 14:09:59 -06:00
Hazel OHearn dce8676974 Remove impls of `{PartialEq, Eq}` for `zcash_primitives::transaction::builder::Error`
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2023-06-23 14:07:15 -06:00
Kris Nuttycombe 06a7849cb7
Merge pull request #859 from nathan-at-least/rustsec-2022-0090-fix
[Impacts API versioning] Update dependencies to resolve RUSTSEC-2022-0090
2023-06-19 12:22:04 -06:00
Kris Nuttycombe d5166b5134 Merge branch 'wallet/sqlite_cached_statements' 2023-06-19 07:55:08 -06:00
Nate Wilcox 5ba44b9019 Update dependencies to resolve https://rustsec.org/advisories/RUSTSEC-2022-0090 2023-06-17 12:44:35 -07:00
Kris Nuttycombe 48434bb271 zcash_client_sqlite: Fix SQL identation errors. 2023-06-16 15:09:33 -06:00
Kris Nuttycombe 91f0f03d9d zcash_client_sqlite: Factor out common logic for the representation of stored memos. 2023-06-16 15:09:29 -06:00
Kris Nuttycombe 820e61caaa zcash_client_sqlite: Avoid swallowed errors in max-block-height queries. 2023-06-16 15:09:26 -06:00
Kris Nuttycombe 4b9180cb04 zcash_client_sqlite: Fix details of `put_sent_output` documentation.
Also address a minor naming issue from code review.
2023-06-16 15:09:19 -06:00
Kris Nuttycombe 2674209818 zcash_client_sqlite: Remove the remainder of DataConnStmtCache 2023-06-16 15:09:14 -06:00
Kris Nuttycombe bf7f05282f zcash_client_sqlite: Fix missing incrementalmerkletree feature dependency 2023-06-16 15:09:07 -06:00
Kris Nuttycombe 21f82e539f zcash_client_sqlite: Use cached prepared statements for transparent UTXO operations. 2023-06-16 15:09:02 -06:00