Skip to content

fix(protocol): use matching channel-capacity config for block retrieval/propagation channels#5101

Open
damip wants to merge 1 commit into
mainfrom
fix/protocol-block-channel-capacity-swap
Open

fix(protocol): use matching channel-capacity config for block retrieval/propagation channels#5101
damip wants to merge 1 commit into
mainfrom
fix/protocol-block-channel-capacity-swap

Conversation

@damip

@damip damip commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

create_protocol_controller initializes the block retrieval and block propagation
channels with swapped capacity fields from ProtocolConfig:

  • blocks_propagation_ext was created with max_size_channel_commands_retrieval_blocks
  • blocks_retrieval_ext was created with max_size_channel_commands_propagation_blocks

This 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 clippy clean for massa_protocol_worker.
  • No behavioural change with the current (equal) config values; channel capacity is
    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.

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>

@Leo-Besancon Leo-Besancon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants