Documentation ¶
Index ¶
- func FinalizeClusterBlock(blockID flow.Identifier) func(storage.PebbleReaderBatchWriter) error
- func GetHighestExecutedBlock(height *uint64, blockID *flow.Identifier) func(pebble.Reader) error
- func IndexNewBlock(blockID flow.Identifier, parentID flow.Identifier) func(storage.PebbleReaderBatchWriter) error
- func InsertClusterBlock(block *cluster.Block) func(storage.PebbleReaderBatchWriter) error
- func InsertClusterPayload(blockID flow.Identifier, payload *cluster.Payload) func(pebble.Writer) error
- func InsertIndex(blockID flow.Identifier, index *flow.Index) func(tx pebble.Writer) error
- func LookupBlockChildren(blockID flow.Identifier, childrenIDs *flow.IdentifierList) func(pebble.Reader) error
- func RetrieveClusterBlock(blockID flow.Identifier, block *cluster.Block) func(pebble.Reader) error
- func RetrieveClusterPayload(blockID flow.Identifier, payload *cluster.Payload) func(pebble.Reader) error
- func RetrieveIndex(blockID flow.Identifier, index *flow.Index) func(tx pebble.Reader) error
- func RetrieveLatestFinalizedClusterHeader(chainID flow.ChainID, final *flow.Header) func(tx pebble.Reader) error
- func UpdateHighestExecutedBlockIfHigher(header *flow.Header) func(storage.PebbleReaderBatchWriter) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FinalizeClusterBlock ¶
func FinalizeClusterBlock(blockID flow.Identifier) func(storage.PebbleReaderBatchWriter) error
FinalizeClusterBlock finalizes a block in cluster consensus.
func GetHighestExecutedBlock ¶
GetHighestExecutedBlock retrieves the height and ID of the latest block executed by this node. Returns storage.ErrNotFound if no latest executed block has been stored.
func IndexNewBlock ¶
func IndexNewBlock(blockID flow.Identifier, parentID flow.Identifier) func(storage.PebbleReaderBatchWriter) error
IndexNewBlock will add parent-child index for the new block.
- Each block has a parent, we use this parent-child relationship to build a reverse index
- for looking up children blocks for a given block. This is useful for forks recovery where we want to find all the pending children blocks for the lastest finalized block.
When adding parent-child index for a new block, we will add two indexes:
- since it's a new block, the new block should have no child, so adding an empty index for the new block. Note: It's impossible there is a block whose parent is the new block.
- since the parent block has this new block as a child, adding an index for that. there are two special cases for (2): - if the parent block is zero, then we don't need to add this index. - if the parent block doesn't exist, then we will insert the child index instead of updating
func InsertClusterBlock ¶
func InsertClusterBlock(block *cluster.Block) func(storage.PebbleReaderBatchWriter) error
InsertClusterBlock inserts a cluster consensus block, updating all associated indexes.
func InsertClusterPayload ¶
func InsertClusterPayload(blockID flow.Identifier, payload *cluster.Payload) func(pebble.Writer) error
InsertClusterPayload inserts the payload for a cluster block. It inserts both the collection and all constituent transactions, allowing duplicates.
func InsertIndex ¶
func LookupBlockChildren ¶
func LookupBlockChildren(blockID flow.Identifier, childrenIDs *flow.IdentifierList) func(pebble.Reader) error
LookupBlockChildren looks up the IDs of all child blocks of the given parent block.
func RetrieveClusterBlock ¶
RetrieveClusterBlock retrieves a cluster consensus block by block ID.
func RetrieveClusterPayload ¶
func RetrieveClusterPayload(blockID flow.Identifier, payload *cluster.Payload) func(pebble.Reader) error
RetrieveClusterPayload retrieves a cluster consensus block payload by block ID.
func RetrieveIndex ¶
func RetrieveLatestFinalizedClusterHeader ¶
func RetrieveLatestFinalizedClusterHeader(chainID flow.ChainID, final *flow.Header) func(tx pebble.Reader) error
RetrieveLatestFinalizedClusterHeader retrieves the latest finalized for the given cluster chain ID.
func UpdateHighestExecutedBlockIfHigher ¶
func UpdateHighestExecutedBlockIfHigher(header *flow.Header) func(storage.PebbleReaderBatchWriter) error
UpdateHighestExecutedBlockIfHigher updates the latest executed block to be the input block if the input block has a greater height than the currently stored latest executed block. The executed block index must have been initialized before calling this function. Returns storage.ErrNotFound if the input block does not exist in storage.
Types ¶
This section is empty.