Skip to content

cli: decdn node bond drops its partial Outcome when a later step fails #1355

Closed

Description

@yigitdot

Surfaced by the review of #1353, which fixed the same defect in decdn node unbond. bond has the identical shape and was left alone to keep that PR scoped.

What

crates/cli/src/commands/bond.rs:51:

let outcome = execute(&bond, &provider, &plan, operator, cb_addr, mbps).await?;

let mut out = io::stdout().lock();
write_plan(&mut out, &plan, args.chain.common.json, &outcome, false)

execute submits up to three transactions in sequence — approve, bond, declareMbps — recording each hash into a locally-owned Outcome. If any step fails, ? discards the whole Outcome including the hashes of steps that already mined, and run propagates before write_plan. stdout is empty; only the error reaches stderr.

Failure scenario

  1. Operator runs decdn node bond --mbps 5000 with zero allowance.
  2. approve mines. bond mines — the TOKEN is now transferred into CapacityBond.
  3. declareMbps reverts (out-of-band tier) or the receipt fetch times out.
  4. stdout is empty. The operator is told declareMbps failed and has no record that their TOKEN moved.

Less severe than the unbond case — bond is idempotent and a re-run converges, and the bond is visible via activeBond — but the same principle applies: a command that submits a sequence should report what landed before it reports the failure.

Fix

Mirror what #1353 did for unbond: make execute take outcome: &mut Outcome and return Result<()>, have run own the value, always write_plan before propagating, and attach context naming the steps that succeeded. See crates/cli/src/commands/unbond.rs run/execute for the shape.

Worth checking register and setup for the same pattern while in there.

Activity

  1. added
    kind:bug
    rust
    area:cli
    prio:medium
    on Jul 21, 2026
  2. self-assigned this
    on Jul 21, 2026
  3. thiras commented on Jul 21, 2026

    @thiras
    Contributor

    Fixed in 71fe6a1 (#1358).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clikind:bugprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions