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

add(scan): Create a tower Service in zebra-scan #8185

Merged
merged 7 commits into from
Jan 24, 2024
Merged

add(scan): Create a tower Service in zebra-scan #8185

merged 7 commits into from
Jan 24, 2024

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Jan 23, 2024

Motivation

This PR adds a ScanService struct to zebra-scan to be used by RPC methods in zebra-grpc.

Closes #8182.

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?
For significant changes:
  • Is there a summary in the CHANGELOG?
  • Can these changes be split into multiple PRs?

If a checkbox isn't relevant to the PR, mark it as done.

Solution

  • Defines ScanService/ScanTask structs and ScanTaskCommand enum
  • Defines Request and Response enums in zebra-node-services
  • Implements tower::Service for ScanService
  • Adds an instance of Storage and ScanTask to fields on ScanService
  • Checks for panics in poll_ready() method
  • Adds some possible Request variants and match arms in call() method

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

Implement match arms for Request variants

@arya2 arya2 added A-rpc Area: Remote Procedure Call interfaces A-concurrency Area: Async code, needs extra work to make it work properly. A-blockchain-scanner Area: Blockchain scanner of shielded transactions P-Medium ⚡ labels Jan 23, 2024
@arya2 arya2 self-assigned this Jan 23, 2024
@arya2 arya2 requested a review from a team as a code owner January 23, 2024 00:16
@arya2 arya2 requested a review from a team as a code owner January 23, 2024 00:16
@arya2 arya2 requested review from oxarbitrage and removed request for a team January 23, 2024 00:16
@oxarbitrage oxarbitrage added do-not-merge Tells Mergify not to merge this PR and removed do-not-merge Tells Mergify not to merge this PR labels Jan 23, 2024
upbqdn
upbqdn previously approved these changes Jan 24, 2024
Copy link
Member

@upbqdn upbqdn left a comment

Choose a reason for hiding this comment

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

All looks great.

upbqdn
upbqdn previously approved these changes Jan 24, 2024
Copy link
Contributor

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

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

This looks good to me, i think we should add at least 1 test of the service but we can do it somewhere else. I will use the service, add a new request/response in the context of #8178 and will add a test there.

mergify bot added a commit that referenced this pull request Jan 24, 2024
@mergify mergify bot merged commit 513ace2 into main Jan 24, 2024
132 checks passed
@mergify mergify bot deleted the scan-service branch January 24, 2024 22:37
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. A-rpc Area: Remote Procedure Call interfaces P-Medium ⚡
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Service implementation in zebra-scan to use in zebra-grpc
3 participants