-
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
change(rpc): add submitblock RPC method #5526
Conversation
60ec68d
to
618a33d
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5526 +/- ##
==========================================
+ Coverage 78.76% 78.85% +0.08%
==========================================
Files 305 305
Lines 38114 38116 +2
==========================================
+ Hits 30022 30057 +35
+ Misses 8092 8059 -33 |
@Mergifyio update |
✅ Branch has been successfully updated |
@Mergifyio update |
✅ Branch has been successfully updated |
Looks great! I think we might need to fix a few things before we merge:
I also opened a PR with a refactor that simplifies this code a bit, with some minor doc bug fixes: |
Here are some details: I think "null" But what is actually expected is the JSON null It looks like the easiest way to generate a |
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.
I think it looks great. I added a few minor comments while the only really blocking is the test failure.
I was not able to run submitblock
test locally yet but i will.
🤦 Oops.
I used an untagged enum which behaves the same way, let me know if you think
The empty hexdata gives a deserialization error. 😐 I could try using Mainnet and |
Both tests seem good! Let's name the snapshot files after the kind of failure we expect? |
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.
Thanks for this!
There are a bunch of minor changes we can do, but none of them are blockers.
I've made some suggestions for cleaning up the acceptance test, but I'd like to deal with any further revisions in another PR. (When we do #5015 for this acceptance test.)
Co-authored-by: Alfredo Garcia <[email protected]>
…to chain_verifier to keep it consistent with naming in zebra-consensus
…mit_block method from server error to parse error
please fix conflicts, thanks :) |
zebra-rpc/src/methods/get_block_template_rpcs/types/submit_block.rs
Outdated
Show resolved
Hide resolved
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.
Is the RPC JSON response in the expected format?
All my other suggestions are optional.
...a-rpc/src/methods/tests/snapshot/snapshots/snapshot_rpc_submit_block_invalid@mainnet_10.snap
Outdated
Show resolved
Hide resolved
…nd removes the unrelated make_server_error refactor for now
They are, but the snapshot test was not. |
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.
Thanks!
@Mergifyio update |
✅ Branch has been successfully updated |
Motivation
Introduces basic support for the
submitblock
rpc method used by mining pools.Closes #5236 as part of #5234
Designs
Data flow diagram
Specifications
https://zcash.github.io/rpc/submitblock.html
Solution
GetBlockTemplateRpcImpl
structReview
This PR is part of regular scheduled work.
Reviewer Checklist
Follow Up Work
submitblock
RPC #5487