Commit Graph

3950 Commits

Author SHA1 Message Date
Jack Grigg 86409235c2 devtools: Add `--lookup` argument to `zcash-inspect`
This queries `lightwalletd` for things that might be txids, and could be
extended to other queryable formats in future.
2024-07-24 19:07:56 +00:00
Kris Nuttycombe 104c0c2aed
Merge pull request #1453 from zcash/fix-tx-view-bug
`zcash_client_sqlite`: Fix bug in `utxos_to_txos` migration
2024-07-23 12:04:43 -06:00
Jack Grigg bbb73b0495 Fix clippy lint 2024-07-23 17:09:59 +00:00
Jack Grigg 1a562fb208 zcash_client_sqlite: Fix bug in `utxos_to_txos` migration
zcash/librustzcash@72d8df8e68 altered the
`v_received_notes` view to include transparent coins (renaming it to
`v_received_outputs`), and updated `v_transactions` to not separately
query transparent coins. The latter queried `v_received_notes` twice,
once to fetch notes received in a transaction, and again to fetch notes
spent in a transaction. The spent notes were obtained by joining on
the junction table `v_received_note_spends` to get the spent-in
transaction's ID. The commit retained the junction table join, but
didn't use it due to a typo, leading to notes being "spent-in" the
transaction they were received in. This bug had several effects:

- `account_balance_delta` showed `+change` for transactions in which a
  change note was received that had not yet been spent.
- `account_balance_delta` showed `0` for transactions in which all
  received notes had been subsequently spent.
- Transactions that spent funds with no change were omitted.
2024-07-23 17:09:59 +00:00
Jack Grigg e29622e972 zcash_client_sqlite: Check that ZIP 320 spend creates expected history 2024-07-23 17:09:59 +00:00
Jack Grigg a5e467f335
Merge pull request #1451 from zcash/devtools
Import `zcash-inspect` from `zcash/zcash` into a `devtools` crate
2024-07-22 19:31:32 +01:00
Kris Nuttycombe eceb8c7ff5
Merge pull request #1442 from hattizai/patch001
chore: remove duplicate words
2024-07-22 11:49:24 -06:00
Jack Grigg 427a3fc918 devtools: Show P2PKH <--> TEX conversion when inspecting one side 2024-07-22 13:56:59 +00:00
Jack Grigg 2c133215d3 devtools: Support parsing TEX addresses 2024-07-22 13:56:59 +00:00
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
hattizai 2244e0ff77 remove duplicate words 2024-07-03 11:01:40 +08:00