Skip to content

Implement the geth's CalcBaseFee formula #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
georgehao opened this issue Dec 3, 2024 · 1 comment · May be fixed by #211
Open

Implement the geth's CalcBaseFee formula #210

georgehao opened this issue Dec 3, 2024 · 1 comment · May be fixed by #211
Assignees
Milestone

Comments

@georgehao
Copy link
Member

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

@frisitano frisitano added this to Reth Dec 18, 2024
@frisitano frisitano added this to the Milestone 3 milestone Dec 18, 2024
@frisitano frisitano modified the milestones: Milestone 3, Milestone 4 Feb 13, 2025
@frisitano frisitano self-assigned this Mar 3, 2025
@frisitano frisitano modified the milestones: Milestone 4, Milestone 5 Apr 23, 2025
@frisitano frisitano transferred this issue from scroll-tech/reth Apr 25, 2025
@frisitano frisitano assigned greged93 and unassigned frisitano Apr 28, 2025
@greged93
Copy link
Collaborator

greged93 commented May 8, 2025

after reading the go-ethereum code, it is my understanding that the parentL1BaseFee in the formula is actual the L1 base fee taken from the L1GasPriceOracleAddress, and as such the function to compute the base fee can entirely live in the EN.

@greged93 greged93 transferred this issue from scroll-tech/rollup-node May 8, 2025
@greged93 greged93 moved this to In Progress in Reth May 9, 2025
@greged93 greged93 linked a pull request May 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants