Skip to content

fix(node): rate-bounds race between signed StreamResponse and voucher acceptance #1382

Closed

Description

@yigitdot

crates/node/src/rate_bounds.rs documents the hazard this is about:

a governance move between a signed quote and its voucher would otherwise make the node reject a voucher paying the rate it itself quoted

But the two sides read the bounds differently:

  • crates/node/src/handlers/client/wire.rs (clamped_rate) takes a snapshot() and threads the clamped value into the signed StreamResponse.
  • crates/node/src/handlers/client/voucher.rs re-reads the live floor via self.rate_bounds.floor() when validating the incoming voucher.

So if a governance floor raise lands between the StreamResponse and a voucher for that stream, the node rejects a voucher paying exactly the rate it just quoted, and the in-flight paid stream fails. The buyer did nothing wrong.

This is reachable in practice: the rate-bounds watcher applies RateBoundsUpdated on a ~1s cadence, and a paid stream spans multiple voucher intervals.

Suggested fix: carry the same snapshot through voucher validation for the lifetime of a stream, rather than re-reading the live value — i.e. make the quote and its acceptance check agree by construction, which is what the rate_bounds.rs comment says the design intends.

Found during review of #1365 (G-GOV-02 e2e). Not caused by that PR.

Activity

  1. added
    kind:bug
    design:economics
    rust
    prio:medium
    on Jul 22, 2026
  2. self-assigned this
    on Jul 22, 2026
  3. assigned and unassigned on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:economicskind:bugprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions