Skip to content

cli: no decdn node deregister — the full bond-exit path has no CLI surface #1359

Closed

Description

@thiras

What

CapacityBond.deregisterNode is now the entry point to a full bond exit: it clears declaredMbps, which releases the bondRequired(declaredMbps) floor that requestUnbond enforces (#1351). The complete sequence is

deregisterNode() -> requestUnbond(activeBond) -> [14-day window] -> unbond()

The CLI covers the last two legs (decdn node unbond) and the entry leg on the way in (decdn node register), but there is no decdn node deregister. An operator who wants to exit has to hand-craft the deregisterNode transaction.

Why it matters now

Before the #1351 fix a full exit was not expressible at all, so the missing command was moot — decdn node unbond --all was documented as "release everything the curve permits", not "exit". Now the on-chain path exists and the CLI is the only thing in the way. crates/cli/src/commands/unbond.rs's module docs currently name the raw contract call, following the precedent of setup.rs's already-registered error ("... or deregister on-chain first"), which has the same gap.

Shape

crates/cli/src/commands/register.rs (306 lines) is the closest sibling and the natural template, minus the signature construction — deregisterNode() takes no arguments and needs no EIP-712 or ed25519 signature, just the operator signer. Worth carrying over from unbond:

  • --dry-run and the --json receipt shape.
  • A confirmation gate. Deregistration is at least as consequential as starting an unbonding window: it drops the node from the active set, bumps registrationNonce[nodeId] (invalidating previously signed registration signatures), and clears the declared tier, so re-entry costs a fresh declareMbps + registerNode. unbond's decide_confirmation / confirm_or_bail split is directly reusable.
  • Disclosure that the bond is not returned by this call and stays fully slashable (ADR 003 § Node Registry) — the most likely operator misconception.

An e2e leg on G-NODE-06 asserting a real end-to-end exit (deregister -> --all -> withdraw -> activeBond == 0) becomes possible once the command exists; today that assertion lives at the Solidity level in test_fullExit_deregisterThenUnbondEverything.

Activity

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

    @thiras
    ContributorAuthor

    Fixed in #1362 (merged as e73fa04).

    Note the batch's review round revised the framing of this issue's premise where it was wrong — see the PR description and the ADR/NatSpec updates for the corrected account.

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

Metadata

Metadata

Assignees

Labels

area:cliprio: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