Skip to content

chore(decdn_node): sync config-schema surface to decdn main @ 0b94efe4 - #44

Merged
alpergundogdu merged 2 commits into
mainfrom
chore/sync-config-schema-main
Sep 11, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
chore/sync-config-schema-main

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Re-syncs the decdn_node role's node.toml key surface to the current main of decdn/decdn (crates/common/src/config/types.rs, HEAD 0b94efe4). Every config section is #[serde(deny_unknown_fields)] with no serde aliases, so any key the role emits that main's binary doesn't know is a startup crash-loop.

Field delta (verified field-by-field against types.rs)

Removed (gone from main — the on-chain swap path was dropped, plus the share-bps floor knob):

  • blockchain.swap_venue, blockchain.swap_router_address, blockchain.swap_quoter_address, blockchain.swap_fee_tier, blockchain.swap_balancer_pool, blockchain.swap_pool_address
  • blockchain.pool_floor_signer_share_bps

Renamed:

  • blockchain.pool_floor_signer_max_windows → blockchain.pool_floor_signer_live_windows (default is now 8, lower-clamped to one credit window)

Added (new optional knobs on main, wired in with ""/[] defaults + guarded emission):

  • blockchain.chain_staleness_grace_sec (u64, must be > 0, daemon default 1800 — ADR 011 serve-while-chain-stale window)
  • cache.disk_headroom_mb (u64, 0 opts out, daemon default 8192 — #1930)
  • client.region_allowlist (Vec<String>) in the new [client] section (ClientConfig)

No other added/removed/renamed fields were found in types.rs between the role's prior state and main.

Files changed (ansible/roles/decdn_node/)

  • templates/node.toml.j2 — drop swap + share_bps emission, rename max_windows→live_windows, add guarded chain_staleness_grace_sec ([blockchain]), disk_headroom_mb ([cache] scalar, above the sub-tables), and a new guarded [client] table with region_allowlist.
  • defaults/main.yml — drop decdn_swap_* + decdn_pool_floor_signer_share_bps, rename the max_windows var, add decdn_chain_staleness_grace_sec, decdn_disk_headroom_mb, decdn_client_region_allowlist with safe empty defaults + one-line docs.
  • tasks/main.yml — drop the swap addresses from the CLI-only-address assert, drop swap_venue (enum) / swap_fee_tier / share_bps (bounded-range) asserts, rename max_windows→live_windows in the integer-shape loop, add chain_staleness_grace_sec (must-be-positive) + disk_headroom_mb (integer shape) + client_region_allowlist (ISO-3166 alpha-2 shape) validation.
  • README.md — knob docs updated (drop swap/share_bps, rename, add the three new knobs).

molecule/schema oracle re-synced

  • files/gen-schema-keys.py — add ClientConfig → client to STRUCT_PATHS, bump the header revision to 0b94efe4 (0.0.0).
  • files/schema-keys.txt — regenerated from main's types.rs + config-types sources: 157 fully-qualified paths (swap/share_bps/max_windows gone; chain_staleness_grace_sec, pool_floor_signer_live_windows, disk_headroom_mb, client.region_allowlist present).
  • converge.yml — set the new knobs, drop the removed ones.
  • verify.yml — add client to the exact expected table set.

The other scenarios (default, validation, host-env, slow-readiness, generate-keystore) set none of the removed knobs — no change needed.

Validation

molecule/Docker tooling isn't installed on this host (PEP-668 blocks a global install), so I validated with the render-and-grep proof — which runs verify.yml's exact drift-checker:

  1. Rendered node.toml.j2 with the schema converge.yml var set through Ansible's own template engine (real | bool/| int filters).
  2. Parsed the result with tomllib (valid TOML) and ran molecule/schema's verbatim path-walk checker against the regenerated schema-keys.txt: 155 emitted paths, all recognised; no removed key emitted.
  3. Confirmed the rendered table set now includes [client] in the exact sorted position verify.yml asserts, and 131 scalar keys (≥ the 125 breadth floor).

🤖 Generated with Claude Code

Re-sync the decdn_node role's node.toml key surface to the current
`main` of decdn/decdn (crates/common/src/config/types.rs). Every config
section is `#[serde(deny_unknown_fields)]` with no serde aliases, so a
stale key is a startup crash-loop.

Field delta (verified against types.rs):
- REMOVE: the whole `[blockchain]` swap block (swap_venue,
  swap_router_address, swap_quoter_address, swap_fee_tier,
  swap_balancer_pool, swap_pool_address) and pool_floor_signer_share_bps.
- RENAME: pool_floor_signer_max_windows -> pool_floor_signer_live_windows
  (default now 8; lower-clamped to one window).
- ADD (new optional knobs): blockchain.chain_staleness_grace_sec,
  cache.disk_headroom_mb, and the new `[client]` section's
  region_allowlist (ClientConfig).

Touched: templates/node.toml.j2 (emit blocks), defaults/main.yml (vars),
tasks/main.yml (asserts), README.md (knob docs), and the molecule/schema
oracle: gen-schema-keys.py (add ClientConfig, bump header to 0b94efe4),
regenerated files/schema-keys.txt (157 paths), converge.yml (set the
new knobs, drop the removed ones), verify.yml (add `client` to the
expected table set).

Validated by rendering node.toml.j2 with the schema converge var set via
Ansible's own template engine and running molecule/schema's exact
drift-checker + tomllib parse against the regenerated schema-keys.txt:
155 emitted paths, all recognised; no removed key emitted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 11, 2026 09:15

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.

🟢 Approval recommended

The changes consistently remove obsolete knobs, introduce the new schema keys with guarded emission plus validation, and update the molecule/schema oracle accordingly to prevent config drift.

Pull request overview

Synchronizes the decdn_node Ansible role’s rendered node.toml schema surface with upstream decdn/decdn main (commit 0b94efe4) to prevent startup crash-loops from #[serde(deny_unknown_fields)] when the role emits unknown keys.

Changes:

  • Removed upstream-deleted blockchain.swap_* and blockchain.pool_floor_signer_share_bps knobs from defaults, template emission, and validation.
  • Renamed pool_floor_signer_max_windows → pool_floor_signer_live_windows, and added new guarded knobs: blockchain.chain_staleness_grace_sec, cache.disk_headroom_mb, and [client].region_allowlist.
  • Re-synced molecule/schema oracle (schema key inventory + scenario expected tables/vars) to match upstream config structs/paths.
File summaries
File Description
ansible/roles/decdn_node/templates/node.toml.j2 Updates emitted TOML keys/tables to match upstream schema (remove swap/share_bps, rename live_windows, add new guarded keys + [client]).
ansible/roles/decdn_node/tasks/main.yml Removes validations for deleted knobs and adds validation for new fields (including chain staleness and client region allowlist).
ansible/roles/decdn_node/README.md Updates role documentation to reflect removed/renamed/added configuration knobs.
ansible/roles/decdn_node/defaults/main.yml Updates default variables to remove old knobs and add the new ones with documented defaults/semantics.
ansible/molecule/schema/verify.yml Adds [client] to the expected rendered table set for the schema scenario.
ansible/molecule/schema/files/schema-keys.txt Updates the canonical allowed key-path inventory (swap/share_bps removed; new keys added).
ansible/molecule/schema/files/gen-schema-keys.py Extends struct→path mapping to include ClientConfig and updates the upstream sync header.
ansible/molecule/schema/converge.yml Updates schema scenario inputs to drop removed knobs and set new knobs so they render and are validated.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The fixture provenance was bumped to main but the README's Schema
tracking paragraph still cited d306cc5c / 0.1.1. Match it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alpergundogdu
alpergundogdu merged commit d68e42e into main Sep 11, 2026
7 checks passed
@alpergundogdu
alpergundogdu deleted the chore/sync-config-schema-main branch September 11, 2026 09:45
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