-
Notifications
You must be signed in to change notification settings - Fork 995
Fix: Register all BFT sub-protocols during IBFT2→QBFT consensus migration #9516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Register all BFT sub-protocols during IBFT2→QBFT consensus migration #9516
Conversation
Signed-off-by: saeeddawod <saeed.dawod@gmail.com>
c0f000d to
aff5bb4
Compare
macfarla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saeeddawod can you add a changelog entry since this is a bugfix?
Signed-off-by: saeeddawod <saeed.dawod@gmail.com>
@macfarla done ! |
macfarla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@saeeddawod spotless check is failing, and I can't push to your branch to fix it - can you run spotlessApply gradle target. Assigning back to you. |
app/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java
Show resolved
Hide resolved
Signed-off-by: saeeddawod <saeed.dawod@gmail.com>
a92af05 to
f80d25d
Compare
…tion (hyperledger#9516) * Fix: Ensure deterministic sub-protocol registration in ConsensusSchedule Signed-off-by: saeeddawod <saeed.dawod@gmail.com> Signed-off-by: Ali Zhagparov <alijakparov.kz@gmail.com>
…tion (hyperledger#9516) * Fix: Ensure deterministic sub-protocol registration in ConsensusSchedule Signed-off-by: saeeddawod <saeed.dawod@gmail.com> Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Summary
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 randomly stall. The migration worked sometimes by luck, but failed other times.Root Cause
In
ConsensusScheduleBesuControllerBuilder.createSubProtocolConfiguration(), the original code was:Issues with this approach:
besuControllerBuilderScheduleis aHashMap, sokeySet().stream().skip(1)produces unpredictable results depending on hash orderingSolution
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:
Testing
Migration Test Results
Log Evidence
Checklist
Local Tests
./gradlew spotlessApply./gradlew build./gradlew acceptanceTest