Skip to content

Move holocene next block base fee handling into opChainspec #17090

Open
@mattsse

Description

@mattsse

Describe the feature

after #16927 we can move

/// Read from parent to determine the base fee for the next block
///
/// See also [Base fee computation](https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/holocene/exec-engine.md#base-fee-computation)
pub fn next_block_base_fee(
chain_spec: impl EthChainSpec + OpHardforks,
parent: impl BlockHeader,
timestamp: u64,
) -> Result<u64, EIP1559ParamError> {
// If we are in the Holocene, we need to use the base fee params
// from the parent block's extra data.
// Else, use the base fee params (default values) from chainspec
if chain_spec.is_holocene_active_at_timestamp(parent.timestamp()) {
Ok(decode_holocene_base_fee(chain_spec, parent, timestamp)?)
} else {
Ok(chain_spec.next_block_base_fee(&parent, timestamp).unwrap_or_default())
}
}

into next_block_base_fee of OpChainSpec so that post holocene decoding is respected

TODO

  • Call this fn from opchainspec's fn

Additional context

No response

Metadata

Metadata

Assignees

Labels

A-op-rethRelated to Optimism and op-rethA-rpcRelated to the RPC implementationC-debtA clean up/refactor of existing codeC-enhancementNew feature or requestD-good-first-issueNice and easy! A great choice to get started

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions