Skip to content

refactor(share/shwap/p2p/shrex): Remove rate-limiting middleware#4661

Merged
renaynay merged 1 commit intomainfrom
rene/remove-middleware
Oct 28, 2025
Merged

refactor(share/shwap/p2p/shrex): Remove rate-limiting middleware#4661
renaynay merged 1 commit intomainfrom
rene/remove-middleware

Conversation

@renaynay
Copy link
Copy Markdown
Member

@renaynay renaynay commented Oct 27, 2025

Overrides #4333

Argument for removal:

  1. We implemented middleware preemptively without a metric driving that decision and the default ConcurrencyLimit was chosen without a proper analysis backing the choice. BNs can handle far more requests than the conservative ConcurrencyLimit, especially given no shrex-eds pressure.
  2. This middleware is much easier to "attack" than it is useful. Attacker may fill ConcurrencyLimit worth of slots with bogus requests, effectively occupying server's serving capacity with garbage while real requests are routed elsewhere, rendering server useless.
  3. Libp2p provides implicit "rate-limiting" via conn + resource managers, dropping inbound requests when exceeding limits set by resource manager. Currently, we allow InfiniteLimits for BNs, but we can configure per-protocol resource limits if we see fit.

@renaynay renaynay self-assigned this Oct 27, 2025
@renaynay renaynay added kind:refactor Attached to refactoring PRs shrex For issues and PRs related to shrex protocol labels Oct 27, 2025
@renaynay renaynay added this pull request to the merge queue Oct 28, 2025
Merged via the queue into main with commit dfa5289 Oct 28, 2025
24 of 26 checks passed
@renaynay renaynay deleted the rene/remove-middleware branch October 28, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:refactor Attached to refactoring PRs shrex For issues and PRs related to shrex protocol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants