-
Notifications
You must be signed in to change notification settings - Fork 53
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
WEB3-124: chore: address TODOs #243
Conversation
// safe conversion: according to the consensus spec, excess_blob_gas is always an uint64 | ||
blk_env.set_blob_excess_gas_and_price(excess_blob_gas.try_into().unwrap()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annoying that the upstream header type is factored to use u128
. I worry that an unwrap
here would become a DoS vector, in that a malformed header could crash the host. I think we should use as u64
instead, to simple truncate the result.
// safe conversion: according to the consensus spec, excess_blob_gas is always an uint64 | |
blk_env.set_blob_excess_gas_and_price(excess_blob_gas.try_into().unwrap()) | |
// safe conversion: according to the consensus spec, excess_blob_gas is always an uint64 | |
blk_env.set_blob_excess_gas_and_price(excess_blob_gas as u64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, isn't a weird overflow even worse than a clean panic?
If I am a malicious host/RPC, there are so many ways I could make the guest panic, like sending wrong state root or corrupted inclusion proofs, ...
This PR either resolves the open TODOs, or links them to an GitHub issue.
This PR either resolves the open TODOs, or links them to an GitHub issue.