fix(protocol): use matching channel-capacity config for block retrieval/propagation channels#5101
Open
damip wants to merge 1 commit into
Open
fix(protocol): use matching channel-capacity config for block retrieval/propagation channels#5101damip wants to merge 1 commit into
damip wants to merge 1 commit into
Conversation
blocks_propagation_ext and blocks_retrieval_ext were created with each other's capacity config field (max_size_channel_commands_retrieval_blocks vs ...propagation_blocks). Swap them so each channel uses the config field matching its name and downstream usage. Finding F142. Co-authored-by: Cursor <cursoragent@cursor.com>
modship
approved these changes
Jul 22, 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
create_protocol_controllerinitializes the block retrieval and block propagationchannels with swapped capacity fields from
ProtocolConfig:blocks_propagation_extwas created withmax_size_channel_commands_retrieval_blocksblocks_retrieval_extwas created withmax_size_channel_commands_propagation_blocksThis wires each channel to the other channel's configured bound. It is a latent
correctness bug: if the two limits are ever configured to different values, the
retrieval and propagation channels would be sized incorrectly. In the shipped
codebase both limits currently happen to hold the same value, so there is no
present functional impact — this is a pure correctness fix that makes each channel
use the config field that matches its name and downstream usage.
Change
Swap the two capacity fields so each channel uses its own limit.
Testing
cargo build/cargo clippyclean formassa_protocol_worker.not observable through a public API, so no dedicated unit test is added.
Risk
None — the values are equal in the shipped config, and the change only relabels
which config field feeds which channel.
Tracking: finding F142.