Skip to content

fix: pool close/reclaim gas-estimation revert drops its reason and says on-chain #2426

Closed

Description

@thiras

Problem

In close_and_forget and reclaim_and_forget (crates/cli/src/commands/pool.rs), the arm for a send error with revert data drops the error:

Err(e) if e.as_revert_data().is_some() => {
    anyhow::bail!("closePool reverted on-chain for pool {pool_id}")
}
  • The revert reason is lost. closePool can revert PoolNotOpen or NotPoolOwner. reclaim can revert PoolNotClosing, GraceWindowActive, or a USDC transfer revert. So reclaim_reverted has to guess ("most likely a concurrent reclaim; the USDC refund transfer to the owner can also revert"). The selector would answer it.
  • The text is wrong. This arm runs at gas estimation. Nothing was broadcast or mined, but the message says "reverted on-chain". Only the receipt arms are on-chain.
  • The close arm leaves out the receipt arm's "may have raced a concurrent close" hint.

Fix

  • Keep e as the source with anyhow::Error::new(e).context(..).
  • Say that the call was rejected at gas estimation and nothing was sent.
  • Decode the known selectors (decdn_incentive::is_pool_not_open exists) into a specific hint where one applies.

Checks

  • A mocked-provider test per site: an ErrorResp with revert data for a known selector gives the specific message and no "may have broadcast" note.
  • No test reaches these arms today. Deleting the guard would route the error into send_failed unnoticed.

Activity

  1. added
    kind:bug
    on Oct 12, 2026
  2. self-assigned this
    on Oct 12, 2026
  3. added
    area:cli
    on Oct 12, 2026
  4. assigned and unassigned on Oct 12, 2026
  5. moved this from Backlog to In progress in deCDNon Oct 12, 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:bug

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions