Skip to content

Commit

Permalink
Fix block time for calculating base fee
Browse files Browse the repository at this point in the history
  • Loading branch information
ImTei committed Jan 8, 2024
1 parent 122fe44 commit 801fbdd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,9 @@ func New(stack *node.Node, config *ethconfig.Config, logger log.Logger) (*Ethere
time.Sleep(10 * time.Millisecond)
baseFee := uint64(0)
if currentBlock.BaseFee() != nil {
baseFee = misc.CalcBaseFee(chainConfig, currentBlock.Header(), currentBlock.Time()+1).Uint64()
// Block time of every OP superchains is 2sec for now.
// Add 2 for next block. TODO: support custom block time for OP chain
baseFee = misc.CalcBaseFee(chainConfig, currentBlock.Header(), currentBlock.Time()+2).Uint64()
}
blobFee := uint64(params.MinBlobGasPrice)
if currentBlock.Header().ExcessBlobGas != nil {
Expand Down

0 comments on commit 801fbdd

Please sign in to comment.