Skip to content

fix(discovery): only accept STATUS messages on discovery channel#133

Merged
kuny0707 merged 1 commit into
tronprotocol:release-v2.2.8from
xxo1shine:fix/discovery-mode-reject-non-status
May 22, 2026
Merged

fix(discovery): only accept STATUS messages on discovery channel#133
kuny0707 merged 1 commit into
tronprotocol:release-v2.2.8from
xxo1shine:fix/discovery-mode-reject-non-status

Conversation

@xxo1shine
Copy link
Copy Markdown
Contributor

@xxo1shine xxo1shine commented May 20, 2026

What does this PR do?

Discovery probe channels accept any message, letting a peer's HelloMessage trigger the full handshake and consume a maxConnections slot. Restrict discoveryMode channels to STATUS only.

Why are these changes required?

This PR has been tested by:

  • Unit Tests

Extra details

A peer can reply with a HelloMessage on a discovery probe channel to
trick the node into running the full handshake path: the channel ends
up in ChannelManager.channels, onConnect fires, and finishHandshake is
set, polluting the connection table and consuming a maxConnections slot.
Guard processMessage so a channel in discoveryMode only accepts STATUS
and is closed otherwise.
@xxo1shine xxo1shine changed the title fix:reject non-STATUS messages on discovery channels fix(discovery): only accept STATUS messages on discovery channel May 21, 2026
@kuny0707 kuny0707 merged commit 6de52cb into tronprotocol:release-v2.2.8 May 22, 2026
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