[][src]Module grin_chain::pipe

Implementation of the chain block acceptance (or refusal) pipeline.

Structs

BlockContext

Contextual information required to process a new block and either reject or accept it.

Functions

process_block

Runs the block processing pipeline, including validation and finding a place for the new block in the chain. Returns new head if chain head updated.

process_block_header

Process block header as part of "header first" block propagation. We validate the header but we do not store it or update header head based on this. We will update these once we get the block back after requesting it.

rewind_and_apply_fork

Utility function to handle forks. From the forked block, jump backward to find to fork root. Rewind the txhashset to the root and apply all the forked blocks prior to the one being processed to set the txhashset in the expected state.

rewind_and_apply_header_fork

Rewind the header chain and reapply headers on a fork.

sync_block_headers

Process the block header. This is only ever used during sync and uses a context based on sync_head.