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
cli: an adopted buyer row forgets the pool's redeemed spend after the adopting run #2292
area:clidecdn binary: get, gateway, pool, publish, origin, setuparea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:bugSomething does not behave as documented
When the local buyer row is lost, the CLI adopts the live pool from chain (pool_to_reuse → adopt_owned_pool in crates/cli/src/commands/fetch.rs). The adopted row is recorded with the on-chain deposit and no lanes. Only the run that adopts the pool sees its totalRedeemed (as spent_elsewhere). On every later run the row is "tracked", so spent_elsewhere is 0. The pool-wide spend (pool_spend, #2288) then counts only lanes this machine has recorded since adoption. Spend that other providers' lanes redeemed before adoption is no longer counted.
Effect
The proactive refill reads the pool as fuller than it is and does not fire when it should.
The reactive gate, which reads RunFunding's baseline, undercounts the same spend. A genuine SpendingCapExhausted refusal can then be judged a lie.
Steps to reproduce
Spend a pool across several providers, then lose the local buyer row (new data dir, or move buyer.redb aside).
Run decdn fetch: the row is adopted, and this run sees totalRedeemed.
Run decdn fetch again against one provider: the pool-wide spend now omits the other providers' redeemed amounts.
Fix direction
Persist the pool-wide spend the row cannot attribute to a lane, for example a redeemed_elsewhere amount on BuyerPoolState recorded at adoption. Alternatively, read totalRedeemed on every reuse and take the larger of it and the row's lane sum. The second option costs one eth_call per lane build. Under the pre-launch rule, no migration is needed for the row format.
area:clidecdn binary: get, gateway, pool, publish, origin, setuparea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:bugSomething does not behave as documented
Activity
fix(incentive,cli,node): count an adopted pool's redeemed spend as it…
fix(incentive,cli,node): build adopted rows through one constructor a…