Repository navigation
Description
Follow-up from #1548 (issue #1491), raised during review and deliberately left out of scope there because the fix belongs in a shared helper rather than in that PR's surface.
Problem
decdn_incentive::tx::send_for_receipt clears the recorded hash when a transaction confirms as a revert (crates/incentive/src/tx.rs:100-106):
if !receipt.status() {
// A confirmed revert had no effect, so clear the slot: `Some` must mean
// "may have taken effect", never merely "was broadcast". The hash stays
// in the message for lookup.
*landed = None;
anyhow::bail!("{label} reverted (tx {hash:#x}){suffix}");
}That contract is deliberate and correct for its stated purpose: callers use Some to decide whether an effect may have occurred. But it means a mined transaction that burned gas is indistinguishable, at the call site, from a send that was never broadcast — both surface as Err with landed == None.
Downstream, the receipts #1548 introduced report that state as though nothing happened:
publish assign— the operator getsstate: "failed",tx: null(crates/cli/src/commands/publish.rs,SeatOutcome::Failed).publish revoke/request-vetting—status: "failed",submitted: false.
The hash survives only inside the human-readable error string ("{label} reverted (tx {hash:#x})"), which --json consumers do not parse. A script reconciling nonces, gas spend, or on-chain history from the receipt concludes the transaction was never broadcast.
SeatOutcome::Failed's doc already names this merge explicitly, and the variant is deliberately not called reverted for exactly this reason — the CLI cannot tell the two apart.
Scope note
This is not a defect introduced by #1548. It follows from tx.rs's contract, which every CLI command shares (node register, channel, appeal slash, publish, …). Changing it touches every caller, which is why it wants its own PR.
Possible directions
- Second out-param / richer return. Keep
landedmeaning "may have taken effect" and add a separatebroadcast: &mut Option<B256>(or return a small struct) that is set on every path where a transaction reached the mempool, revert included. Callers that want provenance read the second; callers deciding on effect keep reading the first. No semantic change to existing behaviour. - Typed error. Replace the
bail!with an error enum carryingReverted { hash }/SendFailed/ReceiptUnreadable { hash }, letting callers match. Most expressive, largest diff — every.context(…)chain on the call sites would need review. - Do nothing, document it. The hash does reach a human. If no machine consumer needs revert provenance, this is acceptable — but then
submitted: falseon a mined revert should be called out in the CLI docs, since it currently reads as a factual claim that nothing was sent.
Acceptance (if 1 or 2)
publish assigncan render a distinctrevertedstate carrying its hash, separate from a never-broadcastfailed.revoke/request-vettinglikewise distinguish "mined revert" from "never sent".tx.rsgains direct test coverage for the three failure shapes; it currently has none (crates/incentive/src/tx.rstests coverrun_then_cleanuponly).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
github-actions commentedon Jul 31, 2026
🎯 Triage report
send_for_receiptdeliberately clearslandedon a confirmed revert so callers can useSometo mean "may have taken effect" — but this causes JSON receipt consumers to seesubmitted: false/tx: nullfor a transaction that burned real gas. The tx hash survives only in the human-readable error string, invisible to--jsonscripts reconciling nonces or on-chain history. The issue is pre-existing relative to #1548 and shared across all CLI commands that usetx.rs(node register,channel,appeal slash,publish, ...).📊 Assessment
bug,cli,rust,mediumcrates/incentive/src/tx.rs+ named call sites.🔗 Similar issues
tx.rsfailure-shape domain.💡 Notes and suggestions
Recommended direction: Option 1 (second out-param / small struct)
Option 2 (typed error) is more expressive but the diff touching every
.context()chain is large and risky for a shared helper. Option 1 keeps thelandedinvariant intact and is the lowest-risk change.Suggested return shape for
tx.rs:Or equivalently, a
broadcast: &mut Option<TxHash>second out-param mirroringlanded.Acceptance checklist (from issue):
publish assignrenders a distinctrevertedstate carrying the hash, separate from never-broadcastfailed.publish revoke/request-vettinglikewise distinguish "mined revert" from "never sent".tx.rsgains direct test coverage for the three failure shapes:Reverted { hash },SendFailed,ReceiptUnreadable { hash }.Files to touch:
crates/incentive/src/tx.rs— change return type / add out-paramcrates/cli/src/commands/publish.rs— updateSeatOutcome::Failedrenderingsend_for_receipt(node register,channel,appeal slash)Note on
SeatOutcome::Failed: the doc comment already acknowledges this merge; renaming toSeatOutcome::Reverted(with hash) alongside a keptFailed(no hash, never sent) would satisfy the acceptance criteria cleanly.Add this agentic workflow to your repo
To install this agentic workflow, run
Merge main into #1550/#1577 fix, reconciling with #1578
fix(cli): carry revert + lost-response outcomes into publish receipts (…