Conversation
When the tip is notarized but not finalized, two timers race: NotarizationTime rebroadcasts the finalize vote for the tip so peers can send back the missing finalization, and the empty-block builder gives up waiting for transactions and proposes an empty block on top of the tip. Align them so the rebroadcast always comes first. FinalizeRebroadcastTimeout is now three network delays, so the rebroadcast fires within six network delays of entering the round, and the empty-block timeout is four times MaxProposalWait, eight network delays, which leaves peers a round trip to answer. Add an instance-level test that partitions finalization traffic between two validators and asserts the leader rebroadcasts its finalize vote before it proposes the empty block. Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
yacovm
force-pushed
the
rebroadcastFirst
branch
from
September 16, 2026 16:33
24c8ff2 to
fa798da
Compare
samliok
reviewed
Sep 17, 2026
| e.blockBuilder = &EmptyBlockBuilder{ | ||
| ShouldBuildEmptyBlock: e.haveUnFinalizedButNotarizedSuffix, | ||
| Timeout: e.MaxProposalWait, | ||
| Timeout: e.MaxProposalWait * 4, |
Collaborator
There was a problem hiding this comment.
x3 and x4 seem like they are magic numbers that we will forget in a couple weeks. Is there a better way to set these toggles so they dont become footguns?
| // so A finalizes block 2 while B only notarizes it. B then enters round 3 as leader with no pending | ||
| // transactions. Among the messages B sends after entering round 3, the finalize vote for round 2 must | ||
| // appear before the (empty) block proposal for round 3. | ||
| func TestFinalizeVoteRebroadcastPrecedesEmptyBlockProposal(t *testing.T) { |
Collaborator
There was a problem hiding this comment.
i feel like this test is kind of long and hard to parse, i tried to make a simplified version of it here. lemme know what you think
| } | ||
|
|
||
| // deliverable reports whether a message from one node to another should be delivered. | ||
| func (n *network) deliverable(from, to common.NodeID, msg *common.Message) bool { |
Collaborator
There was a problem hiding this comment.
we have the messageFilter term and types in testutil, maybe we can re-use that?
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.
When the tip is notarized but not finalized, two timers race: NotarizationTime rebroadcasts the finalize vote for the tip so peers can send back the missing finalization, and the empty-block builder gives up waiting for transactions and proposes an empty block on top of the tip.
Align them so the rebroadcast always comes first. FinalizeRebroadcastTimeout is now three network delays, so the rebroadcast fires within six network delays of entering the round, and the empty-block timeout is four times MaxProposalWait, eight network delays, which leaves peers a round trip to answer.
Add an instance-level test that partitions finalization traffic between two validators and asserts the leader rebroadcasts its finalize vote before it proposes the empty block.