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-7691 #1762

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions crates/eips/src/eip7691.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//! Contains constants and utility functions for [EIP-7691](https://eips.ethereum.org/EIPS/eip-7691)

use crate::eip4844::{fake_exponential, BLOB_TX_MIN_BLOB_GASPRICE};

/// CL-enforced target blobs per block after Pectra hardfork activation.
pub const TARGET_BLOBS_PER_BLOCK_ELECTRA: u64 = 6;

/// CL-enforced maximum blobs per block after Pectra hardfork activation.
pub const MAX_BLOBS_PER_BLOCK_ELECTRA: u64 = 9;

/// Determines the maximum rate of change for blob fee after Pectra hardfork activation.
pub const BLOB_GASPRICE_UPDATE_FRACTION_PECTRA: u128 = 5007716;

/// Same as [`crate::eip4844::calc_blob_gasprice`] but uses the
/// [`BLOB_GASPRICE_UPDATE_FRACTION_PECTRA`].
#[inline]
pub fn calc_blob_gasprice(excess_blob_gas: u64) -> u128 {
fake_exponential(
BLOB_TX_MIN_BLOB_GASPRICE,
excess_blob_gas as u128,
BLOB_GASPRICE_UPDATE_FRACTION_PECTRA,
)
}
2 changes: 2 additions & 0 deletions crates/eips/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pub mod eip7251;

pub mod eip7685;

pub mod eip7691;

pub mod eip7702;

pub mod eip7742;
Loading