Skip to main content

Module write

Module write 

Source
Expand description

Writing blocks to the finalized and non-finalized states.

StructsΒ§

BlockWriteSender πŸ”’
A worker with a task that reads, validates, and writes blocks to the finalized_state or non_finalized_state and channels for sending it blocks.
WriteBlockWorkerTask πŸ”’
A worker task that reads, validates, and writes blocks to the finalized_state or non_finalized_state.

EnumsΒ§

NonFinalizedWriteMessage
The message type for the non-finalized block write task channel.
NonFinalizedWriteOutcome πŸ”’
What the block write task did with a non-finalized block, so the state service can update the blocks and outputs it tracks as sent.

ConstantsΒ§

PARENT_ERROR_MAP_LIMIT πŸ”’
The maximum size of the parent error map.

FunctionsΒ§

finalize_root_blocks πŸ”’
Finalizes the best chain’s root blocks while NonFinalizedState::should_finalize_root.
finalize_root_blocks_and_forget_evicted πŸ”’
Finalizes root blocks after a commit, then reports and publishes any forks that finalizing evicted, because NonFinalizedState::finalize re-inserts the remaining chains under the fork limits.
forget_evicted_blocks πŸ”’
Sends the hashes of blocks evicted from the non-finalized state on non_finalized_rejected_sender, so the state service accepts them again if the network extends their chain.
update_latest_chain_channels πŸ”’
Update the LatestChainTip, ChainTipChange, and non_finalized_state_sender channels with the latest state. If there is no non-finalized chain, use the finalized tip.
validate_and_commit_non_finalized πŸ”’
Run contextual validation on the prepared block and add it to the non-finalized state if it is contextually valid.