Return detailed errors from the submitblock
RPC
#5487
Labels
A-rpc
Area: Remote Procedure Call interfaces
A-rust
Area: Updates to Rust code
A-state
Area: State / database changes
C-enhancement
Category: This is an improvement
S-needs-triage
Status: A bug report needs triage
Motivation
If we find a mining pool that relies on detailed
submitblock
RPC errors, we should implement them.Otherwise this ticket is optional.
This depends on #2908, because it changes the errors in the state.
Mining Pool Usage
s-nomp
callssubmitblock
from this code:Requirements
https://zcash.github.io/rpc/submitblock.html
https://en.bitcoin.it/wiki/BIP_0023
The goals of the
submitblock
RPC are to:Possible Design
Return null if the block is accepted onto the best chain in the non-finalized state. Otherwise, return a detailed error containing the specified text.
See the TODO comments in the
submit_block()
RPC function for details.Error handling
We need to check if miners rely on any specific error values.
Return
zcashd
implementation:https://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: