Commit Graph

3940 Commits

Author SHA1 Message Date
Jack Grigg 8f26eb9de4 devtools: Integrate `zcash-inspect` into workspace 2024-07-22 13:56:59 +00:00
Jack Grigg dc007ef47f devtools: Import `zcash-inspect` tool
Source: zcash/zcash@a0812adb18
2024-07-20 01:57:23 +00:00
Jack Grigg 18bfa38d89
Merge pull request #1450 from zcash/update-deps
cargo update
2024-07-19 16:47:17 +01:00
Jack Grigg 37f41f4b06 cargo update 2024-07-19 03:51:52 +00:00
Jack Grigg 8a7e663343
Merge pull request #1449 from zcash/doc-fix-without-features
zcash_client_backend: Fix `cargo doc` without all features
2024-07-19 03:32:52 +01:00
Jack Grigg 1ef11c23b7
Merge pull request #1422 from zcash/zcb-tor
zcash_client_backend: Add a Tor client that can fetch USD/ZEC exchange rates
2024-07-18 19:35:21 +01:00
Jack Grigg ac5bac9969 zcash_client_backend: Add exchanges we know how to query for USD/ZEC
Currently only unauthenticated connections are supported (i.e. no API
keys can be configured). However, AFAICT none of these exchanges provide
non-IP-based rate limits for authenticated connections to public APIs,
so authentication wouldn't help to make connections over Tor more
reliable.
2024-07-18 17:53:58 +00:00
Jack Grigg 739e878c8b zcash_client_backend: Add USD/ZEC exchange rate querying over Tor
This fetches price data from multiple exchanges over Tor, and takes the
median of the successful responses.

Closes zcash/librustzcash#1416.
2024-07-18 17:53:58 +00:00
Jack Grigg 907d37b928 zcash_client_backend: Fix `cargo doc` without all features 2024-07-18 01:37:45 +00:00
Jack Grigg b3de2ab81b zcash_client_backend: Add internal HTTP GET support to `tor::Client` 2024-07-18 01:25:17 +00:00
Jack Grigg 1e5b62bfce zcash_client_backend: Add a Tor client using the Arti library 2024-07-18 01:25:17 +00:00
Jack Grigg 4cefa92c28 Move SQLite dependency definitions from `zcash_client_sqlite` to root 2024-07-17 18:39:48 +00:00
Jack Grigg eaa43b4e25
Merge pull request #1257 from daira/implement-transparent-source-only
Add support for transparent-source-only (TEX) addresses
2024-07-17 19:27:36 +01:00
Kris Nuttycombe f8bedd89e7 Make ephemeral_addresses.address unique
This also provides additional documentation for why it's necessary
to store ephemeral_addresses table entries at indicies that do not
correspond to valid addresses.
2024-07-17 11:14:44 -06:00
Kris Nuttycombe 24b6d50d77 Apply suggestions from code review
Co-authored-by: Jack Grigg <thestr4d@gmail.com>
2024-07-17 07:51:58 -06:00
Kris Nuttycombe dbb5eeb704 Fix a potential crash related to varying behavior between change strategies.
It was possible for `GreedyInputSelector` to crash if the change
strategy being used for input selection were to place a ZIP 320
ephemeral output anywhere but as the last element in the returned change
values. This has been replaced by an error; the error will also be
returned if the change strategy returns more than one ephemeral output
in the change values.
2024-07-16 15:43:21 -06:00
Kris Nuttycombe aa4312326d Use `EphemeralBalance` instead of `EphemeralParameters`
The `EphemeralParameters` type makes too many states representable, in
particular, it represents that it is possible for a proposal step to
have both ephemeral inputs and ephemeral outputs. This change reduces
the representable state space to make it so that only one or the other
is true, and also makes clear that the change memo must be attached to
the change output of the intermediate step, and not to the ultimate
output to the final recipient (where we expect there to be no shielded
change, and therefore it is not possible to attach a memo.)
2024-07-16 13:53:31 -06:00
str4d 909c015e00
Merge pull request #1448 from zcash/zcash-0.1
`zcash 0.1.0`
2024-07-15 17:11:16 +01:00
Jack Grigg 013757b81c zcash 0.1.0 2024-07-15 15:31:57 +00:00
Jack Grigg 51e8fff161 zcash: Initial crate that just re-exports `zcash_primitives` 2024-07-15 15:30:54 +00:00
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
Daira-Emma Hopwood 56aa348a41 Extend the `send_multi_step_proposed_transfer` test to check the behaviour
when another wallet creates a transaction with an output to one of our
ephemeral addresses, and repair the implementation to pass this test.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-07 01:16:49 +01:00
Daira-Emma Hopwood 9856a70840 Simpler handling of a potential overflow.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 22:58:10 +01:00
Daira-Emma Hopwood 22b8cff6d1 The `TxId` argument to `EphemeralAddressReuse` does not need to be optional.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 20:37:07 +01:00
Daira-Emma Hopwood bda6451273 Change `unwrap`s to `expect`s when constructing `NonHardenedChildIndex`.
Also change the return type of `find_index_for_ephemeral_address_str` to
`Result<Option<NonHardenedChildIndex>, SqliteClientError>` so that the
`expect` is in the right place.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 20:13:35 +01:00
Daira-Emma Hopwood 27ca6e44d6 Remove unneeded `impl SealedChangeLevelKey for EphemeralIvk`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 20:13:35 +01:00
Daira-Emma Hopwood 6bc22f411e Documentation fixes and improvements.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 20:13:35 +01:00
Daira-Emma Hopwood b48f6272f0 Minor simplification in a test.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 19:48:54 +01:00
Daira-Emma Hopwood 86428c4afe Refactor `find_account_for_transparent_output` (now called
`find_account_for_transparent_address`) to take a `TransparentAddress`
rather than a `WalletTransparentOutput`.

Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 19:48:54 +01:00
Daira-Emma Hopwood a01588bc65 Ensure that `mark_ephemeral_address_as_mined` correctly handles indices
within the gap. Also support paging for `get_known_ephemeral_addresses`.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 19:48:54 +01:00
Daira-Emma Hopwood e97da43409 Refactoring to address review comments.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 05:24:32 +01:00
Daira-Emma Hopwood b63ff5bfcd Rename `get_reserved_ephemeral_addresses` to `get_known_ephemeral_addresses`
and change the `TransparentAddressMetadata` in its result map to not be
optional.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 05:24:32 +01:00
Daira-Emma Hopwood 01ff201ffb Minor changes responding to review comments.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-04 05:24:32 +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
Daira-Emma Hopwood 8636daa4f3 Tiny simplification.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-29 12:22:44 +01:00
Daira-Emma Hopwood 14bdcdeaaa We cannot spend prior outputs at all when "transparent-inputs" is not
enabled. (I got this right in a previous commit but broke it when
refactoring the proposal error handling.)

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-29 12:22:44 +01:00
Daira-Emma Hopwood 7838c048a2 Make `ephemeral_parameters` and `EphemeralParameters::NONE` available
unconditionally.

This removes a bunch of `#[cfg(feature = "transparent-inputs")]`
conditionals, with negligible (if any, after compiler optimization)
overhead. It also requires callers of functions with an
`ephemeral_parameters` parameter to do the intended thing to work
with "transparent-inputs" either enabled or disabled.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-29 12:22:44 +01:00
Daira-Emma Hopwood bc38f2af80 Document the `possible_change` parameter to `check_for_uneconomic_inputs`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-29 01:34:19 +01:00
Daira-Emma Hopwood 286439aa96 Define a constant `EphemeralParameters::NONE` instead of deriving `Default`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-29 01:33:50 +01:00
Daira-Emma Hopwood d32b7dbd8f Remove `ChangeValue::new`. Also document `ChangeValue::is_ephemeral` as
an addition in the changelog.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-28 21:49:51 +01:00
Daira-Emma Hopwood 3922d71ade Change the type of `n` in `reserve_next_n_ephemeral_addresses` back to `u32`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-28 20:59:12 +01:00
Kris Nuttycombe cd7ca2c64f zcash_client_sqlite: Update to `shardtree` commit 337f59179eda51261e9ddfc6b18e8fb84ea277c9
Fixes #1431
2024-06-28 13:52:08 -06:00
Daira-Emma Hopwood 25006ab013 Documentation improvement from code review.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-06-28 20:52:05 +01:00