diff --git a/miner/worker.go b/miner/worker.go index c46d0b2c8d..bd7ac13294 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -32,6 +32,7 @@ import ( mapset "github.com/deckarep/golang-set" lru "github.com/hashicorp/golang-lru" + "github.com/holiman/uint256" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" @@ -670,7 +671,12 @@ func (w *worker) mainLoop(ctx context.Context) { txs[acc] = append(txs[acc], tx) } - txset := types.NewTransactionsByPriceAndNonce(w.current.signer, txs, cmath.FromBig(w.current.header.BaseFee)) + var baseFee *uint256.Int + if w.current.header.BaseFee != nil { + baseFee = cmath.FromBig(w.current.header.BaseFee) + } + + txset := types.NewTransactionsByPriceAndNonce(w.current.signer, txs, baseFee) tcount := w.current.tcount //nolint:contextcheck @@ -1509,7 +1515,12 @@ func (w *worker) fillTransactions(ctx context.Context, interrupt *int32, env *en var txs *types.TransactionsByPriceAndNonce tracing.Exec(ctx, "", "worker.LocalTransactionsByPriceAndNonce", func(ctx context.Context, span trace.Span) { - txs = types.NewTransactionsByPriceAndNonce(env.signer, localTxs, cmath.FromBig(env.header.BaseFee)) + var baseFee *uint256.Int + if env.header.BaseFee != nil { + baseFee = cmath.FromBig(env.header.BaseFee) + } + + txs = types.NewTransactionsByPriceAndNonce(env.signer, localTxs, baseFee) tracing.SetAttributes( span, @@ -1532,7 +1543,12 @@ func (w *worker) fillTransactions(ctx context.Context, interrupt *int32, env *en var txs *types.TransactionsByPriceAndNonce tracing.Exec(ctx, "", "worker.RemoteTransactionsByPriceAndNonce", func(ctx context.Context, span trace.Span) { - txs = types.NewTransactionsByPriceAndNonce(env.signer, remoteTxs, cmath.FromBig(env.header.BaseFee)) + var baseFee *uint256.Int + if env.header.BaseFee != nil { + baseFee = cmath.FromBig(env.header.BaseFee) + } + + txs = types.NewTransactionsByPriceAndNonce(env.signer, remoteTxs, baseFee) tracing.SetAttributes( span,