Skip to content

fix: an "already known" send error is treated as a clean rejection #2432

Closed

Description

@thiras

Problem

decdn_incentive::tx::send_broadcast_unknown (crates/incentive/src/tx.rs) treats every RpcError::ErrorResp as a definite rejection that broadcast nothing. One JSON-RPC error breaks that rule: already known (geth and reth; other clients use a similar known transaction text). The node returns it when the same signed transaction is already in its mempool.

A send can get this answer after the first copy reached the mempool. For example:

  • A load-balancing RPC gateway retries eth_sendRawTransaction against a second backend after the first backend accepted it.
  • A client-side retry layer re-sends the same raw transaction after a lost response.

The tx is then in flight, but the CLI reports a plain rejection with no warning:

  • pool close / pool reclaim print "send failed" with no broadcast note.
  • pool close --all / reclaim --all count the pool as failed, not unconfirmed (fix: pool batch summary counts a maybe-broadcast tx as failed #2427).
  • tx::send_for_receipt sets SendOutcome::Rejected, and open_pool / top_up do not attach OpenUnconfirmed / TopUpUnconfirmed.

An operator who re-runs can then double-submit. For closePool or reclaim the second tx only reverts. For openPool or topUp, a second escrow is possible.

We have not seen this on the testnet RPC (dRPC) yet. It is a gap in the classifier, not an observed incident.

Fix

In send_broadcast_unknown, return true for an ErrorResp whose message matches already known or known transaction (case-insensitive). The tx is in a mempool, so it is "may still mine", not "rejected". Keep every other ErrorResp as a rejection.

Checks

  • Unit tests in crates/incentive/src/tx/tests.rs: an ErrorResp with already known and one with known transaction → true. nonce too low and insufficient funds → false.
  • is_nonce_collision does not match already known, because that send must not be retried on a fresh nonce.

Activity

  1. added
    kind:bug
    rust
    prio:low
    area:payments
    on Oct 12, 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
  5. added a commit that references this issue on Oct 20, 2026
    8dabb4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:paymentskind:bugprio:lowrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions