Skip to content

topUp re-send on replacement transaction underpriced can double-escrow under a gateway retry #2565

Closed

Description

@yigitdot

Follow-up to #2562 / #2563.

send_top_up (crates/client/src/buyer_pool.rs) re-sends a topUp on a fresh pending nonce when the submit is answered replacement transaction underpriced (decdn_incentive::tx::is_nonce_collision). The answering backend holds a different transaction at the nonce, so that backend broadcast nothing of this send. That does not hold for the network:

  1. A load-balancing gateway forwards our topUp at nonce N to backend A. A accepts it, and the response is lost.
  2. A same-key transaction at N (a node's seller redemption, which signs with the same operator key) reached backend B first.
  3. The gateway retries our signed bytes on B, which answers replacement transaction underpriced.
  4. send_top_up releases the TopUpUnconfirmed entry and re-sends at N+1.
  5. If A's copy wins nonce N, both topUps mine and the pool escrows twice; the first one is untracked.

It needs a gateway retry and a concurrent same-key transaction on another backend at once, so it is narrow. On a sequencer chain (Arbitrum, anvil) a same-key collision is mostly answered nonce too low, which #2563 treats as possibly broadcast, so this re-send rarely runs there.

Options:

  • Treat replacement transaction underpriced as possibly broadcast too (TopUpUnconfirmed at N, settled by the node against the chain) and delete the re-send loop (TOPUP_NONCE_RETRIES, TOPUP_NONCE_BACKOFF, the ended select) and its tests.
  • Keep the re-send, but sign locally first so the hash is known, and check that hash (pending pool / receipt) before re-sending on a fresh nonce.

Activity

  1. added
    kind:bug
    on Oct 20, 2026
  2. self-assigned this
    on Oct 20, 2026
  3. moved this from Backlog to In progress in deCDNon Oct 20, 2026
  4. moved this from In progress to Done in deCDNon Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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