This fixes a subtle bug: if max block size * 2 is less than max protocol message size, messages could be rejected.
This should not be an issue unless or until MAX_PROTOCOL_MESSAGE_LENGTH is made much larger.
Details
Details
- Reviewers
Fabien - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) Restricted Project - Commits
- rABCb138ee23c41b: Fix message size check for max block sizes much smaller than max protocol…
ninja check check-functional
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- oversized-fix
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 29334 Build 58204: Build Diff build-without-wallet · build-debug · lint-circular-dependencies · build-diff · build-clang · build-clang-tidy Build 58203: arc lint + arc unit
Event Timeline
Comment Actions
It's a nice code readability improvement and test coverage increase.
But I don't see the bug, if any. The test passes without the changes. It's normal for the block message to be larger than other messages in the protocol, hence the special case. But if the protocol size is increased more than twice the block size, then there is no reason to allow for a larger block message anyway (that would be a rejected block).
test/functional/p2p_invalid_messages.py | ||
---|---|---|
300 ↗ | (On Diff #48278) | |
315 ↗ | (On Diff #48278) | blockmaxsize is for mining only, not needed here |
324 ↗ | (On Diff #48278) | Dito |
Comment Actions
Rebased on D16345 and introduce test coverage that breaks without the fix. It may look a bit strange at first blush to test non-oversized messages in this test, but checking boundaries is clearly a good idea here.