Skip to content

docs(adr): ADR 005/022 per-IP rate-limit rows claim relay unwrapping the code does not do #2504

Closed

Description

@thiras

Problem

Two ADRs describe the per-IP rate-limit layer as if it keys every connection. The code skips the layer for relay-only connections.

The code has no unwrapping. rate_limit::peer_ip returns None when the connection has only a relay path. RateLimiter::try_admit_one then skips layer 2 ("Skipped for relay-only connections"). The probe and DHT handlers share this limiter. The relay does not expose the client address to the node.

Both ADRs' "Why three layers, not one" paragraphs also say the per-IP layer makes NodeId rotation cost money. That holds only for direct-path connections.

Fix

Change both rows to say what the code does: the key is the direct-path source IP (/64 for IPv6), and a relay-only connection is not charged on this layer. Each "Why three layers" paragraph should state the same limit. ASD-STE100, present tense.

Found while working on #2502.

Activity

  1. self-assigned this
    on Oct 17, 2026
  2. removed their assignment
    on Oct 17, 2026
  3. moved this from Backlog to In progress in deCDNon Oct 21, 2026
  4. moved this from In progress to Done in deCDNon Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions