diff --git a/.changeset/shaggy-stingrays-compare.md b/.changeset/shaggy-stingrays-compare.md new file mode 100644 index 0000000000000..6dbe03622070d --- /dev/null +++ b/.changeset/shaggy-stingrays-compare.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/batch-submitter': patch +--- + +Adds a fix for the BSS to account for new timestamp logic in L2Geth diff --git a/packages/batch-submitter/src/batch-submitter/tx-batch-submitter.ts b/packages/batch-submitter/src/batch-submitter/tx-batch-submitter.ts index 70f3d7784ea0f..7453b5a83e01c 100644 --- a/packages/batch-submitter/src/batch-submitter/tx-batch-submitter.ts +++ b/packages/batch-submitter/src/batch-submitter/tx-batch-submitter.ts @@ -685,10 +685,18 @@ export class TransactionBatchSubmitter extends BatchSubmitter { queued: BatchElement[] }> = [] for (const block of blocks) { + // Create a new context in certain situations if ( - (lastBlockIsSequencerTx === false && block.isSequencerTx === true) || + // If there are no contexts yet, create a new context. groupedBlocks.length === 0 || - (block.timestamp !== lastTimestamp && block.isSequencerTx === true) || + // If the last block was an L1 to L2 transaction, but the next block is a Sequencer + // transaction, create a new context. + (lastBlockIsSequencerTx === false && block.isSequencerTx === true) || + // If the timestamp of the last block differs from the timestamp of the current block, + // create a new context. Applies to both L1 to L2 transactions and Sequencer transactions. + block.timestamp !== lastTimestamp || + // If the block number of the last block differs from the block number of the current block, + // create a new context. ONLY applies to Sequencer transactions. (block.blockNumber !== lastBlockNumber && block.isSequencerTx === true) ) { groupedBlocks.push({ @@ -696,6 +704,7 @@ export class TransactionBatchSubmitter extends BatchSubmitter { queued: [], }) } + const cur = groupedBlocks.length - 1 block.isSequencerTx ? groupedBlocks[cur].sequenced.push(block)