Documentation
¶
Index ¶
- func IndexNewBlock(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, ...) error
- func InsertIndex(lock lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, ...) error
- func LookupBlockChildren(r storage.Reader, blockID flow.Identifier, childrenIDs *flow.IdentifierList) error
- func RetrieveIndex(r storage.Reader, blockID flow.Identifier, index *flow.Index) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexNewBlock ¶
func IndexNewBlock(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, parentID flow.Identifier) 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 InsertIndex ¶
func InsertIndex(lock lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, index *flow.Index) error
func LookupBlockChildren ¶
func LookupBlockChildren(r storage.Reader, blockID flow.Identifier, childrenIDs *flow.IdentifierList) error
LookupBlockChildren looks up the IDs of all child blocks of the given parent block.
func RetrieveIndex ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.