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
e2e: the clamp journey's accepted-vs-cap check reads a value that stays 0 #2337
crates/e2e/tests/cli_fetch_delegated.rs, presented_capability_is_clamped_to_the_signers_registered_terms, checks that the node accepted no more than the delegate's registered cap:
let accepted = accepted_on_pool(&node, pool_id).await?;
anyhow::ensure!(accepted <= registered.cap, ...);
accepted_on_pool reads outstanding_micro_usdc from the admin lanes() view. That field is LaneState::last_amount, the cumulative amount of the last signed voucher. In this delegated flow it stays 0 while the node accepts and redeems 40 µUSDC: a local run printed outstanding_micro_usdc: 0 for the pool's lane 1 s, 62 s and 123 s after the last voucher, while the node had redeemed paid watermarks 10, 20, 30, 40. So accepted <= registered.cap is 0 <= 40 and always passes, and the later lane.amount >= accepted check is >= 0.
The test therefore does not prove its title: that the node holds the registered terms and never accepts vouchers past the registered cap.
Found while fixing the clamp journey in #2333 (its retry loop used the same field; #2333 switched the loop to seconds_since_last_voucher).
Fix options
Expose the lane's owed amount (owed, which includes verified preimage depth) on the admin lanes() DTO and assert owed <= registered.cap and that the on-chain watermark reaches owed.
Assert on chain state only: the on-chain paid watermark for (pool, delegate, operator) never exceeds the registered cap, and the node's lane store holds nothing unredeemed past it.
Option 1 tests the node's acceptance directly; option 2 needs no admin change but only sees what was redeemed.
Activity
fix(node): report each lane's owed amount in admin lanes (#2588)