You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(node): rate-bounds race between signed StreamResponse and voucher acceptance #1382
design:economicsToken economics, pricing, fee split, bond sizingkind:bugSomething does not behave as documentedprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
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.
design:economicsToken economics, pricing, fee split, bond sizingkind:bugSomething does not behave as documentedprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Activity
test(node): keep the voucher floor on live rate bounds, not the quote (…
fix: buyer-side rate integrity & slash evidence on the paid-pull path (…
fix: buyer-side rate integrity & slash evidence on the paid-pull path (…