Skip to main content

Module vc_commit_data

Module vc_commit_data 

Source
Available on crate feature extensions-draft and crate feature virtual-clients-draft and (32-bit or 64-bit) only.
Expand description

Virtual-clients commit data (mls-virtual-clients draft): the Safe AAD item a virtual client attaches to a commit to declare its in-use derivation epochs and the actions the commit performs. Virtual-clients commit data (mls-virtual-clients draft).

A virtual client attaches this struct to a commit as a Safe AAD item under VC_COMPONENT_ID. It tells the sibling emulators which derivation epochs the author still uses and which actions the commit performs.

enum {
  reserved(0),
  key_package_upload(1),
  new_derivation_epoch(2),
  (255)
} ActionType;

struct {
  ActionType action_type;
  select (VirtualClientAction.action_type) {
    case key_package_upload:
      KeyPackageUpload key_package_upload;
    case new_derivation_epoch:
      struct{};
  };
} VirtualClientAction;

struct {
  opaque epoch_id<V>;
} VcEpochReference;

struct {
  VcEpochReference in_use_epochs<V>;
} VcEpochUsage;

struct {
  optional<VcEpochUsage> epoch_usage;
  VirtualClientAction actions<V>;
} VirtualClientCommitData;

Entries of a VcEpochUsage are unique and sorted, and a VirtualClientCommitData carries at most one new_derivation_epoch action. Both rules are enforced on construction and on deserialization.

Structs§

VcEpochReference
A reference to a derivation epoch by its EpochId.
VcEpochUsage
The set of derivation epochs the author of a commit still uses.
VirtualClientCommitData
What a virtual client tells its siblings about a commit it authored.

Enums§

VcCommitDataError
Errors that can occur when building or parsing a VirtualClientCommitData.
VirtualClientAction
One action a virtual client’s commit performs.