Skip to content

Commit

Permalink
feat: EIP-7691 (#1762)
Browse files Browse the repository at this point in the history
* feat: EIP-7691

* fix
  • Loading branch information
klkvr authored Dec 7, 2024
1 parent 8c0f116 commit 82c7de1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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;

0 comments on commit 82c7de1

Please sign in to comment.