[][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 a block header. Update the header MMR and corresponding header_head if this header increases the total work relative to header_head. Note: In contrast to processing a full block we treat "already known" as success to allow processing to continue (for header itself).

rewind_and_apply_fork

Utility function to handle forks. From the forked block, jump backward to find to fork point. Rewind the txhashset to the fork point and apply all necessary 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

Sync a chunk of block headers. This is only used during header sync.