Skip to content

Fix(network): bound hole punching forward limiter keys#5221

Open
chenyukang wants to merge 1 commit into
nervosnetwork:developfrom
chenyukang:fix/hole-punching-rate-limiter
Open

Fix(network): bound hole punching forward limiter keys#5221
chenyukang wants to merge 1 commit into
nervosnetwork:developfrom
chenyukang:fix/hole-punching-rate-limiter

Conversation

@chenyukang

@chenyukang chenyukang commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Problem Summary:

The previous limiter used (from, to, message type) as the key, where from and to come from forwarded messages. A peer could keep sending messages with fresh peer IDs and grow the keyed rate limiter state indefinitely.

What is changed and how it works?

Keep the existing per-(from, to, message type) forwarding rate-limit semantics, but replace the unbounded governor keyed store with a bounded TTL-backed limiter. This prevents peers from growing limiter state indefinitely by sending messages with fresh message-controlled peer ids.

What's Changed:

Related changes

  • PR to update owner/repo:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression
  • Breaking backward compatibility

Keep the existing per-(from, to, message type) forwarding rate-limit
semantics, but replace the unbounded governor keyed store with a bounded
TTL-backed limiter. This prevents peers from growing limiter state
indefinitely by sending messages with fresh message-controlled peer ids.
@chenyukang chenyukang requested a review from a team as a code owner June 2, 2026 01:42
@chenyukang chenyukang requested review from quake and removed request for a team June 2, 2026 01:42
@chenyukang chenyukang added this pull request to the merge queue Jun 5, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 5, 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