Repository navigation
fix: name pool close/reclaim estimation reverts and drop "on-chain" - #2428
Merged
Merged
Conversation
A `closePool` or `reclaim` send that carries revert data was rejected at gas estimation, so nothing was broadcast. The CLI said it "reverted on-chain" and dropped the error. Route both arms through `send_reverted`, which keeps the source error, says nothing was sent, and names the decoded `PaymentPool` error (`PoolNotOpen()`, `NotPoolOwner()`, `PoolNotClosing()`, `GraceWindowActive()`) with its likely cause. A `reclaim` estimation revert with any other selector points at the USDC refund transfer; the concurrent-reclaim guess stays on the mined revert, which carries no revert data. `decdn-incentive` gains `PoolLifecycleRevert`, a selector decoder beside `is_pool_not_open`, which now delegates to it. Closes #2426 Closes #2417 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the contract behavior and includes comprehensive regression coverage.
0 open findings
What changed in this PR
Improves pool lifecycle revert diagnostics by distinguishing gas-estimation rejection from mined reverts.
Changes:
- Decodes four
PaymentPoollifecycle errors. - Preserves revert details and provides actionable CLI hints.
- Adds focused decoder and mocked-provider tests.
| File | Description |
|---|---|
CHANGELOG.md |
Documents the corrected diagnostics. |
crates/cli/src/commands/pool.rs |
Handles estimation reverts with decoded causes. |
crates/cli/src/commands/pool/tests.rs |
Tests known and unknown revert selectors. |
crates/incentive/src/lib.rs |
Exports the lifecycle decoder. |
crates/incentive/src/pool_open_error.rs |
Implements selector decoding and signatures. |
crates/incentive/src/pool_open_error/tests.rs |
Tests lifecycle selector decoding. |
🧠 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 f5b3ed6 in the Show a line coverage summary of the most impacted files.
|
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.
What
A
closePoolorreclaimsend that carries revert data was rejected at gas estimation, so nothing was broadcast. The CLI said "reverted on-chain" and dropped the error, so the operator could not see whichPaymentPoolerror fired.close_and_forget/reclaim_and_forgetroute the revert-data arm through a newsend_reverted. It keeps the source error (raw revert data, anyError(string)reason), says "rejected at gas estimation; nothing was sent", and names the decoded error with a hint:PoolNotOpen()(concurrent close),NotPoolOwner(),PoolNotClosing()(concurrent reclaim),GraceWindowActive().reclaimestimation revert with an unknown selector points at the USDC refund transfer. A concurrent reclaim would have decoded asPoolNotClosing(), so the old "most likely a concurrent reclaim" guess now stays only on the mined revert (reclaim_reverted), which carries no revert data.decdn-incentivegainsPoolLifecycleRevert(selector decoder +signature()from thesol!constants) inpool_open_error.rs;is_pool_not_opendelegates to it. Also fixes that file'sPoolNotOpendoc, which named a nonexistentassignCapability.Fixedentry.Closes #2426
Closes #2417
Reviewer notes
send()comes frometh_estimateGas. The tests use the filler-free mock from fix: warn when a failed pool send may have broadcast #2424, where the canned revert answerseth_sendTransaction; both surface as the sameErrorResp.PaymentPool.sol's ABI (true ofis_pool_not_openalready). Candidate follow-up incrates/e2e/tests/payment_pool_probe_selector.rs.Verification
cargo fmt -- --checkcargo clippy --workspace --all-targets --all-features -- -D warnings, and thecargo docgatecargo nextest run -p decdn-incentive -p decdn-cli: 1233 passed. New mocked-provider tests cover each of the four errors plus an unknown selector at both sites; mutation-checked by deleting the close guard arm (both close tests fail).contracts/changed: n/aCHANGELOG.mdentry added🤖 Generated with Claude Code