From 3321956c6136f1e573e140011d11f9efbea7aced Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 3 Oct 2024 12:35:45 +0200 Subject: [PATCH] fix(builder): check if the lowest nonce constraint by sender is not nil --- builder/miner/worker.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builder/miner/worker.go b/builder/miner/worker.go index da4bee787..98f02a9e8 100644 --- a/builder/miner/worker.go +++ b/builder/miner/worker.go @@ -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.