Commit Graph

3022 Commits

Author SHA1 Message Date
Kris Nuttycombe 9f6831ea75 zcash_client_sqlite: Use cached statements for `insert_address` 2023-06-16 15:08:57 -06:00
Kris Nuttycombe 2354c8b48d zcash_client_sqlite: Use upsert & automatic caching of prepared statements for `put_sent_output` 2023-06-16 15:08:52 -06:00
Kris Nuttycombe 7917effe82 zcash_client_sqlite: Use upsert & automatic caching of prepared statements for `put_received_note` 2023-06-16 15:08:44 -06:00
Kris Nuttycombe 8d86ffd9c4 zcash_client_sqlite: Use `prepare_cached` instead of manual statement caching.
`rusqlite` includes a mechanism for creating prepared statements that
automatically caches them and reuses the caches when possible. This
means that it's unnecessary for us to do our own caching, and also
offers a minor performance improvement in that we don't need to eagerly
prepare statements that we may not execute in the lifetime of a given
`WalletDb` object. It also improves code locality, because the prepared
statements are now adjacent in the code to the parameter assignment
blocks that correspond to those statements.

This also updates a number of `put_x` methods to use sqlite upsert
functionality via the `ON CONFLICT` clause, instead of having to perform
separate inserts and updates.
2023-06-16 15:08:34 -06:00
Kris Nuttycombe d2f105efe9
Merge pull request #856 from zcash/release/primitives_0.12-etc
Release zcash_address 0.3.0, zcash_primitives 0.12.0 and zcash_proofs 0.12.0
2023-06-06 16:59:51 -06:00
Kris Nuttycombe e7fb276b04 Release zcash_proofs 0.12.0 2023-06-06 15:56:29 -06:00
Kris Nuttycombe f9cacc5b21 Release zcash_primitives 0.12.0 2023-06-06 15:56:28 -06:00
Kris Nuttycombe 60ac1070c5 Release zcash_address version 0.3.0 2023-06-06 15:53:16 -06:00
Kris Nuttycombe 75e529eea6 Upgrade to `bs58 0.5` 2023-06-06 15:53:14 -06:00
Kris Nuttycombe 3dd0c63095 Update to `incrementalmerkletree 0.4`, `orchard 0.5` 2023-06-06 14:27:39 -06:00
Kris Nuttycombe b0ca7ff321 Merge remote-tracking branch 'upstream/main' into release/primitives_0.12-etc 2023-06-06 13:43:19 -06:00
Kris Nuttycombe d2c58180b4
Merge pull request #853 from nuttycom/doc/zip321_errors
doc-only: Document ZIP 321 error variants.
2023-06-06 10:27:28 -06:00
Kris Nuttycombe 80adb54e26 Release zcash_note_encryption version 0.4.0 2023-06-06 10:12:33 -06:00
Kris Nuttycombe 0b126a107c
Clarify `Zip321Error::TooManyPayments` documentation.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2023-06-06 09:29:43 -06:00
Kris Nuttycombe bca951bf44 doc-only: Document ZIP 321 error variants.
Fixes #499
2023-06-06 08:42:54 -06:00
Kris Nuttycombe de771b7f22
Merge pull request #852 from nuttycom/wallet/sapling_cleanup
Consolidate sapling functionality in zcash_client_sqlite in a dedicated module.
2023-06-02 13:11:32 -06:00
Kris Nuttycombe 92d08b8504 Move `zcash_client_sqlite` Sapling wallet functionality to a dedicated module. 2023-06-02 10:59:17 -06:00
Kris Nuttycombe ebcfae987d Update the data access API in preparation for shardtree introduction. 2023-06-02 10:59:17 -06:00
Kris Nuttycombe 59eef51b9e
Merge pull request #851 from zcash/simplify_parse_note_plaintext_ovk_args
Remove esk and ephemeral_key arguments from `parse_note_plaintext_ovk`
2023-05-31 12:54:04 -06:00
Kris Nuttycombe 36d7222685
Merge pull request #844 from zcash/temporary-zcashd-parse-sapling
zcash_primitives: Changes needed for `zcashd` Sapling oxidation
2023-05-30 17:30:47 -06:00
Kris Nuttycombe fe3d0269d1 Add comments detailing the checks required prior to calling `check_note_validity` 2023-05-26 10:12:21 -06:00
Kris Nuttycombe 696a9be0a0 Update `zcash_primitives` to reflect argument changes to `parse_note_plaintext_without_memo_ovk` 2023-05-26 09:43:26 -06:00
Kris Nuttycombe be89e81534 Remove `esk` and `ephemeral_key` arguments from `parse_note_plaintext_without_memo_ovk`
Fixes #850
2023-05-26 09:24:22 -06:00
Kris Nuttycombe 3ae90020c3
Merge pull request #848 from zcash/note-encryption-avoid-redundant-checks
Avoid redundant checks during note decryption
2023-05-26 09:10:52 -06:00
Kris Nuttycombe d56c6624a6
Merge pull request #849 from nuttycom/upgrade_incrementalmerkletree
Upgrade `incrementalmerkletree` & `orchard` patch versions.
2023-05-25 14:47:15 -06:00
Kris Nuttycombe 980736806f Upgrade `incrementalmerkletree` & `orchard` patch versions. 2023-05-25 12:33:25 -06:00
Kris Nuttycombe 4b3ea857df
Merge pull request #818 from nathan-at-least/resolve-RUSTSEC-2023-0018
Bump `tempfile` to 3.5.0 to mitigate RUSTSEC-2023-0018…
2023-05-22 20:19:43 -06:00
Jack Grigg 2ae4d87cbf zcash_primitives: Remove redundant checks from Sapling note decryption
- The consistency check between `esk` and `ephemeral_key` is checked
  inside `zcash_note_encryption::try_output_recovery_with_ock`.
- The `diversifier` validity check is necessarily performed when
  deriving `pk_d` for the `ivk` pathway, so we keep it there for the
  `ovk` pathway as well, and drop the check from the `PaymentAddress`
  internal constructor.
2023-05-19 16:36:55 +00:00
Jack Grigg a115a8f00f zcash_note_encryption: Remove `esk` check requirement from `Domain::parse_note_plaintext_without_memo_ovk`
This method is only called from `try_output_recovery_with_ock`, and we
can instead rely on the check performed in `check_note_validity`,
reducing the number of checks that `Domain` implementations need to
perform.

The `esk` and `ephemeral_key` parameters become unused, and will be
removed in a subsequent commit (as this change needs to be synchronized
with the `orchard` crate).
2023-05-19 16:30:47 +00:00
Kris Nuttycombe b341903ae2
Merge pull request #842 from zcash/msrv-1.65
Bump MSRV for `zcash_primitives` and dependents to 1.65
2023-05-19 09:28:43 -06:00
str4d 1bc8f9a1de
Merge pull request #847 from zcash/hotfix/zcash_client_sqlite-0.7.1
Back-merge hotfix/zcash_client_sqlite-0.7.1
2023-05-18 22:32:40 +01:00
Kris Nuttycombe d4073cb2ec Merge remote-tracking branch 'upstream/main' into hotfix/zcash_client_sqlite-0.7.1 2023-05-18 14:56:14 -06:00
str4d a9733245e2
Merge pull request #846 from nuttycom/hotfix/zcash_client_sqlite/null_memo_crash
Return the empty memo when memo is not present.
2023-05-18 21:47:05 +01:00
Kris Nuttycombe 0780744443 Return the empty memo when memo is not present.
Memos may be absent for both sent and received notes in cases where only
compact block information has been used to populate the wallet database.
This fixes a potential crash in the case that we attempt to decode a
SQLite `NULL` as a byte array.

Fixes #384

(cherry picked from commit d99b4d4d6e)
2023-05-18 14:34:27 -06:00
Kris Nuttycombe fb8bf20a04
Merge pull request #843 from nuttycom/wallet/not_yet_fetched_memo
Update memo retrieval API to reflect that memos may not be present.
2023-05-17 11:07:54 -06:00
Kris Nuttycombe ea84243e0f Add `get_memo` change to the zcash_client_backend CHANGELOG 2023-05-17 08:56:24 -06:00
Jack Grigg 8db7a071a0 zcash_primitives: `impl DynamicUsage for sapling::Bundle<Authorized>` 2023-05-17 03:44:24 +00:00
Jack Grigg 26d95b4a0e zcash_primitives: Temporarily expose v5 Sapling bundle parsing
This is currently exposed via `Transaction` for usage in `zcashd`, but
may be removed in future (if `zcashd` moves transaction parsing entirely
into Rust), or renamed and stabilised.
2023-05-17 03:44:24 +00:00
Kris Nuttycombe d99b4d4d6e Update memo retrieval API to reflect that memos may not be present.
Memos may be absent for both sent and received notes in cases where only
compact block information has been used to populate the wallet database.
This fixes a potential crash in the case that we attempt to decode a
SQLite `NULL` as a byte array. It does, however, introduce a slight
semantic confusion that will need to be considered in the case of future
updates where a note may not have an associated memo; at present, the
only reason we might not have the memo is that we might not have
retrieved the full transaction information from the chain, but in the
future there might be other possible reasons for this absence.

Fixes #384
2023-05-16 10:27:40 -06:00
Jack Grigg a092da8d5d Fix clippy lints for 1.65 2023-05-16 15:59:58 +00:00
Jack Grigg 6419e1e363 Remove `inferno` pin now that its MSRV is compatible with ours 2023-05-16 15:39:06 +00:00
Jack Grigg 8681b56d52 Bump MSRV for `zcash_primitives` and dependents to 1.65 2023-05-16 15:37:07 +00:00
dependabot[bot] f1a2b95018
Bump codecov/codecov-action from 3.1.3 to 3.1.4
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.3...v3.1.4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-16 05:57:59 +00:00
Kris Nuttycombe 87212b6137
Merge branch 'main' into resolve-RUSTSEC-2023-0018 2023-05-12 09:08:59 -06:00
Kris Nuttycombe bc55893267
Merge pull request #838 from daira/update-fee-constants
Revert #830 and instead modify `zcash_primitives::transaction::fees::fixed::FeeRule::standard()`
2023-05-09 13:17:27 -06:00
Kris Nuttycombe a718810fa8
Update zcash_client_backend/src/data_api/wallet.rs 2023-05-09 12:32:56 -06:00
Kris Nuttycombe 6ceed86e9a
Merge pull request #839 from daira/fix-default-tx-expiry-delta
Update `DEFAULT_TX_EXPIRY_DELTA` to 40 blocks
2023-05-09 12:32:22 -06:00
Daira Emma Hopwood 32296e7327 Update `DEFAULT_TX_EXPIRY_DELTA` to 40 blocks, as specified in
<https://zips.z.cash/zip-0203#changes-for-blossom>. fixes #837.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-05-09 18:38:39 +01:00
Daira Emma Hopwood 9cc6319f26 Fix clippy lints.
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-05-09 17:59:03 +01:00
Daira Emma Hopwood 3903935234 Deprecate `transaction::components::amount::DEFAULT_FEE` and
`zcash_primitives::transaction::fees::fixed::FeeRule::standard()`.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-05-09 17:18:34 +01:00