Skip to content

fix: warn when a failed pool send may have broadcast - #2424

Merged
thiras merged 2 commits into
mainfrom
fix/2416-pool-send-broadcast-unknown
Oct 12, 2026
Merged

thiras merged 2 commits into
mainfrom
fix/2416-pool-send-broadcast-unknown

Conversation

@thiras

@thiras thiras commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • decdn pool close / pool reclaim: a send that fails with no revert data now goes through send_failed. When decdn_incentive::tx::send_broadcast_unknown returns true, the error adds the cli/incentive: a lost send response is reported as status=failed, so a retry can burn namespace quota #1577 warning: the request may have reached the node and broadcast the tx, so check this signer's pending and mined transactions before re-running. A JSON-RPC rejection gets no warning.
  • open_pool (the third site in the issue) was already fixed by fix: hold the open slot until an unconfirmed openPool resolves #2419: a transport-failed submit carries OpenUnconfirmed { tx: None, nonce }, and its Display warns that the tx may have broadcast. Its existing transport test now also asserts the rendered warning.
  • The USDC approve in ensure_allowance (reached from pool open, pool top-up, fetch, and the daemon's buyer funding) gets the same warning. It was the last hand-rolled send in these flows without it.
  • CHANGELOG Fixed entry.

Tests

  • New mocked-provider pairs for close_and_forget, reclaim_and_forget, and ensure_allowance: an empty Asserter (transport failure on eth_sendTransaction) gives the warning; push_failure_msg (a JSON-RPC error response) does not. The transport tests also assert eth_sendTransaction, so they fail if a fill-stage read starts failing first.
  • Mutation-checked: forcing the classifier to true fails both rejection tests, and forcing it to false fails both transport tests.
  • cargo nextest run -p decdn-cli -p decdn-client -p decdn-node: 3230 passed. Workspace clippy --all-features and the cargo doc gate are clean.

Closes #2416

🤖 Generated with Claude Code

A `closePool` or `reclaim` send that fails in transport may have reached
the node and broadcast the tx with no hash returned. Route both sends
through `send_failed`, which adds the #1577 warning when
`send_broadcast_unknown` says the broadcast is unknown, and add a
mocked-provider test pair per site. `open_pool` already carries
`OpenUnconfirmed` for this case (#2419); its transport test now also
asserts the rendered warning.

Closes #2416

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 08:47
@thiras thiras self-assigned this Oct 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation correctly reuses the established classifier and covers both positive and negative cases.

0 open findings

What changed in this PR

Adds broadcast-uncertainty warnings to pool close and reclaim failures.

Changes:

  • Classifies transport failures separately from RPC rejections.
  • Warns operators before retrying potentially broadcast transactions.
  • Adds focused tests and changelog documentation.
File Description
crates/​cli/​src/​commands/​pool.rs Adds conditional send-failure warnings.
crates/​cli/​src/​commands/​pool/​tests.rs Tests transport failures and RPC rejections.
crates/​client/​src/​buyer_pool/​tests.rs Verifies the existing open-pool warning.
CHANGELOG.md Documents the fix.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-code-quality

github-code-quality Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 107d511 in the fix/2416-pool-send-b... branch remains at 75%, unchanged from commit 12ecb06 in the main branch.

Show a line coverage summary of the most impacted files.
File main 12ecb06 fix/2416-pool-send-b... 107d511 +/-
crates/cli/src/...ommands/pool.rs 57% 57% 0%
crates/protocol/src/framing.rs 93% 93% 0%
crates/client/s...c/buyer_pool.rs 81% 82% +1%
crates/node/src...s/client/mod.rs 89% 90% +1%

Updated October 12, 2026 09:10 UTC

The `approve` in `ensure_allowance` was the last hand-rolled send in the
pool flows without the #1577 classification. It now adds the same
broadcast-unknown note as `closePool` / `reclaim`, with a mocked-provider
test pair.

Review follow-ups: state the `send_failed` doc in the classifier's terms,
drop the ambiguous "warns" from the `# Errors` docs, and pin the
transport tests to `eth_sendTransaction`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras
thiras merged commit 7422e6e into main Oct 12, 2026
31 checks passed
@thiras
thiras deleted the fix/2416-pool-send-broadcast-unknown branch October 12, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: pool send errors do not warn that a transport failure may have broadcast

2 participants