From d35ae8f60256c4f13553c1c8fdc580d94abfc050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Wed, 22 May 2024 14:28:17 +0200 Subject: [PATCH] fix: advance round before waiting for preprocess (#230) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the regression introduced by #224 where the first measurements batch added to a new round triggers the following error: ``` Round index mismatch: 7386 !== 7387 ``` Sentry issue: https://space-meridian.sentry.io/issues/5385606165/?project=4505906069766144 Signed-off-by: Miroslav Bajtoš --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index c6abfc4..e9677a0 100644 --- a/index.js +++ b/index.js @@ -82,6 +82,9 @@ export const startEvaluate = async ({ return } + rounds.previous = rounds.current + rounds.current = new RoundData(roundIndex) + // TODO: Fix this properly and implement a signalling mechanism allowing the "preprocess" step // to notify the "evaluate" when the preprocessing is done, so that we don't have to use a timer // here. See also https://github.com/filecoin-station/spark-evaluate/issues/64 @@ -89,9 +92,6 @@ export const startEvaluate = async ({ await timers.setTimeout(EVALUATE_DELAY) console.log(`Now evaluating the round ${roundIndex}`) - rounds.previous = rounds.current - rounds.current = new RoundData(roundIndex) - // Evaluate previous round evaluate({ round: rounds.previous,