Skip to content

test(node): no integration-level coverage of the pool floor-loss table #1783

Closed

Description

@thiras

Found while reviewing #1780.

crates/node/tests/channel_state_store.rs (607 lines) is the crate's integration-level store test. Grepping it for record_loss|load_losses|forget_loss|dead_charge|floor returns nothing.

It covers replay-after-restart, registered_until regression resistance (:247), corrupt / truncated / zero-length refusal, and buyer-vs-seller pending-settle isolation (:549). pool_floor_loss_v1 is the one table in lanes.redb with no representation there, and after #1780 it carries a non-trivial invariant (monotonic raise, forget_loss the only downward transition, abort-instead-of-commit on a no-op).

The unit tests added in #1780 all drive the store directly. What is missing is coverage at the level where the store meets the rest of the runtime:

  1. record_loss racing the periodic lane flush on the shared file. perf(node,payments): flush lanes in redb key order, enforce monotonic floor loss #1780's whole justification for aborting the no-op write is fsync contention with that flush, and the two paths are never exercised concurrently. concurrent_vouchers_across_distinct_channels (:305) already has the multi-threaded harness.
  2. Two FloorReservation drops on one pool through the real Drop guard. floor_reservation_reconciles_partial_loss_on_drop (crates/node/src/handlers/client/mod.rs:2612-2651) is the only place the guard meets a real store, and it does exactly one drop on one pool. The no-runtime synchronous fallback (mod.rs:499-503) makes a second drop deterministic without threading, so this is cheap. It would be the first test anywhere exercising the drop guard against the monotonic contract rather than the contract in isolation from its caller.
  3. Floor-loss survival across restart at integration level. dead_charge_persists_across_restart (crates/node/tests/client_loopback.rs:9263) drives one fold before the restart, so it would pass identically under the old overwrite semantics. It tests hydration, not monotonicity.

Worth noting for whoever picks this up: await_pool_dead_charge (client_loopback.rs:5008) polls until current == want with an overshoot guard, so it cannot observe a regression — every loopback caller serializes its drops, and the out-of-order interleaving the monotonic contract exists for is never produced anywhere in the integration suite.

Activity

  1. added
    rust
    kind:test
    prio:low
    on Aug 24, 2026
  2. moved this from Backlog to In progress in deCDNon Aug 24, 2026
  3. moved this from In progress to Done in deCDNon Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:testprio:lowrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions