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:

  1. It is added to pending blocks, either as first block of an epoch or because we (post) processed previous block
  2. Block is preprocessed and scheduled for processing in sync jobs actor. Block hash and state changes from preprocessing goes to scheduled blocks
  3. 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
  4. 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: CryptoHash

Hash of first block of an epoch

epoch_id: EpochId

Epoch 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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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