Skip to content

Commit

Permalink
Merge pull request #46 from bobanetwork/fix-basefee-for-pre-bedrock
Browse files Browse the repository at this point in the history
Return zero base fee for the pre bedrock block
  • Loading branch information
boyuan-chen authored Oct 17, 2023
2 parents 9946e98 + 31b343f commit 354888f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consensus/misc/eip1559.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ func VerifyEip1559Header(config *chain.Config, parent, header *types.Header, ski

// CalcBaseFee calculates the basefee of the header.
func CalcBaseFee(config *chain.Config, parent *types.Header) *big.Int {
// If the current block is pre bedrock, return 0.
if config.IsOptimismPreBedrock(parent.Number.Uint64()) {
return common.Big0
}

// If the current block is the first EIP-1559 block, return the InitialBaseFee.
if !config.IsLondon(parent.Number.Uint64()) {
return new(big.Int).SetUint64(params.InitialBaseFee)
Expand Down

0 comments on commit 354888f

Please sign in to comment.