Skip to content

Commit 2a27665

Browse files
committed
adjustments to sendersToSkip after changes to sender recovery logic
1 parent 72d2aec commit 2a27665

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

zk/stages/stage_sequence_execute.go

+12-13
Original file line numberDiff line numberDiff line change
@@ -423,16 +423,10 @@ func sequencingBatchStep(
423423
default:
424424
}
425425

426-
sender, ok := transaction.GetSender()
427-
if ok {
428-
if _, found := sendersToSkip[sender]; found {
429-
continue
430-
}
431-
}
432-
433426
txHash := transaction.Hash()
434427

435-
if _, ok := transaction.GetSender(); !ok {
428+
txSender, ok := transaction.GetSender()
429+
if !ok {
436430
signer := types.MakeSigner(cfg.chainConfig, executionAt, 0)
437431
sender, err := signer.Sender(transaction)
438432
if err != nil {
@@ -445,6 +439,11 @@ func sequencingBatchStep(
445439
}
446440

447441
transaction.SetSender(sender)
442+
txSender = sender
443+
}
444+
445+
if _, found := sendersToSkip[txSender]; found {
446+
continue
448447
}
449448

450449
effectiveGas := batchState.blockState.getL1EffectiveGases(cfg, i)
@@ -502,6 +501,11 @@ func sequencingBatchStep(
502501
}
503502

504503
if !batchState.isL1Recovery() {
504+
// we need to now skip any further transactions from the same sender in this batch as we will encounter nonce problems
505+
if sender, ok := transaction.GetSender(); ok {
506+
sendersToSkip[sender] = struct{}{}
507+
}
508+
505509
/*
506510
here we check if the transaction on it's own would overdflow the batch counters
507511
by creating a new counter collector and priming it for a single block with just this transaction
@@ -512,11 +516,6 @@ func sequencingBatchStep(
512516
check if this hash has appeared too many times and stop allowing it through if required.
513517
*/
514518

515-
// we need to now skip any further transactions from the same sender in this batch as we will encounter nonce problems
516-
if sender, ok := transaction.GetSender(); ok {
517-
sendersToSkip[sender] = struct{}{}
518-
}
519-
520519
// now check if this transaction on it's own would overflow counters for the batch
521520
tempCounters := prepareBatchCounters(batchContext, batchState)
522521
singleTxOverflow, err := tempCounters.SingleTransactionOverflowCheck(txCounters)

0 commit comments

Comments
 (0)