Commit Graph

3868 Commits

Author SHA1 Message Date
str4d b4bb31ffd2
Merge pull request #1447 from zcash/zcash_extensions-0.1
`zcash_extensions 0.1.0`
2024-07-15 16:29:07 +01:00
Jack Grigg aab11fd23c QA: Add `cargo vet` publisher for `zcash_extensions 0.1.0` 2024-07-15 15:02:46 +00:00
Kris Nuttycombe 034bad879c
Merge pull request #1444 from daira/sqlite3-debugging
Add utility methods on `TestState` to dump the contents of a database table, or run an sqlite3 command
2024-07-15 08:50:40 -06:00
Kris Nuttycombe 73d0c5b68b
Merge pull request #1446 from zcash/tonic-0.12
zcash_client_backend: Migrate to `tonic 0.12` with `http 1`
2024-07-15 08:47:29 -06:00
Jack Grigg 6ec8f6c933 zcash_extensions 0.1.0 2024-07-15 14:19:58 +00:00
Jack Grigg 270eec2574 CI: Don't test `zcash_client_backend/lightwalletd-tonic` on WASM
Broken until hyperium/tonic#1783 is addressed.
2024-07-11 18:09:49 -07:00
Jack Grigg e5517b61cc zcash_client_backend: Migrate to `tonic 0.12` with `http 1` 2024-07-11 22:23:55 +00:00
Daira-Emma Hopwood 615f6254f8 Add utility methods on `TestState` to dump the contents of a database
table, or to run an sqlite3 command. The latter is marked `unsafe`.
The name of the table must be a static string containing only `[a-ZA-Z_]`
characters. These are only usable if both `#[cfg(test)]` and the
"unstable" feature are enabled.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-07 02:12:12 +01:00
Kris Nuttycombe 34cf6d286a
Merge pull request #1439 from nuttycom/fix_shardtree_root_insertion
zcash_client_backend: Fix panic related to insertion of frontiers below subtree roots.
2024-06-30 08:33:12 -06:00
Kris Nuttycombe cd7ca2c64f zcash_client_sqlite: Update to `shardtree` commit 337f59179eda51261e9ddfc6b18e8fb84ea277c9
Fixes #1431
2024-06-28 13:52:08 -06:00
Kris Nuttycombe 5bd911f63b
Merge pull request #1402 from nuttycom/transparent_txos_migration
zcash_client_sqlite: Align handling of transparent UTXOs with that of shielded notes.
2024-06-24 20:34:44 -06:00
Kris Nuttycombe 9716617b55 Apply suggestions from code review
Co-authored-by: Jack Grigg <thestr4d@gmail.com>
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-24 14:50:29 -06:00
Kris Nuttycombe 10258b8443 zcash_client_sqlite: Address comments from code review. 2024-06-21 19:13:18 -06:00
Kris Nuttycombe 72d8df8e68 zcash_client_sqlite: Align handling of transparent UTXOs with that of shielded notes.
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2024-06-21 19:13:18 -06:00
Kris Nuttycombe d92bf27bfc zcash_client_sqlite: Move transparent-inputs wallet methods into the `wallet::transparent` module. 2024-06-21 19:13:17 -06:00
str4d 26c6b82e9b
Merge pull request #1419 from zcash/dependabot/github_actions/codecov/codecov-action-4.5.0
build(deps): bump codecov/codecov-action from 4.3.0 to 4.5.0
2024-06-20 21:23:03 +01:00
str4d 5e4c4a03e5
Merge pull request #1433 from nuttycom/fix_migration_pragmas
zcash_client_sqlite: Fix handling of PRAGMA directives.
2024-06-20 00:56:02 +01:00
Kris Nuttycombe 1110f5d8fb
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2024-06-19 16:50:20 -06:00
Kris Nuttycombe a452cf9669 zcash_client_sqlite: Fix handling of PRAGMA directives.
The `foreign_keys` pragma has no effect when used within a transaction,
so it should only be set at the top level. The `legacy_alter_table`
pragma should only be used in cases where its effect is explicitly
intended.
2024-06-19 15:16:18 -06:00
str4d de352218b1
Merge pull request #1432 from daira/update-wallet-pool-tests
Update tests in testing/pool.rs to use ZIP 317 fees
2024-06-19 21:44:07 +01:00
Daira-Emma Hopwood f0cf40543a Update tests in testing/pool.rs to use ZIP 317 fees.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-19 16:38:12 +01:00
str4d 4b2a942100
Merge pull request #1430 from daira/fee-semantic-change
Improvements to the strategy implemented by `{fixed,standard,zip317}::SingleOutputChangeStrategy`
2024-06-19 14:04:26 +01:00
Daira-Emma Hopwood 21d573122c `zcash_client_backend::{fixed,standard,zip317}::SingleOutputChangeStrategy`
now implement a different strategy for choosing whether there will be any
change, and its value. The aims are:

* Ensure that it is possible to create fully transparent transactions with
  no change (this will be needed for ZIP 320). The `InsufficientFunds`
  error in this case should have a `required` field that reflects the
  additional amount needed, according to the fee calculated without an
  extra change output.
* Avoid leaking information about note amounts in some cases: an adversary
  that knew the number of external recipients and the sum of their outputs
  was able to learn the sum of the inputs if no change output was present.
* Defend against losing money by using `DustAction::AddDustToFee` with a
  too-high dust threshold.
* Ensure that if a "change memo" is requested, there will always be a
  shielded change output in which to put it. Previously, this would not
  be the case when using `DustAction::AddDustToFee`.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-19 13:12:17 +01:00
Kris Nuttycombe 06c089535a
Merge pull request #1423 from daira/pre-zip-320-refactoring
Cleanups, refactoring, and placeholder for TEX addresses
2024-06-18 14:44:37 -06:00
Daira-Emma Hopwood 0b7f60d544 Refactoring of change calculation.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:24:33 +01:00
Daira-Emma Hopwood 4f935a7fa3 Define an error type alias for brevity.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:24:33 +01:00
Daira-Emma Hopwood dcf0187e52 Fix a typo in an error message.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:24:33 +01:00
Daira-Emma Hopwood 41c30ef44d "child index" -> "address index" where applicable.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:24:33 +01:00
Daira-Emma Hopwood 9881e811ea Miscellaneous documentation improvements.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:24:33 +01:00
Daira-Emma Hopwood c9c7fa3b79 Use a simpler way of ascribing a type to an empty slice.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:06:42 +01:00
Daira-Emma Hopwood 6f4a3b107e Address a review comment concerning `Vector::serialized_size`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:06:42 +01:00
Daira-Emma Hopwood 9881861228 Add `zcash_encoding::{CompactSize, Vector}::serialized_size` and
`zcash_primitives::legacy::Script::serialized_size`. Use the latter in
`zcash_primitives::transaction::fees::transparent::OutputView::serialized_size`.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:06:39 +01:00
Daira-Emma Hopwood 17af8e32e8 Refactor `FeeRule::fee_required` to take the sizes of transparent
inputs and outputs.

Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:05:49 +01:00
Daira-Emma Hopwood 6d35583a4b Add `OutPoint::fake()` helper.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:03:22 +01:00
Daira-Emma Hopwood cefbaf59d5 Add `zcash_client_backend::fees::{sapling,orchard}::EmptyBundleView`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:03:22 +01:00
Daira-Emma Hopwood 2337f79484 Add `zcash_keys::Address::Tex`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:03:22 +01:00
Daira-Emma Hopwood 6c90219817 Prefer the `PoolType::{SAPLING, ORCHARD, TRANSPARENT}` constants to
`PoolType::{Shielded(_), Transparent}`.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:03:22 +01:00
Daira-Emma Hopwood c3e532f29b The return type of `ChangeValue::new` is now optional; it returns `None`
if a memo is given for the transparent pool. Use `ChangeValue::shielded`
to avoid this error case when creating a `ChangeValue` known to be for a
shielded pool.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:03:22 +01:00
Daira-Emma Hopwood 3582f84686 Allow `ChangeValue::output_pool` to reference the transparent pool by
changing its type from `ShieldedProtocol` to `PoolType`.

Also fix compilation errors when the "orchard" feature is used without
the "transparent-inputs" feature.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:03:22 +01:00
Daira-Emma Hopwood 1d9fede906 Cosmetic fixes to changelog.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-18 21:03:22 +01:00
str4d dd3a55713f
Merge pull request #1429 from zcash/zcs-db-docs
zcash_client_sqlite: Start documenting the table structures
2024-06-18 20:50:07 +01:00
str4d 444de3bdfa
Merge pull request #1428 from AArnott/patch-1
Drop orchard unstable flag from VS Code settings
2024-06-18 20:26:52 +01:00
Jack Grigg cf1922cdee zcash_client_sqlite: Move pinned views to `wallet::db` module 2024-06-18 19:21:03 +00:00
Jack Grigg 39bf4caa20 zcash_client_sqlite: Initial pass at documenting table structures
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2024-06-18 16:48:05 +00:00
Jack Grigg 3599c6afe7 zcash_client_sqlite: Move pinned indices to `wallet::db` module 2024-06-18 14:24:33 +00:00
Jack Grigg 9c98a649ee zcash_client_sqlite: Move pinned table structures to `wallet::db` module 2024-06-18 14:24:33 +00:00
Andrew Arnott bb06f84f65
Drop orchard unstable flag from VS Code settings
This setting is no longer required, and its presence greatly increases build and test times while using VS Code extensions for rust because inconsistent settings are used, defeating the rust build cache.
2024-06-18 08:14:39 -06:00
Kris Nuttycombe 87e23081d0
Merge pull request #1421 from zcash/dep-bip32
Migrate from `hdwallet` to `bip32`
2024-06-17 17:04:14 -06:00
str4d 03fc64cfd0
Merge pull request #1396 from nuttycom/test/block_spanning_shards
`zcash_client_sqlite` Fix error related to commitment tree frontier insertions.
2024-06-17 19:29:44 +01:00
Kris Nuttycombe 3e090dca66 Apply suggestions from code review
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-17 11:40:47 -06:00