Commit Graph

2477 Commits

Author SHA1 Message Date
Kris Nuttycombe f800f9f144
Merge pull request #613 from zcash/add-orchard-to-usk
zcash_client_backend: Generate Orchard component for USKs
2022-08-24 11:26:08 -06:00
Jack Grigg b42344d491 zcash_client_backend: Generate Orchard component for USKs
This ensures that the resulting UFVKs and UAs also contain Orchard
components.
2022-08-24 14:56:58 +00:00
Kris Nuttycombe 5dceb93ec8
Merge pull request #612 from nuttycom/wallet/set_fixed_user_version
Set a fixed `user_version` value for the sqlite schema in the initial migration.
2022-08-23 14:29:46 -06:00
Kris Nuttycombe a643fd5ea0
Merge pull request #611 from nuttycom/wallet/test_dump_schema
Add a test to check the result of database migrations against an expected schema.
2022-08-23 14:29:08 -06:00
Kris Nuttycombe 83c47b1a42 Set a fixed `user_version` value for the sqlite schema in the initial migration. 2022-08-23 12:23:47 -06:00
Kris Nuttycombe 6b73443f53 Add a test to check the result of database migrations against an expected schema. 2022-08-23 12:16:19 -06:00
dependabot[bot] d784c7b1ec
build(deps): bump actions/cache from 3.0.7 to 3.0.8
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.7...v3.0.8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-23 05:15:52 +00:00
str4d ca84123038
Merge pull request #609 from nuttycom/wallet/update_schemer
Update to schemer 0.2
2022-08-19 17:47:50 +01:00
str4d 58f34426d4
Merge pull request #608 from nuttycom/wallet/batch_trial_decryption
Implement parallel, batched trial decryption in wallet scanning.
2022-08-19 17:43:35 +01:00
Kris Nuttycombe 5d817f6120 Update to schemer 0.2 2022-08-19 09:55:55 -06:00
Kris Nuttycombe 397c76ca8d Add tests for batched note decryption. 2022-08-18 16:48:52 -06:00
Kris Nuttycombe 6156215d4c Add parallelized batched trial decryption to wallet scanning.
Co-authored-by: str4d <jack@electriccoin.co>
2022-08-18 16:48:22 -06:00
Kris Nuttycombe 7acd47eae8 Copy parallel batch decryption data types from zcash/zcash
This is an unmodified copy of 7d1e14ac3d/src/rust/src/wallet_scanner.rs

Co-authored-by: str4d <jack@electriccoin.co>
2022-08-18 16:40:27 -06:00
str4d d85f94c4d3
Merge pull request #602 from zcash/dependabot/github_actions/actions/cache-3.0.7
build(deps): bump actions/cache from 3.0.5 to 3.0.7
2022-08-18 23:32:37 +01:00
str4d 85a1522c22
Merge pull request #607 from adityapk00/oa
Return orchard address from UA
2022-08-18 23:32:19 +01:00
str4d 59d361f494
Merge pull request #600 from nuttycom/wallet/migrations
Add database migrations to zcash_client_sqlite.
2022-08-18 23:31:16 +01:00
Kris Nuttycombe 913d572087 Allow the seed to be an optional argument to database init.
This adds a new `WalletMigrationError` type so that we have
a good place to report whether or not the seed is required.
2022-08-18 16:03:20 -06:00
Kris Nuttycombe 61fb732e7b Ensure that we detect the correct pool type for sent notes. 2022-08-18 10:15:58 -06: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 880076b38f Improve error reporting for address & viewing key decoding. 2022-08-18 10:15:58 -06:00
Kris Nuttycombe 4930982d7e Test migrations against possibly-previously-existing database states.
This adds tests that verifies that migrations can run successfully
against databases in the following states:
* created by release version 0.3.0
* created by the `autoshielding_poc` branch
* created by current `main` prior to addition of migrations
2022-08-18 10:15:58 -06:00
Kris Nuttycombe e9db8d5b01 Use `secrecy` when handling seed phrases in migrations code. 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
Kris Nuttycombe 7c5b320108 Introduce wallet database schema migrations.
This replaces the current wallet initialization code with a migration
that brings the database up to the state produced by release 0.3.0.
A subsequent commit will add migrations that correctly produce the
database state as of zcash/librustzcash@602270cb1f.

Fixes #369
2022-08-18 10:15:58 -06:00
Aditya Kulkarni 1fad73d5b3 Return orchard address from UA 2022-08-17 08:10:06 -05:00
dependabot[bot] 61e6376c76
build(deps): bump actions/cache from 3.0.5 to 3.0.7
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.5 to 3.0.7.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.5...v3.0.7)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-12 05:15:06 +00:00
teor 276bcc34f5
Download sprout parameters in zcash_proofs (#459)
* Download sprout parameters in-memory
* Add download_sapling_parameters and deprecate download_parameters
  * This avoids confusion between sprout and sapling downloads,
    while maintaining backward compatibility.
* Download a single file, rather than parts
  * This is more efficient, because TCP adjusts its transfer speed
    in the first ~20 seconds of each new connection.
* Only download files if needed, but always check the hashes
* Allow the caller to specify a response timeout
* Stream downloads from server to disk
* Refactor file loads to use the same verifying function as downloads
* Check file sizes to help debug parameter load failures
* Remove downloaded files on error (but leave existing files alone)
* Add a sprout and sapling download example
* Move the download Read impl into its own module
* Derive standard traits on SaplingParameterPaths
* Require features for the load parameters method
2022-08-04 10:19:56 -06:00
Kris Nuttycombe 602270cb1f
Merge pull request #597 from nuttycom/cleanup/fix_doc_link_deny
Use the new name rustdoc::broken_intra_doc_links
2022-08-01 07:49:46 -06:00
Kris Nuttycombe 199c49760b Use the new name rustdoc::broken_intra_doc_links 2022-07-29 15:56:44 -06:00
Kris Nuttycombe 6cf088004f
Merge pull request #589 from nuttycom/wallet_scan_batch_decrypt
Use batch decryption for wallet scanning
2022-07-28 17:55:01 -06:00
str4d 753bb8ea18
Merge pull request #587 from zcash/dependabot/github_actions/actions/cache-3.0.5
build(deps): bump actions/cache from 3.0.4 to 3.0.5
2022-07-29 00:42:56 +01:00
Kris Nuttycombe 8a6e979cb9 Change return type of ScanningKey::to_sapling_keys to an associated type. 2022-07-28 17:28:31 -06:00
Kris Nuttycombe 73314dc682 Use batch decryption in wallet scanning.
This modifies wallet scanning to perform per-block batched
decryption. It also alters the structure of the `ScanningKey`
trait to correctly include internal (change) keys in the scan
process.
2022-07-28 17:28:31 -06:00
Kris Nuttycombe f1c2da7b1d Add sapling::NullifierDerivingKey newtype.
Nullifier computation only requires the nullifier deriving key,
not the entire Sapling viewing key. This separation of concerns
will be needed for batch decryption when wallet-internal keys
will need to be considered.
2022-07-28 15:23:21 -06:00
Kris Nuttycombe 878a428c3c Factor out witness updates from scan_output 2022-07-28 15:23:21 -06:00
Kris Nuttycombe 5873950648 Restructure batch decryption to avoid cartesian product of results.
While it is necessary in the worst case to perform `m * n` decryptions,
where `m` is the number of outputs being decrypted and `n` is the number
of IVKs, it is possible to stop performing trial decryptions when the
first successful decryption is performed. Also, it's inconvenient and
unnecessary to return the full cartesian product of these results, as
only one IVK will decrypt a given output. This commit modifies batch
trial decryption to stop on the first successful decryption, and instead
of returning the cartesian product of results we return the index of the
input IVK along with the output it decrypted. Note that this means that
trial decryption is not constant-time with respect to the number and/or
order of IVKs.
2022-07-28 15:23:21 -06:00
dependabot[bot] d9da63ebb0
build(deps): bump actions/cache from 3.0.4 to 3.0.5
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.4...v3.0.5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-13 05:20:32 +00:00
str4d 37fc28634e
Merge pull request #582 from zcash/zcash_proofs-0.7.1
zcash_proofs 0.7.1
2022-07-05 18:59:40 +01:00
Jack Grigg bac093f585 zcash_proofs 0.7.1 2022-07-05 17:33:07 +00:00
ebfull de46215d23
Merge pull request #580 from zcash/sapling-batch-validation
Sapling batch validation
2022-07-05 11:31:35 -06:00
Jack Grigg 6f0e26a504 zcash_proofs: Use threadpool for Sapling proof batch validation 2022-07-05 15:52:22 +00:00
Jack Grigg b52f3cc0fc zcash_proofs: Implement batch validation for Sapling bundles
We use the `redjubjub` crate for batch validation, because the demo
batch validation API in `zcash_primitives::redjubjub` cannot be used
outside that crate, and using `redjubjub` enables this to be published
as a point release of `zcash_proofs`.
2022-07-05 15:45:04 +00:00
Jack Grigg 9d72e87125 zcash_proofs: Split out internals of `SaplingVerificationContext`
The new `SaplingVerificationContextInner` struct handles accumulation of
`cv`, and preparation of the inputs to proof and signature verification.
`SaplingVerificationContext` uses it to maintain its existing inline
unbatched verification API.
2022-07-03 22:58:11 +00:00
str4d 739cfca68a
Merge pull request #575 from nuttycom/params_network
Return the network type for encoding addresses as part of the network parameters.
2022-06-30 20:15:42 +01:00
Kris Nuttycombe 94c8d8e7ef Return the network type for encoding addresses as part of the network parameters. 2022-06-30 12:09:32 -06:00
str4d 86b1db169c
Merge pull request #566 from zcash/dependabot/github_actions/actions/cache-3.0.4
Bump actions/cache from 3.0.2 to 3.0.4
2022-06-30 18:19:17 +01:00
Daira Hopwood 09567fc280
Merge pull request #574 from nuttycom/fix_account_key_init
Fix account key init
2022-06-29 21:36:29 +01:00
Kris Nuttycombe 0e098e1f17 Test correctness of unknown ufvk element roundtrip encoding. 2022-06-29 10:13:22 -06:00
Kris Nuttycombe 115d4b975e Don't rely on alignment between account IDs and keys when initializing the accounts table. 2022-06-29 10:13:13 -06:00
Daira Hopwood dae2e008e9
Merge pull request #577 from daira/bosl-notice
Projects that rely on BOSL exceptions should say that they do
2022-06-29 12:59:07 +01:00