Skip to content

Commit e997c00

Browse files
authored
chore: Deflake epoch prune e2e test (again) (#17252)
When warping ahead to the epoch in which we vote to slash the target offenses, if the offenses happened on an epoch near the end of their respective round, we would be jumping ahead to the end of the respective voting round, so we would not collect the votes needed.
2 parents 5693639 + ef0c1a3 commit e997c00

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

yarn-project/end-to-end/src/e2e_p2p/shared.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@ export async function awaitCommitteeKicked({
242242
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
243243
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
244244
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
245-
const targetEpoch = offenseEpoch + slashingOffsetInEpochs;
245+
const firstEpochInOffenseRound = offenseEpoch - (offenseEpoch % slashingRoundSizeInEpochs);
246+
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
246247
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
247-
await cheatCodes.advanceToEpoch(targetEpoch);
248+
await cheatCodes.advanceToEpoch(targetEpoch, { offset: -aztecSlotDuration / 2 });
248249
}
249250

250251
const attestersPre = await rollup.getAttesters();

0 commit comments

Comments
 (0)