Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change(zebra-scan): Scan only one key per backend call #8034

Merged
merged 2 commits into from
Nov 30, 2023
Merged

Conversation

oxarbitrage
Copy link
Contributor

Motivation

We want to scan only one key and one block per call to the zcash_client_backend::scanning::scan_block function.

The call support scanning a list of keys which it should be more efficient but we can't relate transaction with key in the results.

Close #8018

PR Author Checklist

Check before marking the PR as ready for review:

  • Will the PR name make sense to users?
  • Does the PR have a priority label?
  • Have you added or updated tests?
  • Is the documentation up to date?

Solution

Replace the list argument of the zebra zcan_block function with single key element.

The scanning_from_populated_zebra_state test case was removed because after the change no empty key will be allowed and the account/nullifier method to scan is not supported; by that the test ends up being the same as scanning_zecpages_from_populated_zebra_state

Testing

Change covered by existing scanning_zecpages_from_populated_zebra_state test, after minor modifications to the call argument.

Review

Anyone can review.

Reviewer Checklist

Check before approving the PR:

  • Does the PR scope match the ticket?
  • Are there enough tests to make sure it works? Do the tests cover the PR motivation?
  • Are all the PR blockers dealt with?
    PR blockers can be dealt with in new tickets or PRs.

And check the PR Author checklist is complete.

Follow Up Work

@oxarbitrage oxarbitrage added P-Medium ⚡ A-blockchain-scanner Area: Blockchain scanner of shielded transactions labels Nov 29, 2023
@oxarbitrage oxarbitrage self-assigned this Nov 29, 2023
@oxarbitrage oxarbitrage requested a review from a team as a code owner November 29, 2023 20:57
@oxarbitrage oxarbitrage requested review from arya2 and removed request for a team November 29, 2023 20:57
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@teor2345
Copy link
Contributor

The lightwalletd test failed with:

{"app":"lightwalletd","bind_addr":"127.0.0.1:40611","error":"listen tcp 127.0.0.1:40611: bind: address already in use","level":"fatal","msg":"couldn't create listener","time":"2023-11-29T21:21:38Z"}

https://github.com/ZcashFoundation/zebra/actions/runs/7038410028/job/19155707096?pr=8034#step:4:305

This is one of those bugs that happens occasionally when we use the same port as another test or running CI server process.

mergify bot added a commit that referenced this pull request Nov 29, 2023
@mergify mergify bot merged commit 1708f9d into main Nov 30, 2023
128 checks passed
@mergify mergify bot deleted the issue8018 branch November 30, 2023 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-blockchain-scanner Area: Blockchain scanner of shielded transactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scan keys one at a time, so we know which key(s) decrypt each transaction
2 participants