Skip to content

Commit

Permalink
feat: add BlockHeader::blob_fee (#1754)
Browse files Browse the repository at this point in the history
* feat: add BlockHeader::blob_fee

* Update crates/consensus/src/block/header.rs

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
  • Loading branch information
klkvr and mattsse authored Dec 4, 2024
1 parent 221a1b9 commit 4b7d7a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/consensus/src/block/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,13 @@ pub trait BlockHeader {
/// Retrieves the block's extra data field
fn extra_data(&self) -> &Bytes;

/// Returns the blob fee for _this_ block according to the EIP-4844 spec.
///
/// Returns `None` if `excess_blob_gas` is None
fn blob_fee(&self) -> Option<u128> {
self.excess_blob_gas().map(calc_blob_gasprice)
}

/// Calculate excess blob gas for the next block according to the EIP-4844
/// spec.
///
Expand Down

0 comments on commit 4b7d7a5

Please sign in to comment.