Skip to content

Commit 0906136

Browse files
authored
chore: Another deflake attempt at multiple validator sentinel e2e (#19237)
In this test, we were waiting for `SLOT_COUNT` to pass and for the first node to be elected as proposer at least once. But then, when we inspected the sentinel history, we filtered only by the first `SLOT_COUNT` slots. So if the first node was elected as proposer after `SLOT_COUNT`, its history would be empty, which is the error we were seeing in failed runs like [this one](http://ci.aztec-labs.com/a88649af146bf02e).
2 parents 0ce2cde + 52af502 commit 0906136

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describe('e2e_p2p_multiple_validators_sentinel', () => {
161161
),
162162
]);
163163

164-
const slotForSentinel = t.monitor.l2SlotNumber;
164+
const slotForSentinel = (await t.monitor.run()).l2SlotNumber;
165165
t.logger.info(`Waiting until sentinel processed until slot ${slotForSentinel}`);
166166
await retryUntil(
167167
async () => {
@@ -179,22 +179,22 @@ describe('e2e_p2p_multiple_validators_sentinel', () => {
179179
// Check that all of the first node validators have attestations recorded
180180
for (const validator of firstNodeValidators) {
181181
const validatorStats = stats.stats[validator.toString().toLowerCase()];
182-
const history = validatorStats?.history.filter(h => h.slot > initialSlot && h.slot <= targetSlot) ?? [];
182+
const history = validatorStats?.history.filter(h => h.slot > initialSlot && h.slot <= slotForSentinel) ?? [];
183183
t.logger.info(`Asserting stats for online validator ${validator}`, { history });
184184
expect(history.filter(h => h.status === 'attestation-missed' || h.status === 'block-missed')).toBeEmpty();
185185
}
186186

187187
// At least one of the first node validators must have been seen as proposer
188188
const firstNodeBlockProposedHistory = firstNodeValidators
189189
.flatMap(v => stats.stats[v.toString().toLowerCase()].history)
190-
.filter(h => h.slot > initialSlot && h.slot <= targetSlot)
190+
.filter(h => h.slot > initialSlot && h.slot <= slotForSentinel)
191191
.filter(h => h.status === 'block-proposed');
192192
expect(firstNodeBlockProposedHistory).not.toBeEmpty();
193193

194194
// And all of the proposers for the offline node must be seen as missed attestation or proposal
195195
for (const validator of offlineValidators) {
196196
const validatorStats = stats.stats[validator.toString().toLowerCase()];
197-
const history = validatorStats.history?.filter(h => h.slot > initialSlot && h.slot <= targetSlot) ?? [];
197+
const history = validatorStats.history?.filter(h => h.slot > initialSlot && h.slot <= slotForSentinel) ?? [];
198198
t.logger.info(`Asserting stats for offline validator ${validator}`, { history });
199199
expect(history.filter(h => h.status === 'attestation-missed' || h.status === 'block-missed')).not.toBeEmpty();
200200
}

0 commit comments

Comments
 (0)