Skip to main content

encode_flow_prepare_metadata

Function encode_flow_prepare_metadata 

Source
pub fn encode_flow_prepare_metadata(
    context: EncodeContext,
    epoch: ReceiveEpoch,
    prepare: Prepare<'_>,
    metadata: &mut [u8],
) -> Result<PrepareEncoding, WireError>
Expand description

Encode only the header and metadata of a credited PREPARE_FLOW.

The payload frame of a prepare is the concatenation of its canonical bodies and does not depend on the receiver or its epoch. A sender that already encoded that exact payload for another peer can pair it with this metadata instead of copying the bodies again. payload_bytes reports the length the paired payload must have.