Skip to content

Commit

Permalink
docs(sidecar): document base fee increase function
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Nov 4, 2024
1 parent ae6caf3 commit 9515e18
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bolt-sidecar/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ pub const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
/// Calculates the max_basefee `slot_diff` blocks in the future given a current basefee (in wei).
/// Returns None if an overflow would occur.
/// Cfr. https://github.com/flashbots/ethers-provider-flashbots-bundle/blob/7ddaf2c9d7662bef400151e0bfc89f5b13e72b4c/src/index.ts#L308
///
/// NOTE: this increase is correct also for the EIP-4844 blob base fee:
/// See https://eips.ethereum.org/EIPS/eip-4844#base-fee-per-blob-gas-update-rule
pub fn calculate_max_basefee(current: u128, block_diff: u64) -> Option<u128> {
// Define the multiplier and divisor for fixed-point arithmetic
let multiplier: u128 = 1125; // Represents 112.5%
Expand Down

0 comments on commit 9515e18

Please sign in to comment.