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

feat(zebra-scan): Connect with zebrad #7989

Merged
merged 6 commits into from
Nov 27, 2023
Merged

feat(zebra-scan): Connect with zebrad #7989

merged 6 commits into from
Nov 27, 2023

Conversation

oxarbitrage
Copy link
Contributor

@oxarbitrage oxarbitrage commented Nov 23, 2023

Motivation

We want to pass the keys that are in the config from zebrad to zebra-scan at node startup.

Close #7946

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

  • In zebrad/src/comamnds/start.rs a Storage RAM database is created and the keys are dumped into it form config. Then the scan task is spawned with the created storage instance and the state.
  • The scan task is at zebra-scan/src/scan.rs. The task just print some logs at the moment for testing purposes.

Testing

  • A test was added to zebrad/test/accpentance.rs.

Review

I think 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 requested a review from a team as a code owner November 23, 2023 21:37
@oxarbitrage oxarbitrage requested review from teor2345 and removed request for a team November 23, 2023 21:37
@github-actions github-actions bot added the C-feature Category: New features label Nov 23, 2023
@oxarbitrage oxarbitrage self-assigned this Nov 23, 2023
@oxarbitrage oxarbitrage added P-Medium ⚡ A-concurrency Area: Async code, needs extra work to make it work properly. A-blockchain-scanner Area: Blockchain scanner of shielded transactions labels Nov 23, 2023
Copy link
Collaborator

@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.

I'm not sure what errors you're getting, so I've tried to make some suggestions about what it could be.

I can also look at the specific error if you post the code or the error.

zebra-scan/src/scan.rs Outdated Show resolved Hide resolved
zebra-scan/src/scan.rs Outdated Show resolved Hide resolved
zebrad/src/commands/start.rs Outdated Show resolved Hide resolved
zebrad/src/commands/start.rs Show resolved Hide resolved
zebra-scan/src/scan.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@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.

Looks good, since this is blocking other work, let's merge and replace things later.

I just quickly removed the panic that happens when the state is empty.

@mergify mergify bot merged commit 0f24c31 into main Nov 27, 2023
98 checks passed
@mergify mergify bot deleted the issue7946 branch November 27, 2023 12:52
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 A-concurrency Area: Async code, needs extra work to make it work properly. C-feature Category: New features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(scanner): Read and store keys from config at zebra startup
2 participants