-
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
Add basic support for the submitblock
RPC call
#5236
Comments
Hey @oxarbitrage you're using an outdated RPC documentation site, the latest one is https://zcash.github.io/rpc/ |
Hey team! Please add your planning poker estimate with Zenhub @arya2 @conradoplg @dconnolly @oxarbitrage @teor2345 @upbqdn |
@arya2 I rewrote the RPC return values in terms of Zebra's implementation, because it's a bit different from |
@arya2 I'm not sure if this ticket is ready to go yet, I think we'll also need to check which submission abbreviations are required by the mining pool software: Or we could check which ones |
It looks like |
@arya2 do miners rely on the error values returned by If they don't, we can just return a generic error. If they do, we could try implementing the errors by changing the existing BoxError returned by zebra-consensus and zebra-state? Most of the error statuses can be added using a quick in-memory function call. And they only need to be added when there is an error or chain fork, so we can skip them for most blocks. I'm not sure about |
@teor2345 I'm not sure how the error values are being used, a generic error may be good enough. I added a |
let's just go for generic errors for now, I don't think we have enough information yet and if we can save ourselves some time in the implementation better. We can always add more error types later on. |
submitblock
RPC callsubmitblock
RPC call
I split out detailed error handling into #5487, and made that ticket optional. I'll update the design as well. I also tweaked the description to match the current implementation. |
I don't think a missing parent will ever happen with The submitted block is based on a I am also concerned that combining this ticket with #5487 is a really large change for one PR. I'd prefer to keep the required RPC separate from the optional error-handling, until we find out if the error handling is needed. Can we start by implementing a basic zebra/zebra-state/src/service/write.rs Lines 248 to 249 in 7b47aac
(If submitting blocks takes too long, we can fix issues like #1968, #4794, #5425, or #4672, which will benefit all Zebra users. Or we can return a "pending" result, or do whatever |
Motivation
Mining pools use the
submitblock
RPC call.Mining Pool Usage
s-nomp
callssubmitblock
from this code:Requirements
https://zcash.github.io/rpc/submitblock.html
Detailed specification:
https://en.bitcoin.it/wiki/BIP_0023#Submission_Abbreviation
The goals of the
submitblock
RPC are to:Arguments:
hexdata
(required, the hex-encoded block data to submit)jsonparametersobject
(optional, currently ignored by zcashd, should be ignored by Zebra)workid
, that must be included in submissions if provided by the serverPossible Design
zebra_consensus::ChainVerifier
to verify the blockError handling
Detailed error handling is out of scope, see #5487.
zcashd
implementationhttps://github.com/zcash/zcash/blob/6c392dbb0b43d6988283e40ce423242833df2d30/src/rpc/mining.cpp#L869-L905
Testing
zcashd
andzebrad
RPC output using https://github.com/ZcashFoundation/zebra/blob/main/zebra-utils/zcash-rpc-diffWe might also want to implement #5015 to make writing tests for this issue quicker.
The text was updated successfully, but these errors were encountered: