Repository navigation
fix: warn when a failed pool send may have broadcast - #2424
Merged
Merged
Conversation
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]>
There was a problem hiding this comment.
🟢 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.
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 107d511 in the Show a line coverage summary of the most impacted files.
Updated |
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]>
5 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
decdn pool close/pool reclaim: a send that fails with no revert data now goes throughsend_failed. Whendecdn_incentive::tx::send_broadcast_unknownreturns true, the error adds the cli/incentive: a lost send response is reported asstatus=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 carriesOpenUnconfirmed { tx: None, nonce }, and its Display warns that the tx may have broadcast. Its existing transport test now also asserts the rendered warning.approveinensure_allowance(reached frompool 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.Fixedentry.Tests
close_and_forget,reclaim_and_forget, andensure_allowance: an emptyAsserter(transport failure oneth_sendTransaction) gives the warning;push_failure_msg(a JSON-RPC error response) does not. The transport tests also asserteth_sendTransaction, so they fail if a fill-stage read starts failing first.truefails both rejection tests, and forcing it tofalsefails both transport tests.cargo nextest run -p decdn-cli -p decdn-client -p decdn-node: 3230 passed. Workspace clippy--all-featuresand thecargo docgate are clean.Closes #2416
🤖 Generated with Claude Code