Struct near_chain::chain::BlocksCatchUpState [−][src]
pub struct BlocksCatchUpState {
pub first_block_hash: CryptoHash,
pub epoch_id: EpochId,
pub pending_blocks: Vec<CryptoHash>,
pub scheduled_blocks: HashMap<CryptoHash, ChainStoreUpdateImpl<()>>,
pub processed_blocks: HashMap<CryptoHash, (ChainStoreUpdateImpl<()>, Vec<Result<ApplyChunkResult, Error>>)>,
pub done_blocks: Vec<CryptoHash>,
}Expand description
Helper to track blocks catch up Lifetime of a block_hash is as follows:
- It is added to pending blocks, either as first block of an epoch or because we (post) processed previous block
- Block is preprocessed and scheduled for processing in sync jobs actor. Block hash and state changes from preprocessing goes to scheduled blocks
- We’ve got response from sync jobs actor that block was processed. Block hash, state changes from preprocessing and result of processing block are moved to processed blocks
- Results are postprocessed. If there is any error block goes back to pending to try again. Otherwise results are commited, block is moved to done blocks and any blocks that have this block as previous are added to pending
Fields
first_block_hash: CryptoHashHash of first block of an epoch
epoch_id: EpochIdEpoch id
pending_blocks: Vec<CryptoHash>Collection of block hashes that are yet to be sent for processed
scheduled_blocks: HashMap<CryptoHash, ChainStoreUpdateImpl<()>>Map from block hashes that are scheduled for processing to saved store updates from their preprocessing
processed_blocks: HashMap<CryptoHash, (ChainStoreUpdateImpl<()>, Vec<Result<ApplyChunkResult, Error>>)>Map from block hashes that were processed to (saved store update, process results)
done_blocks: Vec<CryptoHash>Collection of block hashes that are fully processed
Implementations
Auto Trait Implementations
impl !RefUnwindSafe for BlocksCatchUpState
impl Send for BlocksCatchUpState
impl Sync for BlocksCatchUpState
impl Unpin for BlocksCatchUpState
impl !UnwindSafe for BlocksCatchUpState
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more