Repository navigation
Description
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:
record_lossracing 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.- Two
FloorReservationdrops on one pool through the realDropguard.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. - 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.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity