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

feat: EIP-7742 #1600

Merged
merged 8 commits into from
Nov 27, 2024
Merged

feat: EIP-7742 #1600

merged 8 commits into from
Nov 27, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Oct 31, 2024

Motivation

https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7742.md
ethereum/execution-apis#574
ethereum/EIPs#8994

  • Added new mod to alloy-eips with utilities for blob fee calculation.
  • Extended PayloadAttributes with target_blobs_per_block and max_blobs_per_block.

Some PRs are not merged and field names are different per different specs for now, but besides that this should be complete

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@klkvr klkvr force-pushed the klkvr/eip7742 branch 2 times, most recently from 55ac6ae to b283c74 Compare October 31, 2024 20:05
Copy link
Member

@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.

cool, the integration in reth will be slightly more tricky because we now ran out of bits

https://github.com/paradigmxyz/reth/blob/eaac2aa2cfb6ea5a61eea2d9a36a8b66b7854ce4/crates/storage/codecs/src/alloy/header.rs#L58-L58

/// Similar to [crate::eip4844::calc_excess_blob_gas], but derives the target blob gas from
/// `parent_target_blob_count`.
#[inline]
pub const fn calc_excess_blob_gas(
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit concerned that this will be easy to misuse if the functions have the same name, but since this takes an additional param this is okay imo

Copy link
Member Author

Choose a reason for hiding this comment

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

those are now completely identical :/ EIP-7742 just expects a normalized excess gas

should we rename the new one?

@klkvr
Copy link
Member Author

klkvr commented Nov 27, 2024

pushed latest changes as per ethereum/EIPs#9047 in db75ee4

Comment on lines +694 to +695
/// Note: this function will return incorrect (unnormalized, lower) value at EIP-7742 activation
/// block. If this is undesired, consider using [`eip7742::calc_excess_blob_gas_at_transition`].
Copy link
Member Author

@klkvr klkvr Nov 27, 2024

Choose a reason for hiding this comment

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

I think this should be OK as I'd expect all consumers of this to not know whether the next block activates 7742 unless it's an EL

Copy link
Member

Choose a reason for hiding this comment

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

does this mean we need a special check for the transition block in reth?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep

Copy link
Member

@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

Comment on lines +694 to +695
/// Note: this function will return incorrect (unnormalized, lower) value at EIP-7742 activation
/// block. If this is undesired, consider using [`eip7742::calc_excess_blob_gas_at_transition`].
Copy link
Member

Choose a reason for hiding this comment

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

does this mean we need a special check for the transition block in reth?

crates/rpc-types-engine/src/prague.rs Outdated Show resolved Hide resolved
@klkvr klkvr merged commit 0ca76e8 into main Nov 27, 2024
26 checks passed
@klkvr klkvr deleted the klkvr/eip7742 branch November 27, 2024 16:55
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

Successfully merging this pull request may close these issues.

2 participants