Skip to content

unicast_drained: bool on Link account + CLI #3422

@ben-malbeclabs

Description

@ben-malbeclabs

Append unicast_drained: bool to the serviceability Link account, defaulting to false. Contributor-writable — a contributor may drain their own link from all constrained unicast topologies as a capacity management tool. Orthogonal to link.status.

doublezero link update --code <CODE>     --unicast-drained true|false
doublezero link update --pubkey <PUBKEY> --unicast-drained true|false

When unicast_drained = true, the controller appends UNICAST-DRAINED to the interface's traffic-engineering administrative-group alongside permanent topology tags. Permanent tags are never modified. doublezero link get and doublezero link list MUST display unicast-drained: true/false.

Milestone: RFC-18: Onchain Foundation
RFC: #3288


Files affected:

  • smartcontract/programs/doublezero-serviceability/src/state/link.rs
  • smartcontract/programs/doublezero-serviceability/src/processors/link/
  • smartcontract/cli/src/link/update.rs

Size: Small

Tests:

  • Defaults to false on existing accounts deserialized from pre-upgrade binary data
  • Contributor can set unicast_drained = true on their own link
  • Contributor cannot set unicast_drained on a link they do not own
  • Setting unicast_drained = true does not modify link_topologies or link.status
  • CLI resolves correctly by both --code and --pubkey
  • link get and link list display the field

Blockers: None

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions