procedure

package
v0.26.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinalizeClusterBlock

func FinalizeClusterBlock(blockID flow.Identifier) func(*badger.Txn) error

FinalizeClusterBlock finalizes a block in cluster consensus.

func IndexNewBlock

func IndexNewBlock(blockID flow.Identifier, parentID flow.Identifier) func(*badger.Txn) 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: 1) 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. 2) 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(*badger.Txn) error

InsertClusterBlock inserts a cluster consensus block, updating all associated indexes.

func InsertClusterPayload

func InsertClusterPayload(blockID flow.Identifier, payload *cluster.Payload) func(*badger.Txn) error

InsertClusterPayload inserts the payload for a cluster block. It inserts both the collection and all constituent transactions, allowing duplicates.

func InsertIndex

func InsertIndex(blockID flow.Identifier, index *flow.Index) func(tx *badger.Txn) error

func LookupBlockChildren

func LookupBlockChildren(blockID flow.Identifier, childrenIDs *[]flow.Identifier) func(tx *badger.Txn) error

LookupBlockChildren looks up the IDs of all child blocks of the given parent block.

func RetrieveClusterBlock

func RetrieveClusterBlock(blockID flow.Identifier, block *cluster.Block) func(*badger.Txn) error

RetrieveClusterBlock retrieves a cluster consensus block by block ID.

func RetrieveClusterPayload

func RetrieveClusterPayload(blockID flow.Identifier, payload *cluster.Payload) func(*badger.Txn) error

RetrieveClusterPayload retrieves a cluster consensus block payload by block ID.

func RetrieveIndex

func RetrieveIndex(blockID flow.Identifier, index *flow.Index) func(tx *badger.Txn) error

func RetrieveLatestFinalizedClusterHeader

func RetrieveLatestFinalizedClusterHeader(chainID flow.ChainID, final *flow.Header) func(tx *badger.Txn) error

RetrieveLatestFinalizedClusterHeader retrieves the latest finalized for the given cluster chain ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL