Skip to content

chore(node): drop per-IP and per-source rate-limit keys removed in decdn#2873 - #210

Merged
alpergundogdu merged 1 commit into
mainfrom
chore/resync-node-config-2873
Nov 11, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
chore/resync-node-config-2873

Conversation

@alpergundogdu

@alpergundogdu alpergundogdu commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

decdn/decdn#2873 deletes the per-source dispatch limiter and the per-IP layer of the DHT, probe and serve rate limiters. A relay-routed connection carries no client address, so those layers cost honest peers behind one NAT more than they cost an attacker. Their config keys and metrics go with them, and the default redeem threshold drops to 50_000 µUSDC (0.05 USDC). Every config section is deny_unknown_fields, so a node.toml that still sets a removed key fails to parse on a binary that carries #2873.

What changes

Config keys removed from node.toml.j2, the role defaults, the rate-limit key guard in tasks/main.yml, the role README, the molecule default/schema/validation scenarios and charts/decdn-node/ci/ci-values.yaml:

  • security.per_source_rate_per_sec, security.per_source_burst, security.max_tracked_sources (role vars decdn_security_per_source_rate_per_sec, decdn_security_per_source_burst, decdn_security_max_tracked_sources)
  • {dht,probe,serve}.rate_limit.per_ip_rate_per_sec, .per_ip_burst, .max_tracked_per_ip (keys of the decdn_{dht,probe,serve}_rate_limit dicts; the guard now accepts five keys and rejects these at deploy time)

ansible/molecule/schema/files/schema-keys.txt loses those 12 paths (166 to 154). The file equals gen-schema-keys.py run against the #2873 branch head, and that output differs from the v0.3.1 output only by these 12 paths.

The validation scenario's float case moves to decdn_serve_economics_discount, and the default scenario's subset case on probe.rate_limit uses max_tracked_per_peer.

Dashboard series removed (no alert or recording rule used any of them):

  • decdn_dispatch_rejected_per_source_total, decdn_dispatch_per_source_skipped_no_addr_total (delivery: Connection dispatch)
  • decdn_{probe,dht,serve}_rate_limit_rejected_per_ip_total (node: Rate-limit rejections, Serve rate-limit rejections; delivery and overview: Serve refusals by reason)
  • decdn_{probe,dht,serve}_rate_limit_tracked_per_ip, decdn_{probe,dht,serve}_rate_limit_prune_sweeps_per_ip_total (node: the two bucket panels)
  • The per-IP term of the Unattributed stream failures expression (delivery and overview), which now matches #2873's INBOUND_FAILURE_REASONS.

No panel goes away: each lost only its per-IP or per-source targets, and its description now names the layers that remain.

Redeem threshold. devops never sets it outside test fixtures. The role default comment now reads daemon dflt 50_000 (0.05 USDC). #2873 has no floor-debt config or metric for devops to drop.

Chart prose. externalTrafficPolicy: Local no longer cites per-source rate limits; it preserves the client source IP the node sees.

Deploy ordering

Merge this before, or together with, the decdn release that carries #2873. Merging it earlier is safe:

  • On a pre-#2873 binary (v0.3.1), every removed key is an Option field in crates/common/src/config/types.rs, so a config that omits it parses and the daemon applies its built-in default. The role defaults for these keys were all "", so a role-managed node renders the same node.toml before and after, unless its inventory overrides them.
  • The chart CI validates ci/*.yaml with the newest decdn of the pinned line. Today that is v0.3.1, which accepts the shorter config. Once a release with #2873 is the newest of the line, the old ci-values.yaml fails decdn config validate, so this PR must be on main by then.
  • A host running the new binary with an inventory that still passes per_ip_* keys in a rate-limit dict now fails at deploy time on the key guard, not in a crash loop. The guard rejects those keys on a v0.3.1 host too, so drop them from the inventory when you take this role version. A leftover decdn_security_per_source_* var renders nothing.

Two side effects until that release ships:

  • The weekly upstream-drift job diffs schema-keys.txt against the newest release of the line (v0.3.1), so it reports the 12 paths as stale. The next decdn bump clears it.
  • Nodes on v0.3.1 keep exporting the per-IP series, which the dashboards no longer show.

Lint

  • pre-commit run --all-files: all hooks pass except two that could not run locally. markdownlint-cli2 failed to install its node env (engine mismatch), so I ran npx markdownlint-cli2 on the two changed READMEs: 0 errors. shellcheck needs Docker; this PR touches no shell.
  • All four monitoring/decdn-node/*.json parse. No field override names a removed refId or legend.
  • Not run locally (no helm, promtool, kubeconform, ansible-lint or Docker daemon): make lint-helm, make lint-ansible, make molecule-changed. CI runs them.

🤖 Generated with Claude Code

…cdn#2873

decdn/decdn#2873 deletes the per-source dispatch limiter and the per-IP
layer of the dht, probe and serve rate limiters, with their config keys
and metrics, and lowers the default redeem threshold to 50_000 µUSDC.

- node.toml.j2, role defaults, the rate-limit key guard and README: drop
  security.per_source_*/max_tracked_sources and the per_ip_* /
  max_tracked_per_ip rate-limit keys.
- schema-keys.txt: the 12 removed paths (gen-schema-keys.py output for
  the #2873 branch).
- molecule default/schema/validation and the chart's ci-values: stop
  setting the removed keys.
- Dashboards: drop the per-IP and per-source series and the per-IP term
  of the unattributed-failures expression.
- Redeem threshold default comment: 0.05 USDC.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 18:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟢 Approval recommended

The change consistently removes upstream-deleted per-source/per-IP rate-limit keys and metrics across Ansible/Helm/Molecule fixtures and Grafana dashboards to keep strict deny_unknown_fields configurations deployable on newer node binaries, with no remaining issues indicated in the review evidence.

No open issues 🎉

What changed in this PR

Aligns devops configuration, fixtures, and dashboards with decdn/decdn#2873 by removing deleted per-source and per-IP rate-limit keys/metrics so deny_unknown_fields configs remain deployable on newer node binaries.

Changes:

  • Remove deprecated per-source and per-IP rate-limit config keys from Ansible role templates/defaults, deploy-time key guards, Helm chart CI values, and docs.
  • Update Molecule schema/validation scenarios and schema key fixtures to reflect the reduced config surface.
  • Remove deleted per-source/per-IP Prometheus series from Grafana dashboards and adjust related panel queries/descriptions.
File Description
monitoring/​decdn-node/​grafana-dashboard.json Removes per-IP serve rate-limit metric targets and updates related query/description text to match the remaining metrics.
monitoring/​decdn-node/​dashboard-node.json Drops per-IP rate-limit series from node dashboard panels and revises descriptions to reflect the remaining limiter layers.
monitoring/​decdn-node/​dashboard-delivery.json Removes per-source dispatch and per-IP rate-limit series from delivery panels and updates expressions/descriptions accordingly.
charts/​decdn-node/​values.yaml Updates chart default commentary around externalTrafficPolicy to remove references to per-source rate limiting.
charts/​decdn-node/​README.md Adjusts chart documentation prose about networking/traffic policy to match behavior after the upstream limiter removals.
charts/​decdn-node/​ci/​ci-values.yaml Deletes removed config keys from CI values used for render/config validation against the node binary.
ansible/​roles/​decdn_node/​templates/​node.toml.j2 Stops rendering removed per-source and per-IP rate-limit keys in the generated node.toml.
ansible/​roles/​decdn_node/​tasks/​main.yml Updates validation/guard logic to accept only the remaining rate-limit dict keys and removes checks tied to deleted knobs.
ansible/​roles/​decdn_node/​README.md Updates role documentation to remove deprecated variables/keys and describe the new rate-limit dict shape.
ansible/​roles/​decdn_node/​defaults/​main.yml Removes defaults for deleted knobs and updates comments to reflect current upstream defaults (including redeem threshold).
ansible/​molecule/​validation/​converge.yml Moves validation coverage to a remaining float-config knob and removes use of deleted keys in the scenario.
ansible/​molecule/​schema/​files/​schema-keys.txt Removes the deleted schema paths from the expected key list and updates the total count accordingly.
ansible/​molecule/​schema/​converge.yml Updates schema scenario inputs to avoid removed keys and match the new allowed rate-limit dict keys.
ansible/​molecule/​default/​verify.yml Updates default scenario assertions for the revised rate-limit dict expectations after key removals.
ansible/​molecule/​default/​converge.yml Adjusts default Molecule inputs to exercise remaining rate-limit keys and float knob behavior without deleted settings.

Review effort: Balanced

@alpergundogdu
alpergundogdu merged commit a494dbb into main Nov 11, 2026
55 checks passed
@alpergundogdu
alpergundogdu deleted the chore/resync-node-config-2873 branch November 11, 2026 19:47
@alpergundogdu
alpergundogdu requested a review from thiras November 11, 2026 19:57
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.

2 participants