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

docs: add comment about potential overflow of base fee per gas #8280

Merged
merged 1 commit into from
May 17, 2024

Conversation

fgimenez
Copy link
Member

Base fee in EIP1559 is allowed to increase unbounded, and this is not reflected when it is converted from a UINT256 to a u64. It is improbable for it to be bigger than u64 max (would mean ~18 ETH per gas), the PR adds a comment about this.

@fgimenez fgimenez added A-rpc Related to the RPC implementation C-security Issue or pull request related to security. labels May 15, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fgimenez
Copy link
Member Author

@mattsse 👍 thx for the heads up! I see that base_fee_per_gas is already a U256 in engine types https://github.com/alloy-rs/alloy/blob/07611cfc9f277dc5bbfd7d21e9d70ad37b441a51/crates/rpc-types-engine/src/payload.rs#L172 but we are casting it to u64 here. Should we instead cast to u128 here too?

@mattsse
Copy link
Collaborator

mattsse commented May 15, 2024

yeah we should unify all of the fee fields to u128

@fgimenez fgimenez marked this pull request as draft May 16, 2024 07:52
@fgimenez fgimenez changed the title docs: add comment about potential overflow of base fee per gas WIP docs: add comment about potential overflow of base fee per gas May 16, 2024
@fgimenez
Copy link
Member Author

I see there's work in progress here alloy-rs/alloy#753 to unify the engine types to u128, will update this one when it is merged.

@mattsse mattsse marked this pull request as ready for review May 17, 2024 08:33
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

I decided against unifying the engine types after having a closer look at the specs which require the types to be 64bits

@mattsse mattsse added this pull request to the merge queue May 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 17, 2024
@fgimenez fgimenez changed the title WIP docs: add comment about potential overflow of base fee per gas docs: add comment about potential overflow of base fee per gas May 17, 2024
@fgimenez fgimenez added this pull request to the merge queue May 17, 2024
Merged via the queue into paradigmxyz:main with commit ac0a005 May 17, 2024
29 checks passed
@fgimenez fgimenez deleted the fgimenez/base-fee-overflow branch May 17, 2024 09:03
iulian-taraboanta added a commit to clainio/reth that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-security Issue or pull request related to security.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants