Documentation
¶
Index ¶
- type CompleteCollection
- type ExecutableBlock
- func (b *ExecutableBlock) BlockID() flow.Identifier
- func (b *ExecutableBlock) CollectionAt(index int) *flow.Collection
- func (b *ExecutableBlock) Collections() []*CompleteCollection
- func (b *ExecutableBlock) CompleteCollectionAt(index int) *CompleteCollection
- func (b *ExecutableBlock) HasAllTransactions() bool
- func (b *ExecutableBlock) HasStartState() bool
- func (b *ExecutableBlock) Height() uint64
- func (b *ExecutableBlock) IsComplete() bool
- func (b *ExecutableBlock) ParentID() flow.Identifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompleteCollection ¶
type CompleteCollection struct { Guarantee *flow.CollectionGuarantee Collection *flow.Collection }
CompleteCollection contains the guarantee and the transactions. the guarantee is the hash of all the transactions. The execution node receives the guarantee from the block, and queries the transactions by the guarantee from the collection node. when receiving a collection from collection node, the execution node will update the Collection field of a CompleteCollection and make it complete.
func (CompleteCollection) IsCompleted ¶ added in v0.10.0
func (c CompleteCollection) IsCompleted() bool
IsCompleted returns true if the collection has been retrieved from the network. This function assumes that the collection is non-empty and that collections are retrieved either in full or not at all.
type ExecutableBlock ¶
type ExecutableBlock struct { Block *flow.Block CompleteCollections map[flow.Identifier]*CompleteCollection // key is the collection ID. StartState *flow.StateCommitment Executing bool // flag used to indicate if block is being executed, to avoid re-execution // contains filtered or unexported fields }
ExecutableBlock represents a block that can be executed by the VM
It assumes that the attached Block is immutable, so take care in not modifying or changing the inner *flow.Block, otherwise the struct will be in an inconsistent state. It requires the Block is immutable because it lazy loads the Block.ID() into the private blockID field, on the first call to ExecutableBlock.BlockID() All future calls to BlockID will not call Block.ID(), therefore if the Block changes, the blockID will not match the Block.
func (*ExecutableBlock) BlockID ¶ added in v0.43.0
func (b *ExecutableBlock) BlockID() flow.Identifier
BlockID lazy loads the Block.ID() into the private blockID field on the first call, and returns the id field in all future calls
func (*ExecutableBlock) CollectionAt ¶ added in v0.30.0
func (b *ExecutableBlock) CollectionAt(index int) *flow.Collection
CollectionAt returns a collection at the given index, if index out of range, nil will be returned
func (*ExecutableBlock) Collections ¶
func (b *ExecutableBlock) Collections() []*CompleteCollection
func (*ExecutableBlock) CompleteCollectionAt ¶ added in v0.31.0
func (b *ExecutableBlock) CompleteCollectionAt(index int) *CompleteCollection
CompleteCollectionAt returns a complete collection at the given index, if index out of range, nil will be returned
func (*ExecutableBlock) HasAllTransactions ¶
func (b *ExecutableBlock) HasAllTransactions() bool
HasAllTransactions returns whether all the transactions for all collections in the block have been received.
func (*ExecutableBlock) HasStartState ¶ added in v0.10.0
func (b *ExecutableBlock) HasStartState() bool
HasStartState returns whether the block has StartState, which indicates whether its parent has been executed.
func (*ExecutableBlock) Height ¶
func (b *ExecutableBlock) Height() uint64
func (*ExecutableBlock) IsComplete ¶
func (b *ExecutableBlock) IsComplete() bool
IsComplete returns whether all the data needed to executed the block are ready.
func (*ExecutableBlock) ParentID ¶
func (b *ExecutableBlock) ParentID() flow.Identifier