Skip to main content

Module unbond

Module unbond 

Source
Expand description

decdn node unbond — lower the bond (ADR 026 § Capacity-bond curve).

The reverse of decdn node bond. Lowering a bond is a two-phase on-chain operation — requestUnbond(amount) starts a unbondingPeriod window and unbond() withdraws once it matures — with no atomic refund. Rather than exposing both calls, this command reads chain state and picks the phase. A run that lost its requestUnbond after declareMbps landed resumes on re-run, the way bond’s top-up converges; once requestUnbond HAS landed, a re-run carrying an amount flag is a deliberate error rather than a resume, since the pending request can no longer be changed.

Two contract facts drive the shape of this command, and both are surfaced to the operator rather than left to a revert:

  • A request in flight makes isActive false for the WHOLE window (it is a conjunct of the predicate, independent of the remaining bond). Starting one therefore takes the node out of the active set for ~14 days, which is why a terminal run confirms first.
  • requestUnbond’s floor is bondRequired(declaredMbps) — the curve, NOT minBond. So the contract permits unbonding into an inactive state. The three amount flags pick deliberately different floors: --to-mbps keeps the operator eligible, --all goes to the contract’s own floor.

--all releases everything the curve permits while the node is still registered, which is not the same as an exit: the declared tier pins bondRequired(declaredMbps) in place. A full exit therefore starts with decdn node deregister (#1359), which clears the tier (ADR 003 § Node Registry, ADR 026 § Capacity-bond curve); --all then releases the whole bond.

An operator who is already INACTIVE cannot deregister — the contract reverts NodeNotActive — so this command clears their tier itself, via declareMbps(0) (#1361, accepted only from an inactive operator). That is what lets an ejected operator, or one who declared a tier without ever registering, reach a full exit with --all alone.

Functions§

run
Entry point for decdn node unbond.