Skip to content

sponsord: the keeper never re-sends a hashless topUp at a vacant nonce, so an underpriced answer can hold refills until an operator acts #2572

Closed

Description

@thiras

Problem

The sponsord keeper (crates/sponsord-core/src/keeper.rs) holds further top-ups while a topUp whose submit returned no tx hash (TopUpUnconfirmed { tx: None, nonce: N }) is unresolved. With no hash, settle (keeper.rs:243-338) has one exit: the treasury's confirmed nonce passes N. It never re-sends at N.

The node's settle (crates/node/src/buyer_pool.rs TopUpSettling::resend, ~line 999) does: when the pending and confirmed nonces both equal N (Vacant), it sends a fresh topUp at N. Two transactions at one nonce cannot both mine, so the re-send cannot double-escrow, and the hold self-heals.

The gap matters most for the replacement transaction underpriced answer (#2565, PR #2571): the answering backend holds a different same-key transaction at N. If that transaction is later dropped from the mempool, nothing fills N, and the keeper holds until an operator sends 0-value self-transfers. The error log at keeper.rs:329-336 says so, and sponsord_pool_topup_unconfirmed_since_unix stays non-zero, but the pool can drain meanwhile. A transport-failed submit has the same shape when the send never reached a node.

Fix

Give the keeper the node's vacant-nonce rule: on a hashless hold, read the pending nonce too; when pending == confirmed == N, re-send topUp at N through decdn_client::buyer_pool::send_top_up_at and record the hash. A PoolNotOpen revert ends the hold (the pool is gone); any other failure waits for the next sweep as today.

Done when

  • A keeper test with a hashless hold whose nonce goes vacant shows one re-send at N, and the hold clears on its receipt (keeper/tests.rs:264 covers only "transport loss until the nonce is used").
  • The keeper.rs module doc and docs/sponsord/operator.md describe the re-send.

Related: #2565, #2571, #2562.

Activity

  1. added
    kind:feature
    area:sponsord
    on Oct 20, 2026
  2. moved this from Backlog to In progress in deCDNon Oct 21, 2026
  3. 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

No one assigned

    Labels

    area:sponsordkind:feature

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions