Skip to content

Commit

Permalink
fix(builder): check if the lowest nonce constraint by sender is not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Oct 3, 2024
1 parent cc303ea commit 3321956
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builder/miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1164,8 +1164,9 @@ func (w *worker) commitTransactions(env *environment, plainTxs, blobTxs *transac
return txRecovered.Sender == from
})

// The slice might be empty so the last value might be nil!
lowestNonceConstraintBySender := common.Last(constraintsBySender)
if lowestNonceConstraintBySender.Transaction.Nonce() < tx.Nonce() {
if lowestNonceConstraintBySender != nil && lowestNonceConstraintBySender.Transaction.Nonce() < tx.Nonce() {
// This means that the constraint with the lowest nonce from this sender
// has lower nonce than the pooled tx, so we cannot execute the pooled tx yet.
// We need to execute the constraint first.
Expand Down

0 comments on commit 3321956

Please sign in to comment.