Skip to content

Commit bcc37cf

Browse files
committed
test(fast-inbox): seed the inbox before the checkpoint's L1 block in propose harnesses (A-1384)
Both propose harnesses warped to the checkpoint's timestamp and only then sent their L1-to-L2 messages, so the checkpoint referenced a bucket still accumulating in the same L1 block. Propose rejects that reference: the snapshot could still be overwritten in place. Sending the messages first puts them in an earlier L1 block, which is what the sequencer does anyway, since it never selects a bucket younger than the inbox lag.
1 parent 3642c4d commit bcc37cf

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

l1-contracts/test/base/RollupBase.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,12 @@ contract RollupBase is DecoderBase {
165165

166166
checkpointFees[full.checkpoint.checkpointNumber] = _manaUsed * minFee;
167167

168-
// We jump to the time of the block. (unless it is in the past)
169-
vm.warp(max(block.timestamp, Timestamp.unwrap(full.checkpoint.header.timestamp)));
170-
168+
// Seed the Inbox before jumping to the checkpoint's L1 block: propose rejects a bucket that is still
169+
// accumulating, and a bucket keeps accumulating for the whole L1 block that opened it.
171170
_populateInbox(full.populate.sender, full.populate.recipient, full.populate.l1ToL2Content);
171+
172+
// We jump to the time of the block, always past the L1 block the messages above landed in.
173+
vm.warp(max(block.timestamp + 1, Timestamp.unwrap(full.checkpoint.header.timestamp)));
172174
// Legacy frontier root for the header's inHash field. Unchecked at propose post-flip, but kept because the
173175
// fixtures were generated with it as part of the header hash.
174176
full.checkpoint.header.inHash = rollup.getInbox().getRoot(full.checkpoint.checkpointNumber);

l1-contracts/test/validator-selection/ValidatorSelection.t.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,13 @@ contract ValidatorSelectionTest is ValidatorSelectionTestBase {
531531
DecoderBase.Full memory full = load(_name);
532532
ProposedHeader memory header = full.checkpoint.header;
533533

534-
// We jump to the time of the block. (unless it is in the past)
535-
vm.warp(max(block.timestamp, Timestamp.unwrap(full.checkpoint.header.timestamp)));
536-
534+
// Seed the Inbox before jumping to the checkpoint's L1 block: propose rejects a bucket that is still
535+
// accumulating, and a bucket keeps accumulating for the whole L1 block that opened it.
537536
_populateInbox(full.populate.sender, full.populate.recipient, full.populate.l1ToL2Content);
538537

538+
// We jump to the time of the block, always past the L1 block the messages above landed in.
539+
vm.warp(max(block.timestamp + 1, Timestamp.unwrap(full.checkpoint.header.timestamp)));
540+
539541
rollup.setupEpoch();
540542

541543
ree.proposer = rollup.getCurrentProposer();

0 commit comments

Comments
 (0)