Skip to content

Commit 798a0ab

Browse files
author
colinlyguo
committed
add more comments
1 parent d6e03e1 commit 798a0ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rollup/internal/controller/relayer/l2_relayer_sanity.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ func (r *Layer2Relayer) getBatchesFromCalldata(info *CalldataInfo) ([]*dbBatchWi
136136
for _, tx := range block.Transactions {
137137
if tx.Type == types.L1MessageTxType {
138138
if seenL2 {
139-
// Invariant violated: found an L1 after an L2 in the same block.
140-
return nil, nil, fmt.Errorf("L1 message after L2 tx in block %d", bn)
139+
// Invariant violated: found an L1 message after an L2 transaction in the same block.
140+
return nil, nil, fmt.Errorf("L1 message after L2 transaction in block %d", bn)
141141
}
142142
l1MessagesWithBlockNumbers[bn] = append(l1MessagesWithBlockNumbers[bn], tx)
143143
} else {
@@ -469,6 +469,7 @@ func assembleBlocksFromPayload(payload encoding.DABlobPayload, l1MessagesWithBlo
469469
GasLimit: daBlocks[i].GasLimit(),
470470
},
471471
}
472+
// Ensure per-block ordering: [L1 messages][L2 transactions]. Prepend L1s (if any), then append L2 txs.
472473
if l1Messages, ok := l1MessagesWithBlockNumbers[daBlocks[i].Number()]; ok {
473474
blocks[i].Transactions = l1Messages
474475
}

0 commit comments

Comments
 (0)