Struct near_chain::ChainStore[][src]

pub struct ChainStore { /* fields omitted */ }
Expand description

All chain-related database operations.

Implementations

Get outgoing receipts that will be sent from shard shard_id from block whose prev block is prev_block_hash Note that the meaning of outgoing receipts here are slightly different from save_outgoing_receipts or get_outgoing_receipts. There, outgoing receipts for a shard refers to receipts that are generated from the shard from block prev_block_hash. Here, outgoing receipts for a shard refers to receipts that will be sent from this shard to other shards in the block after prev_block_hash The difference of one block is important because shard layout may change between the previous block and the current block and the meaning of shard_id will change.

Note, the current way of implementation assumes that at least one chunk is generated before shard layout are changed twice. This is not a problem right now because we are changing shard layout for the first time for simple nightshade and generally not a problem if shard layout changes very rarely. But we need to implement a more theoretically correct algorithm if shard layouts will change more often in the future https://github.com/near/nearcore/issues/4877

For a given transaction, it expires if the block that the chunk points to is more than validity_period ahead of the block that has base_block_hash.

Returns all outcomes generated by applying transaction or receipt with the given id.

Returns a vector of Outcome ids for given block and shard id

Returns a hashmap of epoch id -> set of all blocks got for current (height, epoch_id)

Returns a HashSet of Chunk Hashes for current Height

Returns a HashSet of Header Hashes for current Height

Returns latest known height and time it was seen.

Save the latest known.

Retrieve the kinds of state changes occurred in a given block.

We store different types of data, so we prefer to only expose minimal information about the changes (i.e. a kind of the change and an account id).

Retrieve the key-value changes from the store and decode them appropriately.

We store different types of data, so we need to take care of all the types. That is, the account data and the access keys are internally-serialized and we have to deserialize those values appropriately. Code and data changes are simple blobs of data, so we return them as base64-encoded blobs.

Trait Implementations

The chain head.

The chain Blocks Tail height, used by GC.

The chain Chunks Tail height, used by GC.

Header of the block at the head of the block chain (not the same thing as header_head).

Largest height for which we created a doomslug endorsement

Head of the header chain (not the same thing as head_header).

Final head of the chain.

Get full block.

Get full chunk.

Get partial chunk.

Does this full block exist?

Get previous header.

Information from applying block.

Information from applying chunk.

Get block header.

Returns hash of the block on the main chain for given height.

Get outgoing receipts generated from shard shard_id in block prev_hash Note that this function is different from get_outgoing_receipts_for_shard, see comments there

Returns underlaying store.

Tail height of the fork cleaning process.

Returns a number of references for Block with block_hash

Check if we saw chunk hash at given height and shard id.

Returns whether the block with the given hash was challenged

Returns encoded chunk if it’s invalid otherwise None.

Get destination shard id for receipt id.

For a given block and a given shard, get the next block hash where a new chunk for the shard is included.

Get full chunk from header, with possible error that contains the header for further retrieval.

Returns hash of the first available block after genesis.

Returns block header from the current chain for given height if present.

Returns block header from the current chain defined by sync_hash for given height if present.

Get epoch id of the last block with existing chunk for the given shard id.

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