Fix QBFT ProposalPayload backward compatibility with pre-26.1.0 Besu versions#9977
Merged
jframe merged 5 commits intobesu-eth:mainfrom Mar 6, 2026
Merged
Conversation
ProposalPayload.readBlockAccessList() did not check isEndOfCurrentList() before calling nextIsNull(). When a pre-26.1.0 node sends a proposal without the blockAccessList field, the RLP cursor is at end-of-list after reading the block, but nextIsNull() peeks at the next byte outside the payload list (the 65-byte signature), which is a LONG_ELEMENT not a null, causing BlockAccessListDecoder.decode() to call enterList() on it and throw an RLPException. Fix adds the isEndOfCurrentList() guard to return Optional.empty() for messages in the old format, and adds a regression test that encodes a proposal in the pre-26.1.0 wire format and verifies it decodes correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Jason Frame <jason.frame@consensys.net>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes QBFT ProposalPayload decoding to be backward-compatible with pre-26.1.0 nodes that omit the blockAccessList RLP field, avoiding mis-parsing the following signature bytes.
Changes:
- Add an
isEndOfCurrentList()guard inProposalPayload.readBlockAccessList()to returnOptional.empty()for legacy payloads. - Add a regression test that encodes a legacy-format
ProposalPayload(withoutblockAccessList) and verifies successful decode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/ProposalPayload.java | Adds end-of-list guard to safely handle old payload format without blockAccessList. |
| consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/ProposalTest.java | Adds regression test covering decode of legacy proposal payloads. |
...ore/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/ProposalTest.java
Outdated
Show resolved
Hide resolved
…us/qbft/core/messagewrappers/ProposalTest.java Update comment with correct number of items for each payload Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Frame <jasonwframe@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Jason Frame <jason.frame@consensys.net>
macfarla
approved these changes
Mar 6, 2026
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.
Summary
ProposalPayload.readBlockAccessList()was missing anisEndOfCurrentList()guard before callingnextIsNull()blockAccessListfield, the RLP cursor sits at end-of-list after reading the block.nextIsNull()then peeks at the next byte outside the payload list — the 65-byte signature — which is aLONG_ELEMENT, not null. This causesBlockAccessListDecoder.decode()to callenterList()on the signature and throw:RLPException: Expected current item to be a list, but it is: LONG_ELEMENTisEndOfCurrentList()check to returnOptional.empty()for old-format messagesProposalPayloadin the pre-26.1.0 wire format (withoutblockAccessList) using an anonymous subclass and verifies it decodes correctlyBackground
The
blockAccessListfield was added toProposalPayloadin 26.1.0 (commita07c7bf65a2). Networks running mixed 26.1.0+/pre-26.1.0 validators would hit this crash whenever an older node sent a proposal.Test plan
./gradlew :consensus:qbft-core:test --tests "org.hyperledger.besu.consensus.qbft.core.messagewrappers.ProposalTest"🤖 Generated with Claude Code