From d2ff526296828349fae6524634a7c7b2960ce1c1 Mon Sep 17 00:00:00 2001 From: Andrius Date: Tue, 22 Oct 2024 09:51:09 +0000 Subject: [PATCH] Indexer client: widen query window for FastUpdateFeedsSubmitted --- libs/ftso-core/src/IndexerClientForRewarding.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/ftso-core/src/IndexerClientForRewarding.ts b/libs/ftso-core/src/IndexerClientForRewarding.ts index d47990b..b6d6848 100644 --- a/libs/ftso-core/src/IndexerClientForRewarding.ts +++ b/libs/ftso-core/src/IndexerClientForRewarding.ts @@ -106,7 +106,9 @@ export class IndexerClientForRewarding extends IndexerClient { endVotingRoundId: number ): Promise> { const startTime = EPOCH_SETTINGS().votingEpochStartSec(startVotingRoundId); - const endTime = EPOCH_SETTINGS().votingEpochStartSec(endVotingRoundId + 1) - 1; + // Adding extra round as buffer to ensure all events are captured, as there are cases where FastUpdateFeedsSubmitted events are emitted slightly outside the voting epoch. + // This is safe to do as we only process events containing votingRoundId within the range. + const endTime = EPOCH_SETTINGS().votingEpochStartSec(endVotingRoundId + 2); const eventName = FastUpdateFeedsSubmitted.eventName; const status = await this.ensureEventRange(startTime, endTime); if (status !== BlockAssuranceResult.OK) {