Skip to main content

read_post_commit_component_bytes

Function read_post_commit_component_bytes 

pub fn read_post_commit_component_bytes(
    id: ComponentId,
    mls_group: &MlsGroup,
    staged_commit: &StagedCommit,
    registry: &ComponentRegistry,
) -> Result<Option<Zeroizing<Vec<u8>>>, ComponentSourceError>
Expand description

The value component id holds after staged_commit’s AppDataUpdate proposals, as commit validation judges them: each Update in staged_commit.app_data_update_proposals() applied in order to the pre-commit dictionary of mls_group, a Remove leaving None.

Those proposals are OpenMLS’s proposal queue, which keeps the first of proposals with the same reference. The staged commit’s own dictionary is built from the commit’s proposal list, which can repeat a proposal, so it can differ from what validation judged. Post-commit checks read this value instead, as release clients do, so members reach the same verdict.

One WorkingSet holds the component, so the work is linear in the proposals’ bytes. Returns Err when an Update does not apply, with the error apply_app_data_update_payload gives.

registry is the pre-commit COMPONENT_REGISTRY, which every component check of the commit shares. The value can be the commit-log signer’s private key, so it is Zeroizing.