Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

eth RPC should use Engine's extra_info() to populate header fields #3148

Closed
stevenroose opened this issue Nov 3, 2016 · 5 comments
Closed
Assignees
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M5-binaries 📦 External binaries (ethkey, ethstore, ethvm, etc.) M6-rpcapi 📣 RPC API.
Milestone

Comments

@stevenroose
Copy link

stevenroose commented Nov 3, 2016

As pointed out in ethereum/go-ethereum#3230, the Golang RPC client expects a mixHash field in the result of the eth_getBlockByNumber method.

Parity, also when using --geth, provides this information in sealFields instead of in mixHash.


The eth RPC should remain consensus-system neutral, however Engine trait provides extra_info() function which can provide these fields (for Ethash engine, it translates a header into these extra fields mixHash and nonce). BlockChainClient trait will need an additional function which proxys the Engine::extra_info() function through to Eth RPC handler so it can return it under the normal circumstances of returning a header.

The real difficult part is getting this into the JSONRPC serialiser, which afaik is hard coded to use only a structs fields. A custom serialiser will likely have to be done with the serialisable struct having an additional extra_info field, which is not serialised directly, but rather provides these additional key/value pairs for the JSON object.

@rphmeier rphmeier added F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M5-binaries 📦 External binaries (ethkey, ethstore, ethvm, etc.) labels Nov 3, 2016
@fjl
Copy link

fjl commented Nov 3, 2016

We also expect "v", "r", "s" for transactions, "root" and "logsBloom" for receipts btw. All of these are needed so we can reconstruct the consensus-related objects from RPC return values. I wanted to write an ERC proposal about this but didn't get to it yet.

@gavofyork gavofyork changed the title Geth 1.5 JSON API inconsistency eth RPC should use engine's extraInfo to populate block fields Nov 3, 2016
@gavofyork
Copy link
Contributor

@fjl best to place that in a separate issue.

@gavofyork gavofyork changed the title eth RPC should use engine's extraInfo to populate block fields eth RPC should use Engine's extraInfo() to populate block fields Nov 3, 2016
@gavofyork gavofyork changed the title eth RPC should use Engine's extraInfo() to populate block fields eth RPC should use Engine's extraInfo() to populate header fields Nov 3, 2016
@gavofyork gavofyork changed the title eth RPC should use Engine's extraInfo() to populate header fields eth RPC should use Engine's extra_info() to populate header fields Nov 3, 2016
@fjl
Copy link

fjl commented Nov 3, 2016

Transactions: #3158
Receipts: #3159

@tomusdrw
Copy link
Collaborator

tomusdrw commented Nov 7, 2016

Closed via #3169

@tomusdrw tomusdrw closed this as completed Nov 7, 2016
@gavofyork gavofyork added M6-rpcapi 📣 RPC API. and removed M6-rpcapi 📣 RPC API. labels Nov 12, 2016
@stevenroose
Copy link
Author

It seems that I'm again missing the mixHash field..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M5-binaries 📦 External binaries (ethkey, ethstore, ethvm, etc.) M6-rpcapi 📣 RPC API.
Projects
None yet
Development

No branches or pull requests

6 participants