pub struct VcExternalCommitJoinBuilder { /* private fields */ }virtual-clients-draft and (32-bit or 64-bit) only.Expand description
Builder for bootstrapping a virtual client’s sibling emulator client into a higher-level group by processing another sibling’s external commit, when this client is not yet a member of that group.
The first emulator client joined the higher-level group via an external commit. A second emulator client (this one), sharing the same emulation epoch, reconstructs the resulting group state from that commit.
The join happens in two steps. Self::process_commit rebuilds the
prior-epoch group and verifies the commit, returning a
StagedVcExternalCommitJoin. The application inspects the verified
proposals it exposes, resolves any AppDataUpdate proposals, and completes
the join with StagedVcExternalCommitJoin::into_group.
Implementations§
Source§impl VcExternalCommitJoinBuilder
impl VcExternalCommitJoinBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new VcExternalCommitJoinBuilder with default values.
Sourcepub fn with_config(self, join_config: MlsGroupJoinConfig) -> Self
pub fn with_config(self, join_config: MlsGroupJoinConfig) -> Self
Specifies the configuration to use for the joined group.
Sourcepub fn with_ratchet_tree(self, ratchet_tree: RatchetTreeIn) -> Self
pub fn with_ratchet_tree(self, ratchet_tree: RatchetTreeIn) -> Self
Specifies the prior-epoch ratchet tree. This is only used if the
ratchet tree is not provided in the VerifiableGroupInfo
extensions. A ratchet tree must be provided, either in the
VerifiableGroupInfo extensions or via this method.
Sourcepub fn skip_lifetime_validation(self) -> Self
pub fn skip_lifetime_validation(self) -> Self
Skip the validation of lifetimes in leaf nodes in the ratchet tree. Note that only the leaf nodes are checked that were never updated.
By default they are validated.
Sourcepub fn process_commit<Provider: OpenMlsProvider>(
self,
provider: &Provider,
verifiable_group_info: VerifiableGroupInfo,
external_commit: impl Into<ProtocolMessage>,
epoch_id: EpochId,
) -> Result<StagedVcExternalCommitJoin, VcExternalCommitJoinError<Provider::StorageError>>
pub fn process_commit<Provider: OpenMlsProvider>( self, provider: &Provider, verifiable_group_info: VerifiableGroupInfo, external_commit: impl Into<ProtocolMessage>, epoch_id: EpochId, ) -> Result<StagedVcExternalCommitJoin, VcExternalCommitJoinError<Provider::StorageError>>
Rebuilds the higher-level group at the epoch before the external
commit from verifiable_group_info (and the ratchet tree, taken from
the GroupInfo’s ratchet_tree extension or
Self::with_ratchet_tree), and verifies external_commit against
it: the GroupInfo signature and tree, the commit’s signature and
external-commit shape, and that the commit’s derivation info
references the shared emulation epoch epoch_id.
Nothing is consumed or persisted at this point. Dropping the returned
StagedVcExternalCommitJoin discards the join without advancing
the shared operation secret tree.
Trait Implementations§
Source§impl Debug for VcExternalCommitJoinBuilder
impl Debug for VcExternalCommitJoinBuilder
Source§impl Default for VcExternalCommitJoinBuilder
impl Default for VcExternalCommitJoinBuilder
Source§fn default() -> VcExternalCommitJoinBuilder
fn default() -> VcExternalCommitJoinBuilder
Auto Trait Implementations§
impl Freeze for VcExternalCommitJoinBuilder
impl RefUnwindSafe for VcExternalCommitJoinBuilder
impl Send for VcExternalCommitJoinBuilder
impl Sync for VcExternalCommitJoinBuilder
impl Unpin for VcExternalCommitJoinBuilder
impl UnsafeUnpin for VcExternalCommitJoinBuilder
impl UnwindSafe for VcExternalCommitJoinBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more