Skip to content

e2e: the clamp journey's accepted-vs-cap check reads a value that stays 0 #2337

Closed

Description

@alpergundogdu

Problem

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

  1. 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.
  2. 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

  1. added
    prio:medium
    kind:test
    area:node
    on Oct 6, 2026
  2. self-assigned this
    on Oct 21, 2026
  3. moved this from Backlog to In progress in deCDNon Oct 21, 2026
  4. added a commit that references this issue on Oct 21, 2026
    772c8f4
  5. moved this from In progress to Done in deCDNon Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:nodekind:testprio:medium

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions