Skip to content

cli/incentive: a lost send response is reported as status=failed, so a retry can burn namespace quota #1577

Closed

Description

@yigitdot

Found during review of #1568. Sibling of #1550 — same root cause: tx.rs cannot express the difference between its failure shapes, so the CLI receipt makes a claim it cannot support.

Problem

decdn_incentive::tx::send_for_receipt records the hash after call.send() returns (crates/incentive/src/tx.rs:81-93):

let pending = call.send().await.with_context(|| { ... })?;
let hash = *pending.tx_hash();
*landed = Some(hash);

So an Err from send() always leaves landed == None. Callers read that as "nothing was broadcast" — crates/cli/src/commands/publish.rs renders it through single_tx_status as status=failed / submitted=false, and namespace_failure_context deliberately attaches no warning to that state, because a rejected send really did mint nothing.

But send() covers two outcomes that are indistinguishable from the client:

  1. The node rejected the request — pre-flight gas estimate (NamespaceCapReached), bad nonce, malformed tx. Nothing was broadcast. Correctly failed.
  2. The node accepted the request and the response was lost — HTTP timeout, connection reset, a 502 from an RPC load balancer. The transaction is in the mempool and may mine.

eth_sendRawTransaction is not idempotent from the client's point of view, and send_for_receipt's own error text already concedes that transport errors surface at this point. In case 2 the CLI prints an unambiguous "nothing happened" with no hash and no warning; the operator re-runs, and for publish namespace create that mints a second namespace against maxNamespacesPerPublisher, permanently — namespaces cannot be deleted, and the first is still owned with its id unrecovered.

Why it is not #1550

#1550 is about a confirmed revert losing its hash (the tx mined, landed is cleared at tx.rs:104). This is the send side: no hash was ever recorded, and unlike a revert, the truth is genuinely unknown rather than merely unreported. A fix for #1550 that only adds revert provenance leaves this case untouched. Worth solving together since both are "landed: Option<B256> cannot carry the outcome".

Possible directions

  1. Classify the send error. Distinguish a provider-side rejection (JSON-RPC error response) from a transport failure (timeout/reset/5xx), and give the latter its own state — the tx hash is computable from the signed transaction before broadcast, so it can be reported even when the response was lost.
  2. Warn whenever a nonce may have been consumed. Cheaper: on a transport-class send failure, attach a "the transaction may still have been broadcast — check for a pending or mined tx from this signer before re-running" note. Less precise, but it stops the confident "nothing happened".

Also worth covering

send_for_receipt has no unit test. crates/incentive/src/tx.rs's mod tests covers run_then_cleanup only. The invariant the whole failed-vs-unknown split rests on — that a confirmed revert clears the hash while an unreadable receipt keeps it — is verified by nothing in the repo, and the e2e assertion that looks like it covers the revert path is annotated as a pre-flight gas-estimate rejection, so receipt.status() == false never executes in any test.

Activity

  1. added
    kind:bug
    area:cli
    prio:high
    kind:test
    on Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clikind:bugkind:testprio:high

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions