Skip to content

Channel authority

Two cells exchange calls over a channel between their monitors. A channel is authority: it says which cell may call which interface on which other cell, how many calls may be in flight, and until when. The nucleus is the sole channel authority. It creates each channel, seals one grant for it, delivers that grant to both monitors, and activates the channel only when both have confirmed installing it. This page covers the channel's lifecycle, the ChannelGrant, how a channel becomes active, and the delegated fast path the grant opens.

How a channel is installed

flowchart TB
  subgraph NUC["NUCLEUS"]
    direction TB
    CH[("Channel record<br/>state, epoch, grant digest")]
    G{{"ChannelGrant<br/>sealed once"}}
    CH --> G
  end
  HOST["Nucleus host<br/>creates one bounded backing pair"]
  subgraph CALLER["CALLER CELL"]
    direction TB
    CM["Caller monitor"]
  end
  subgraph OWNER["OWNER CELL"]
    direction TB
    OM["Owner monitor"]
  end
  G -->|"InstallChannelGrant effect"| HOST
  HOST -->|"grant + caller mapping<br/>by EffectId"| CM
  HOST -->|"grant + owner mapping<br/>by EffectId"| OM
  CM -.->|"receipt: authority + mapping identity"| HOST
  OM -.->|"receipt: authority + mapping identity"| HOST
  HOST -.->|"outcome"| CH

Both monitors receive the same grant, byte for byte, through the authenticated cell control channel. For a shared-memory channel, the nucleus host also creates one bounded call backing and one bounded completion backing. It passes a duplicate of that same pair to each monitor. Each receipt binds the channel and grant identity to the endpoint role, mapping identities, ring generations, capacity, mapping size, and byte-credit limit. The second endpoint cannot activate a different mapping.

The nucleus host correlates the control frame to the effect by EffectId. The nucleus admits both receipts before it moves the channel to active. See Cell control channel and Fd handoff.

Lifecycle

stateDiagram-v2
  [*] --> proposed
  proposed --> installed: first endpoint receipt
  installed --> active: second endpoint receipt
  active --> revoking: revocation fence advanced
  revoking --> closed: endpoints and credit accounted
  proposed --> faulted
  installed --> faulted
  active --> faulted
  revoking --> faulted
  closed --> [*]
  faulted --> [*]

The states are a closed set. One receipt leaves the channel installed, and both receipts make it active. A failed installation or lifecycle operation moves the channel to faulted, which is terminal: the nucleus creates a new channel with a new epoch in its place. See Revocation for the path from active to closed.

The channel grant

A ChannelGrant is sealed once by the nucleus and identified by its digest.

Field Holds
grant_digest Canonical digest over the whole grant
channel_id, channel_epoch The channel, and the one lifetime this grant is valid for
source_cell, source_epoch The caller cell and its epoch
target_cell, target_epoch The owner cell and its epoch
grant_handle Slot and generation of the admitted grant this channel attenuates
interface_id, interface_hash The sealed interface the channel carries
kernel_operations The exact kernel operations permitted
method_rights, resource_rights Rights per method ordinal and per resource
call_credit_limit, byte_credit_limit Concurrent calls and attached bytes the monitors may spend
expiry, revocation_epoch When the delegation ends

Rights and credit attenuate across delegation: a channel grant carries at most what the admitted grant it derives from carries.

The delegated fast path

An active channel lets an already-authorised call go from the caller monitor to the owner monitor directly, without a round trip through the nucleus for each call. The monitors spend what the grant carries: the listed operations and rights, within the call and byte credit, until the expiry or the revocation epoch. Minting credit, widening rights and creating channels stay with the nucleus. See Credit backpressure.

Epochs

An active channel has one epoch. A changed channel epoch or cell epoch invalidates the installed fast path, and the nucleus installs a new channel from current state. A grant, an installation receipt or a call that quotes an earlier epoch is refused.

Revocation carries the admitted mapping-plan digest and a newer revocation fence. A live monitor drops its descriptors only after admitting that exact directive. If a monitor has died, the nucleus host records an explicit invalidated_by_cell_death endpoint outcome under the same mapping identity. The host backing and retained receipts are reclaimed when the authoritative channel reaches closed.

The transport carries grants and outcomes as bounded opaque bytes. Channel state, the content of the grant, and the response to a failed delivery are decided by the nucleus.