diff --git a/.changeset/many-seals-argue.md b/.changeset/many-seals-argue.md new file mode 100644 index 0000000000000..98e4b13295914 --- /dev/null +++ b/.changeset/many-seals-argue.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/batch-submitter-service': patch +--- + +Adds a fix for the BSS to account for the new timestamp logic in L2Geth diff --git a/go/batch-submitter/drivers/sequencer/batch.go b/go/batch-submitter/drivers/sequencer/batch.go index 9653cbb0b45a6..b5c85efecf1b1 100644 --- a/go/batch-submitter/drivers/sequencer/batch.go +++ b/go/batch-submitter/drivers/sequencer/batch.go @@ -91,11 +91,10 @@ func GenSequencerBatchParams( // Iterate over the batch elements, grouping the elements according to // the following critera: - // - All sequencer txs in the same group must have the same timestamp - // and block number. + // - All txs in the same group must have the same timestamp. + // - All sequencer txs in the same group must have the same block number. // - If sequencer txs exist in a group, they must come before all // queued txs. - // - A group should never split consecutive queued txs. // // Assuming the block and timestamp criteria for sequencer txs are // respected within each group, the following are examples of groupings: @@ -110,17 +109,18 @@ func GenSequencerBatchParams( // To enforce the above groupings, the following condition is // used to determine when to create a new batch: // - On the first pass, or - // - Whenever a sequecer tx is observed, and: + // - The preceding tx has a different timestamp, or + // - Whenever a sequencer tx is observed, and: // - The preceding tx was a queued tx, or - // - The preceding sequencer tx has a different - // block number/timestamp. - // Note that a sequencer tx is required to create a new group, - // so a queued tx may ONLY exist as the first element in a group - // if it is the very first element. + // - The preceding sequencer tx has a different block number. + // Note that a sequencer tx is usually required to create a new group, + // so a queued tx may ONLY exist as the first element in a group if it + // is the very first element or it has a different timestamp from the + // preceding tx. needsNewGroupOnSequencerTx := !lastBlockIsSequencerTx || - el.Timestamp != lastTimestamp || el.BlockNumber != lastBlockNumber if len(groupedBlocks) == 0 || + el.Timestamp != lastTimestamp || (el.IsSequencerTx() && needsNewGroupOnSequencerTx) { groupedBlocks = append(groupedBlocks, groupedBlock{})