Block Life-cycle

This document’s purpose is to outline the life-cycle of a block through the components of casper-node.

Components:

  • api_server HTTP server receiving and responding to the requests sent to a node.

  • Consensus - Responsible for synchronization between nodes.

  • DeployBuffer (perhaps better though of as -and renamed to- BlockProposer).

  • BlockExecutor - Responsible for executing the deploys in a block’s chain and reporting that to the ContractRuntime.

  • ContractRuntime -Responsible for marshalling global state and applying effects from the execution of deploys.

  • Storage - Responsible for persisting things (like deploys) to disk.

Deploys are used to construct “proposed” blocks once they appear at a node. Consensus asks the DeployBuffer for a list of remaining_deploys, in other words, what blocks should be considered for inclusion in a block.

A “finalized” block is proposed and announced, at which point the BlockExecutor loads the related deploys from the Storage component, and walks through them to find the last deploy in the chain. When the last deploy in the chain is found, it is executed and the ContractRuntime is asked to commit it’s effects to global state.