Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,19 @@ describe('e2e_epochs/epochs_invalidate_block', () => {
// Wait for at least one checkpoint to be mined so that any in-progress slot has completed
const initialCheckpointNumber = (await nodes[0].getChainTips()).checkpointed.checkpoint.number;
await test.waitUntilCheckpointNumber(CheckpointNumber(initialCheckpointNumber + 1), test.L2_SLOT_DURATION_IN_S * 4);

// Align to the start of an L2 slot before computing the bad slots, so we have a generous
// buffer to push the malicious config to badSlot1's proposer before it snapshots its config
// into a new CheckpointProposalJob. Under proposer pipelining, that job is built during the
// last L1 slot of the previous L2 slot (when getEpochAndSlotInNextL1Slot first returns the
// proposer's target slot), so the practical window is somewhat less than a full L2 slot.
await test.monitor.waitUntilNextL2Slot();
const { l2SlotNumber: currentSlot } = await test.monitor.run();
logger.warn(`First checkpoint mined, current slot is ${currentSlot}`);

// Pick the next two slots after the current one, with a 1-slot gap to account for pipelining
const badSlot1 = SlotNumber.add(currentSlot, 2);
const badSlot2 = SlotNumber.add(currentSlot, 3);
// Pick the next two slots with a 2-slot gap to account for pipelining plus a margin
const badSlot1 = SlotNumber.add(currentSlot, 3);
const badSlot2 = SlotNumber.add(currentSlot, 4);
const badSlots = [badSlot1, badSlot2];
const badProposers = await Promise.all(badSlots.map(s => test.epochCache.getProposerAttesterAddressInSlot(s)));

Expand Down
Loading