Skip to content
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

eth_getBlockByNumber response does not include nonce field #1572

Closed
AaronKutch opened this issue Jun 4, 2022 · 4 comments
Closed

eth_getBlockByNumber response does not include nonce field #1572

AaronKutch opened this issue Jun 4, 2022 · 4 comments

Comments

@AaronKutch
Copy link

When I run moonbeam and run
curl -s --header "content-type: application/json" --data "{\"id\":10,\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"latest\",false]}" http://localhost:9944
I get as a response
{"jsonrpc":"2.0","result":{"author":"0x0000000000000000000000000000000000000000","baseFeePerGas":"0x3b9aca00","difficulty":"0x0","extraData":"0x","gasLimit":"0xe4e1c0","gasUsed":"0x0","hash":"0x4780a30650fb3f2383e908e56ea8e10920d1ecc0cbc86d4023e08f74b8824087","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","number":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sealFields":["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000"],"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1f8","stateRoot":"0xbcad73c5c355958948119ba82f3ccde19ec736e5971af646be9db93786179bb2","timestamp":"0x0","totalDifficulty":"0x0","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]},"id":10}
which does not include a nonce field and causes parsing to fail for our bridge

@crystalin
Copy link
Collaborator

@tgmichel can you look at that please ?

@tgmichel
Copy link
Contributor

tgmichel commented Jun 6, 2022

@AaronKutch thank you for reporting.

Frontier was initially coded re-using some of the parity/open-ethereum types. On its implementation eth_blockByNumber/Hash return seal_fields instead, which aimed to provide a broader support for non-PoW consensus.

That's the reason why nonce is missing in the payload: is part of seal_fields instead. However your issue made me think is maybe time to change that, as go-ethereum is way more adopted, and in addition nonce is part of the type definition for Ethers and web3js libraries.

Submitted a proposal upstream to replace the field polkadot-evm/frontier#712. If it's approved this change will be included in an upcoming client release.

On a side note and just to be clear, no matter if we return one or the other, the field's value is always defaulted to zero.

@AaronKutch
Copy link
Author

thanks, we will use a temporary workaround for now

@tgmichel
Copy link
Contributor

Closing, included in client v0.25.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@crystalin @tgmichel @AaronKutch and others