Repository navigation
consensus_sim: cover the tie between two siblings at one height - #283
Merged
Merged
Conversation
Every case in test_certified_sibling_switch.cpp builds at most one rival, so the ranking's tie-break (equal distinct voters, smaller block id) was never executed. That is the shape 18.11.2026 produced at scale: 27 siblings at #86227200 with the votes split 6/... and a quorum of 7, where the question was not 'which block has more votes' but 'who chooses when nobody has more'. The new case builds three siblings at one height (X head, Y and Z sharing its parent), gives Y and Z one vote each - below quorum, so the certified path cannot answer - and asserts that the rule names the SMALLER id, that an independent peer holding the same head and the same votes names the same block, and that both land on it. The losing rival stays in fork_db, so a later vote can still break the tie. Z is produced one slot after Y on purpose: in Y's own slot the block would be byte-identical (same producer, same parent, no transactions) and the tie would silently become a duplicate. --min-cases for the testnet arms 175 -> 176 (the case is inside BUILD_TESTNET).
The case failed in CI on the 4-validator arm: 'PREMISE: X did not apply on the neutral peer'. The node that produced Z cannot be the neutral peer - its head IS Z the moment it produces, so an equal-length X is stored in fork_db instead of applied. A fourth node, replayed on the shared parent before the split, takes X as its head and holds Y and Z as siblings, which is the state the ranking needs.
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.
Why
tests/consensus_sim/scenarios/test_certified_sibling_switch.cppcovers the certified path and the vote-based convergence added for the 18.11.2026 stall (#280/#281), but every case builds at most one rival. The ranking's tie-break — equal distinct voters, smaller block id — was therefore never executed.That is exactly the shape the incident produced: 27 siblings at #86227200, the best holding 6 of the 7 votes a quorum needed. The question was not "which block has more votes" but "who chooses when nobody has more", and the answer has to be the same on every node without any negotiation.
What the case does
Xis the head,YandZshare its parent;YandZget one vote each — below quorum, soswitch_head_to_certified_sibling()cannot be what resolves it;fork_db, so a later vote can still break the tie.Zis produced one slot afterYon purpose: inY's own slot the block is byte-identical (same producer, same parent, no transactions) and the tie would silently become a duplicate delivery.--min-casesfor the testnet arms: 175 → 176 (the case is insideBUILD_TESTNET); the README number is brought in line with CI.Evidence
Compiled with
-fsyntax-onlyagainst the configured build tree (BUILD_TESTNETon) before pushing. Behaviour is proven by the testnet-config jobs of this PR — that is the only place these cases run.