Fix: Ensure deterministic sub-protocol registration in ConsensusSchedule#9515
Closed
saeeddawod wants to merge 1 commit into
Closed
Fix: Ensure deterministic sub-protocol registration in ConsensusSchedule#9515saeeddawod wants to merge 1 commit into
saeeddawod wants to merge 1 commit into
Conversation
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.
This PR fixes a critical bug that prevents successful IBFT2 →
QBFT consensus migration in Besu. During migration, nodes
would stall and fail to produce blocks because they could only
speak one BFT wire protocol instead of both.
Problem
When running a consensus migration from IBFT2 to QBFT using a
transitionsconfiguration in genesis, the network would stallbefore reaching the fork block. Nodes could not exchange IBFT2
messages even though they were still running IBFT2 consensus
pre-fork.
Root Cause
In
ConsensusScheduleBesuControllerBuilder.createSubProtocolCon figuration(), the original code was:Issues with this approach:
besuControllerBuilderScheduleis aMap(HashMap), sokeySet().stream().skip(1)produces unpredictable resultsdepending on hash ordering
configuration from ONE consensus mechanism was registered,
meaning nodes could only speak QBFT on the wire while still
needing IBFT2 consensus pre-fork
IBFT2 messages → block production stalls before fork height
Solution
The fix registers all BFT sub-protocols from all scheduled
consensus mechanisms:
This allows nodes to communicate using both protocols during
the transition period. The fix:
number for determinism)
both)
Testing
Migration Test Performed
blocks under IBFT2 consensus
IbftBesuControllerBuilderfor blocks #0-49and QBFT config with
startBlock: 50IbftBesuControllerBuilder(IBFT2)QbftBesuControllerBuilder(QBFT)producing blocks past [PIE-2026] Separate in-sync from sync-status listeners #100 under QBFT
Log Evidence
Genesis Configuration Used
{ "config": { "ibft2": { "blockperiodseconds": 1, "epochlength": 30000, "requesttimeoutseconds": 2 }, "qbft": { "blockperiodseconds": 1, "epochlength": 30000, "requesttimeoutseconds": 2, "startBlock": 50 } } }Fixed Issue(s)
Fixes consensus migration failures when transitioning from
IBFT2 to QBFT using scheduled transitions.
Checklist
hyperledger/besu/blob/main/CONTRIBUTING.md)
doc-change-requiredmay beneeded to clarify migration requirements
migration
Local Tests
./gradlew spotlessApply./gradlew build./gradlew acceptanceTest./gradlew integrationTest