Skip to content

node: meter the settlement re-anchor path (pending pools, skipped and faulted re-reads) #2710

Closed

Description

@thiras

Follow-up to #2709. Lands after it merges.

#2709 adds an end-of-tick re-anchor to the settlement sink. reanchor_pools re-reads each snapshot-seeded pool, meaning a pool the admit path seeded from one getPool after a restart, at a pinned block. The path reports its outcomes only through logs:

  • warn! when the block-number read faults;
  • warn! when a getPool read faults;
  • debug! when the block number is behind the watcher;
  • debug! when a pool is absent at the pinned block;
  • debug! when a Closed pool is forgotten.

PoolProjection::reanchor skips a stale read (below folded_through, or with a totalRedeemed or deposit below the entry's) with no signal at all. It returns (), so its caller cannot count the skips either.

Several of these states can last indefinitely, and an operator cannot see them:

  • An open dropped by a reorg. A seeded pool whose open a reorg dropped reads as absent on every tick. It stays pending, and the admit path keeps serving it from the seed.
  • A reorg that lowers totalRedeemed or the deposit. Every re-read is then skipped as stale until the chain passes the held value again, which may never happen on a quiet pool. A held totalRedeemed above the chain's refuses a funded pool; a held deposit above the chain's serves past the pool's funds.
  • A persistent read fault, such as ABI drift on getPool. It shows up only as one warn! per rotation.

Each of these keeps the pool in pending_rereads() and costs one getPool per rotation.

Proposal

Follow the sibling-counter convention: one unlabeled counter per reason, and no reason label.

  • Gauge decdn_settlement_reanchor_pending_pools, set from pending_rereads().len() every tick. A gauge that never falls is the stuck-pool signal.
  • Counters for read faults:
    • decdn_settlement_reanchor_block_read_failures_total
    • decdn_settlement_reanchor_pool_read_failures_total
  • Counter decdn_settlement_reanchor_behind_watcher_total, for a block number below applied_through.
  • Counter decdn_settlement_reanchor_absent_total, for a pool absent at the pinned block.
  • Skip counters. reanchor returns the skipped reads with their reason; the caller counts them and logs a warn! naming the pool and both values:
    • decdn_settlement_reanchor_skipped_below_folded_total
    • decdn_settlement_reanchor_skipped_lower_redeemed_total
    • decdn_settlement_reanchor_skipped_lower_deposit_total
  • Counter decdn_settlement_reanchor_anchored_total, for successful anchors, as the denominator.
  • Add every name as a row in adr/appendix-observability.md (adr_registry_names_are_exported gates them), and document them in Metrics in metrics.rs.
  • decdn/devops: add a panel for the pending gauge and the skip and failure rates, plus an alert when decdn_settlement_reanchor_pending_pools stays above 0 for longer than a few rotations.
  • Consider whether the absent-pool case should forget the entry after N absent reads at blocks above the seed, so that the admit path re-resolves it. A dropped open currently stays served from its seed until the next restart, like the orphaned-PoolOpened residual the chain_events module documents.

Names are proposals. Check them against the existing decdn_settlement_* family before adding.

Activity

  1. added
    kind:feature
    prio:medium
    area:node
    area:payments
    on Oct 28, 2026
  2. added this to the v0.3 milestone on Oct 29, 2026
  3. self-assigned this
    on Oct 29, 2026
  4. moved this from Backlog to In progress in deCDNon Oct 29, 2026
  5. moved this from In progress to Done in deCDNon Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:nodearea:paymentskind:featureprio:medium

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions