Skip to content

node: pre-redeem getWatermarks runs on every sub-floor hint, flooding the RPC #2217

Closed

Description

@thiras

Summary

Every redeem hint costs one getWatermarks eth_call, even when nothing clears the per-chunk floor and nothing gets submitted. redeem_planned_lanes reconciles against the chain (reconcile_onchain_watermarks, crates/node/src/payment_settlement.rs:1876) before chunk_redemptions applies the floor. The hint path (redeem_one) runs this once per accepted voucher, so during a pull each node reads the chain at many times its voucher rate and almost never redeems.

The testnet RPC is the dRPC free plan. This load probably contributes to the code 30 ("Request timeout on the free plan") and code 19 errors behind DecdnChainWatcherFlapping. Every pre-redeem reconcile failure in the window below is a code 30.

Evidence (testnet, 2026-09-28 07:48–11:08 UTC, fleet on 8886c85c)

Node redemption_reconcile_ok_total redemption_reconcile_failures_total pool_redemptions_total
bcl 11247 36 5
nbg1 6360 34 4
fra1 5531 44 0
lon1 3324 5 3
ash1 2077 5 0
  • During the 08:05 pull, bcl ran about 218 getWatermarks calls/min against 26 vouchers/min. fra1 ran 187/min against 8, and nbg1 167/min against 19.
  • Loki, same window: 169 pre-redeem watermark reconciliation failed WARNs fleet-wide, all error code 30: Request timeout on the free plan.

Proposed fix

Apply the floor before the read. Cached watermarks can only lag, so the fresh read can only lower unredeemed. A lane set that fails chunk_redemptions on cached values fails it after reconciliation too. The fix:

  1. Run chunk_redemptions on the cached plans first, and return early when it is empty.
  2. Reconcile only the lanes in the surviving chunks.
  3. Re-chunk the reconciled lanes, as today.

The forced close/shutdown paths use floor == 0, so they still read every lane.

Acceptance

  • A unit test: a sub-floor hint makes no getWatermarks call.
  • On testnet, rate(decdn_redemption_reconcile_ok_total) tracks rate(decdn_pool_redemptions_total), not rate(decdn_vouchers_received_total).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bug

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions