Function massa_bootstrap::client::stream_final_state_and_consensus

source ยท
pub(crate) fn stream_final_state_and_consensus(
    cfg: &BootstrapConfig,
    client: &mut BootstrapClientBinder,
    next_bootstrap_message: &mut BootstrapClientMessage,
    global_bootstrap_state: &mut GlobalBootstrapState,
) -> Result<(), BootstrapError>
Expand description

This function will send the starting point to receive a stream of the ledger and will receive and process each part until receive a BootstrapServerMessage::FinalStateFinished message from the server. next_bootstrap_message passed as parameter must be BootstrapClientMessage::AskFinalStatePart enum variant. next_bootstrap_message will be updated after receiving each part so that in case of connection lost we can restart from the last message we processed.

The consensus reconnect cursor is capped to max_consensus_block_ids (newest finals by slot). The full graph is kept while streaming; on the next attempt it is pruned to the ids we claim so dropped finals can be re-downloaded.