Repository navigation
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
A Telock from the old epoch can share a sequence with a block of the new epoch. When a non-validator received a replayed Telock T2, it scheduled T2 to wait on the preceding Telock T1. The first block of the next epoch can be indexed instead of T1 and therefore the task of T1 never runs. Because scheduled sequences were tracked by sequence alone, IsSequenceScheduled kept reporting T2's sequence as already scheduled, and the genuine block of the new epoch that competes with T2's sequence was dropped. This commit expands tracking the tasks with also looking at the epoch, which allows both tasks to coexist. Signed-off-by: Yacov Manevich <[email protected]>
samliok
reviewed
Oct 28, 2026
| @@ -31,15 +31,21 @@ type BlockDependencyManager struct { | |||
|
|
|||
| dependencies []*TaskWithDependents | |||
| // scheduledSeqs holds every seq with a task pending, queued or running. | |||
Collaborator
There was a problem hiding this comment.
can we update to
Suggested change
| // scheduledSeqs holds every seq with a task pending, queued or running. | |
| // scheduledSeqs holds every sequence and epoch pair with a task pending, queued or running. |
or something similar?
| func (n *NonValidator) scheduleNewFinalizedBlockTask(block common.Block, finalization *common.Finalization) error { | ||
| bh := finalization.Finalization.BlockHeader | ||
| if n.verifier.IsSequenceScheduled(bh.Seq) { | ||
| if n.verifier.IsSequenceScheduled(bh.Seq, bh.Epoch) { |
Collaborator
There was a problem hiding this comment.
if we schedule a sequence for T2, do we ever clear this from the non-validators scheduler? Because T1 may never arrive, i think we should call
n.verifier.RemoveOldTasks(md.Seq) after indexing or something
Collaborator
Author
There was a problem hiding this comment.
I agree, but - don't we have this problem at the moment irrespective of this PR?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A Telock from the old epoch can share a sequence with a block of the new epoch. When a non-validator received a replayed Telock T2, it scheduled T2 to wait on the preceding Telock T1.
The first block of the next epoch can be indexed instead of T1 and therefore the task of T1 never runs.
Because scheduled sequences were tracked by sequence alone, IsSequenceScheduled kept reporting T2's sequence as already scheduled, and the genuine block of the new epoch that competes with T2's sequence was dropped.
This commit expands tracking the tasks with also looking at the epoch, which allows both tasks to coexist.