Skip to content

consensus_sim: cover the tie between two siblings at one height - #283

Merged
On1x merged 2 commits into
masterfrom
test/sibling-tie-break
Nov 18, 2026
Merged

On1x merged 2 commits into
masterfrom
test/sibling-tie-break

Conversation

@On1x

@On1x On1x commented Nov 18, 2026

Copy link
Copy Markdown
Member

Why

tests/consensus_sim/scenarios/test_certified_sibling_switch.cpp covers 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

  • three siblings at one height: X is the head, Y and Z share its parent;
  • Y and Z get one vote each — below quorum, so switch_head_to_certified_sibling() cannot be what resolves it;
  • asserts 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 then land on it;
  • asserts the losing rival is still 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 is byte-identical (same producer, same parent, no transactions) and the tie would silently become a duplicate delivery.

--min-cases for the testnet arms: 175 → 176 (the case is inside BUILD_TESTNET); the README number is brought in line with CI.

Evidence

Compiled with -fsyntax-only against the configured build tree (BUILD_TESTNET on) before pushing. Behaviour is proven by the testnet-config jobs of this PR — that is the only place these cases run.

On1x added 2 commits November 18, 2026 19:18
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.
@On1x
On1x merged commit a0c413b into master Nov 18, 2026
8 checks passed
@On1x
On1x deleted the test/sibling-tie-break branch November 18, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant