-
Notifications
You must be signed in to change notification settings - Fork 107
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
feature(rpc): Add basic long polling support to the getblocktemplate
RPC
#5843
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5843 +/- ##
==========================================
- Coverage 78.48% 78.44% -0.05%
==========================================
Files 308 308
Lines 38706 38706
==========================================
- Hits 30379 30361 -18
- Misses 8327 8345 +18 |
424853a
to
f94801d
Compare
This is ready for review, I'm doing some manual testing now. Automated testing will happen in the next PR. |
A bunch of google cloud jobs seemed to have failed setup with:
https://github.com/ZcashFoundation/zebra/actions/runs/3689513976/jobs/6246166936#step:11:78 |
@Mergifyio update |
✅ Branch has been successfully updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it should work.
5d1bba2
to
f94801d
Compare
f94801d
to
99f244f
Compare
I think is in case someone else wanted to review as @dconnolly is in the list as well. |
But i think one approval is ok here so we can just remove the do not merge tag. |
Just in case we wanted a second reviewer. I'll remove the label. |
Always happy to get a second review, but I try not to block unless someone has committed to doing a review soon. |
Motivation
This PR implements basic long polling support, checking for changes by re-fetching from the sync status, state and mempool.
Part of ticket #5720.
Complex Code or Requirements
We need to hold the RPC request open until the response will change. This means running a loop and a
select!{}
in a future.Solution
Implement inefficient long polling by checking the state/mempool/syncer, waiting 5 seconds, then checking it again. Also wait for the max time.
Related changes:
impl From<LongPollInput> for LongPollId
into a named methodlong_poll_id
fieldReview
This is ready for review, I'm doing some manual testing now. Automated testing will happen in the next PR.
Efficiency and refactors are out of scope for this PR, I'd like to focus on getting some kind of working implementation merged.
Reviewer Checklist
Follow Up Work