Skip to content

Commit

Permalink
feat(miner): improve prepareWork() (ethereum#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jul 29, 2024
1 parent 217c9ec commit 06b2903
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,13 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) {
// Set baseFee and GasLimit if we are on an EIP-1559 chain
if w.chainConfig.IsLondon(header.Number) {
if w.chainConfig.Taiko {
if !w.chainConfig.IsOntake(header.Number) {
header.BaseFee = genParams.baseFeePerGas
} else {
if w.chainConfig.IsOntake(header.Number) {
_, blockGasTargetMillion := core.DecodeOntakeExtraData(header.Extra)
header.BaseFee = eip1559.CalcBaseFeeOntake(w.chainConfig, parent, uint64(blockGasTargetMillion)*1_000_000)
} else if genParams.baseFeePerGas != nil {
header.BaseFee = genParams.baseFeePerGas
} else {
header.BaseFee = eip1559.CalcBaseFee(w.chainConfig, parent)
}
} else {
header.BaseFee = eip1559.CalcBaseFee(w.chainConfig, parent)
Expand Down

0 comments on commit 06b2903

Please sign in to comment.