Skip to content

Implement the geth's CalcBaseFee formula  #210

Closed
@georgehao

Description

@georgehao

Describe the feature

geth implement the L2 gas fee like this, how to implement it on reth?

it's fine to implement this on ScrollChainSpec but I wonder if instead we should introduce a new variant in BaseFeeParamsKind which allows for dynamic calculation of the base fee as is required for scroll.

/// A wrapper around [`BaseFeeParams`] that allows for specifying constant or dynamic EIP-1559
/// parameters based on the active [Hardfork].
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum BaseFeeParamsKind {
    /// Constant [`BaseFeeParams`]; used for chains that don't have dynamic EIP-1559 parameters
    Constant(BaseFeeParams),
    /// Variable [`BaseFeeParams`]; used for chains that have dynamic EIP-1559 parameters like
    /// Optimism
    Variable(ForkBaseFeeParams),
}

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions