Standardize debug namespace#247
Conversation
|
It seems like the odd-method-out is |
|
I like the idea, but I think A |
|
Is It not the goal of admin namespace ? |
|
@daniellehrner @matkt okay seems reasonable enough to just forget about |
|
Need to specify what is the format of binary receipts. I would propose for it to be RLP of receipts already used when syncing. So instead of an array of bytes, it would be just bytes. |
|
Can some of this be revived too ethereum/interfaces#4 (in the future and not as part of this PR)? 😅 It is mostly concerned by methods used by development frameworks. |
|
@LukaszRozmej I've updated to clarify receipts are EIP-2718 binary-encoded. I'm not sure if using the EIP-2976 encoding of txs makes sense here (although can be convinced otherwise). The original motivation of the endpoint was to be something that could be used to quickly recalculate a block's receipt root. I'm going to leave the result as-is, unless there is convincing reason we should encode it using EIP-2976. |
704d036 to
12d90d3
Compare
|
Would addition of |
|
@zemse I'm not sure how useful it is to get a tx by hash for client-level debugging, but I see the merit in it generally. It should be extremely easy to implement regardless, so I've added it to the spec. |
|
Regarding the receipts, I side with @lightclient. The individual receipt objects should be encoded as they are handled by consensus. However, it's not very useful to get an RLP-list of all receipts. If you want to find a specific one, you need to decode the RLP. |
|
I've added With that, each new method has a corresponding test and this PR has been stable for well over a month now -- I'm going to go ahead and merge it. |
Clients currently support an assortment of debug-like RPCs and commands. In an effort to simplify debugging chain disagreements and have more reusable debugging tooling across clients, I propose we standardize five basic JSON-RPC methods.
debug_getRawHeader(hashOrNumber) -> bytes-- gets header RLP.debug_getRawBlock(hashOrNumber) -> bytes-- gets block RLP.debug_getRawTransaction(hash) -> bytes-- gets EIP-2718 encoded tx.debug_getRawReceipts(hashOrNumber) -> []bytes-- gets array of EIP-2718 encoded receipts.debug_getBadBlocks -> []BadBlock-- gets recent invalid blocks seen by the client.debug_setHead(number) -> null-- overrides the client and resets the head to a certain block number.edit: seems like the general consensus is to not expose
setHeadunder debug.Geth currently supports all of these (although the interfaces are slightly different at the moment). I see other clients support some of the methods.
I'd like to know: