Repository navigation
Closed
Labels
design:economicsToken economics, pricing, fee split, bond sizingrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Milestone
Description
Summary
payment.rate_per_mb is currently a SIGHUP / decdn node reload hot-reloadable field (crates/node/src/runtime/reload.rs:4). It should not be. Changing the price a node charges out from under a running process is a footgun: the correct way to reprice is to drain the node, close it, wait out a cooldown, and restart with the new rate.
Why hot-reloading the served rate is a footgun
The reload swaps a single shared Arc<AtomicU64> that both the probe handler and the client (serve) handler read (runtime/mod.rs:919, runtime/mod.rs:1203). Swapping it live means:
- Quote/charge skew. A client selects this node from a probe quote at rate R₀ (the selection score is
rate_per_mb × rtt × …, ADR 001), then the serve handler charges the swapped-in R₁. The buyer verified aStreamResponseand sized vouchers against one price; the seller now expects another. Best case the pull aborts; worse case it looks like the node quoted one price and billed another. - Mid-stream repricing. In-flight paid streams have a
quoted_rate_per_mbcaptured per session (node_origin/resume.rs). A live global swap creates an inconsistency between already-quoted sessions and the global value, which is exactly the kind of state the "drain then restart" lifecycle exists to avoid. - No cooldown / commitment window. Repricing at will undercuts any expectation clients (or the selection layer) have that a quoted rate holds for some window. A drain → close → cooldown → restart cycle gives that window for free and makes the price change atomic from the node's perspective.
Unlike security.* (rate limits) or log_level, rate_per_mb is not an operational knob — it's an economic commitment on the wire. It belongs with the restart-required fields.
Proposed change
- Move
payment.rate_per_mboff the reloadable-section set: remove itsReloadableSectionimpl and drop it from the SIGHUP/admin-reload path incrates/node/src/runtime/reload.rs. - Treat it like the other restart-required fields: if the reloaded file changes
payment.rate_per_mb, log the standard "requires restart" message (logged on presence/change, not applied). - The serve/probe handlers can then read a plain value fixed at startup instead of a shared
Arc<AtomicU64>. - Document the intended reprice lifecycle: drain → close → cooldown → restart with the new rate.
- Update
ReloadSnapshot/admin_v1_reloadreporting and the reload module docs accordingly.
Notes / open questions
- The "cooldown" is a policy detail — is there an existing drain/cooldown mechanism this should hook into, or is documenting the operator procedure enough for now? [your call]
- Pre-launch, this is a clean removal — no back-compat shim needed (per CLAUDE.md, change the shape and delete the old path in one PR).
Reacted by github-actions
Metadata
Metadata
Assignees
Labels
design:economicsToken economics, pricing, fee split, bond sizingrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Type
Fields
Priority
None yet
Activity
fix(node): make payment.rate_per_mb restart-required, not hot-reloada…
fix(node): make payment.rate_per_mb restart-required, not hot-reloada…
fix(node): make payment.rate_per_mb restart-required, not hot-reloada…