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

OverflowException in new BlockHeader #4050

Closed
z3n-chada opened this issue May 23, 2022 · 0 comments · Fixed by #4176
Closed

OverflowException in new BlockHeader #4050

z3n-chada opened this issue May 23, 2022 · 0 comments · Fixed by #4176
Assignees

Comments

@z3n-chada
Copy link

Describe the bug
There is no check to the values that are cast to create a new BlockHeader from RLP. The client does not go down but does dump a stack exception.

To Reproduce
The issue was in creating a new block header from: https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Serialization.Rlp/HeaderDecoder.cs#L57

The block it received and was creating a header for is given here:

Error during method execution, request: ID 6, engine_newPayloadV1({
"parentHash": "0xf8a8724624d708afe4cd01ae82bc9c89da75ed3dc8310b5159023d61057ae1aa",
"feeRecipient": "0xa18fd83a55a9bedb96d66c24b768259eed183be3",
"stateRoot": "0xbe1b032def39b33ae87407bab2ea7c589a1bc2629d9382f922fb1b00dbf110da",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"prevRandao": "0x5cd80563a93ea305265308f38201448344855f9517dc2ff831f0c225ebe6de41",
"blockNumber": "0x85",
"gasLimit": "0x48CC2E",
"gasUsed": "0xFFFFFFFFFFFFFFFF",
"timestamp": "0x628AEADE",
"extraData": "0x",
"baseFeePerGas": "0x9a",
"blockHash": "0xc059bacd56efd278d61e2545cd98ff9c378a146c728ab89e855809e1fc066569",
"transactions": []
})

Expected behavior
No expected behavior, but a desirable one would be a test on the long casts to confirm they are within range and give the user more precise feedback. For example here before the case warn the user that an invalid gasUsed was received.

Screenshots
N/A

Desktop (please complete the following information):
linux

Additional context
N/A

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

Successfully merging a pull request may close this issue.

4 participants