Skip to content

Commit c335146

Browse files
authored
test(e2e): narrow down sentinel check in multiple_validators_sentinel (#23604)
Instead of checking a range of slots, we only check the slot we're interested in. This prevents any build errors that occured until things got stable from interfering. For instance, the sequencer we stop could cause the _next_ sequencer to miss their block. Looking just into the `sentinelSlot` removes this indeterminism.
1 parent 8db20fd commit c335146

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

yarn-project/end-to-end/src/e2e_p2p/multiple_validators_sentinel.parallel.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,14 @@ describe('e2e_p2p_multiple_validators_sentinel', () => {
214214
const stats = await sentinel.getValidatorsStats();
215215
t.logger.info(`Collected validator stats at slot ${t.monitor.l2SlotNumber}`, { stats });
216216

217-
// Check that all of the first node validators have attestations recorded
217+
const historyForSlot = (validator: (typeof firstNodeValidators)[number]) =>
218+
stats.stats[validator.toString().toLowerCase()]?.history.filter(h => h.slot === slotForSentinel) ?? [];
219+
220+
// Check that all of the first node validators have attestations recorded for the selected proposer slot.
218221
for (const validator of firstNodeValidators) {
219-
const validatorStats = stats.stats[validator.toString().toLowerCase()];
220-
const history = validatorStats?.history.filter(h => h.slot > initialSlot && h.slot <= slotForSentinel) ?? [];
222+
const history = historyForSlot(validator);
221223
t.logger.info(`Asserting stats for online validator ${validator}`, { history });
224+
expect(history).not.toBeEmpty();
222225
expect(
223226
history.filter(
224227
h => h.status === 'attestation-missed' || h.status === 'blocks-missed' || h.status === 'checkpoint-missed',
@@ -229,14 +232,13 @@ describe('e2e_p2p_multiple_validators_sentinel', () => {
229232
// At least one of the first node validators must have been seen as proposer
230233
const firstNodeBlockProposedHistory = firstNodeValidators
231234
.flatMap(v => stats.stats[v.toString().toLowerCase()].history)
232-
.filter(h => h.slot > initialSlot && h.slot <= slotForSentinel)
235+
.filter(h => h.slot === slotForSentinel)
233236
.filter(h => h.status === 'checkpoint-valid' || h.status === 'checkpoint-mined');
234237
expect(firstNodeBlockProposedHistory).not.toBeEmpty();
235238

236-
// And all of the proposers for the offline node must be seen as missed attestation or proposal
239+
// And all of the validators for the offline node must be seen as missed attestation or proposal.
237240
for (const validator of offlineValidators) {
238-
const validatorStats = stats.stats[validator.toString().toLowerCase()];
239-
const history = validatorStats.history?.filter(h => h.slot > initialSlot && h.slot <= slotForSentinel) ?? [];
241+
const history = historyForSlot(validator);
240242
t.logger.info(`Asserting stats for offline validator ${validator}`, { history });
241243
expect(
242244
history.filter(

0 commit comments

Comments
 (0)