-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add 4844 header fields and consensus checks (#3972)
- Loading branch information
Showing
12 changed files
with
368 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//! Helpers for working with EIP-4844 blob fee | ||
|
||
use crate::constants::eip4844::TARGET_DATA_GAS_PER_BLOCK; | ||
|
||
/// Calculates the excess data gas for the next block, after applying the current set of blobs on | ||
/// top of the excess data gas. | ||
/// | ||
/// Specified in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844#header-extension) | ||
pub fn calculate_excess_blob_gas(parent_excess_blob_gas: u64, parent_blob_gas_used: u64) -> u64 { | ||
let excess_blob_gas = parent_excess_blob_gas + parent_blob_gas_used; | ||
excess_blob_gas.saturating_sub(TARGET_DATA_GAS_PER_BLOCK) | ||
} |
Oops, something went wrong.