Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about a dynamic setting for the current round, which ensures it's not longer than the expected round end. Wdyt @bajtos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea.
In #147, I reworked "get tasks for the current round" logic so that we don't need dynamic max-age any more.
However, we should eventually move the logic of determining "what's the current meridian round index" from spark-api to spark-checker. I can imagine that it can be useful for spark-checker nodes to not start any new work (retrieval) if the current round is coming to an end.
By the time we finish the retrieval, submit the measurement to spark-api, and spark-publisher commits the measurement to Meridian, the new round will have already started, and our measurement will be evaluated as invalid (measuring a task that does not belong to this round).
I think we should make the check robust to handle changes in round lengths. Ideally, the smart contract should indicate when the current round is expected to end. I think we already have this value in Meridian state - the public field
currentRoundEndBlockNumber
.I am proposing to open a new GH issue to track this idea. WDYT?