procedure

package
v0.43.1-rc.5 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinalizeClusterBlock

func FinalizeClusterBlock(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier) error

FinalizeClusterBlock finalizes a block in cluster consensus.

func InsertClusterBlock

func InsertClusterBlock(lctx lockctx.Proof, rw storage.ReaderBatchWriter, proposal *cluster.Proposal) error

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

CAUTION:

  • The caller must acquire the lock storage.LockInsertOrFinalizeClusterBlock and hold it until the database write has been committed. This lock allows `InsertClusterBlock` to verify that this block has not yet been indexed. In order to protect against accidental mutation of existing data, this read and subsequent writes must be performed as one atomic operation. Hence, the requirement to hold the lock until the write is committed.

We return storage.ErrAlreadyExists if the block has already been persisted before, i.e. we only insert a block once. This error allows the caller to detect duplicate inserts. No other errors are expected during normal operation.

func InsertClusterPayload

func InsertClusterPayload(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, payload *cluster.Payload) error

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

func InsertIndex

func InsertIndex(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, index *flow.Index) error

InsertIndex persists the given index keyed by the block ID

CAUTION:

  • The caller must acquire the storage.LockInsertBlock and hold it until the database write has been committed.
  • OVERWRITES existing data (potential for data corruption): This method silently overrides existing data without any sanity checks whether data for the same key already exits. Note that the Flow protocol mandates that for a previously persisted key, the data is never changed to a different value. Changing data could cause the node to publish inconsistent data and to be slashed, or the protocol to be compromised as a whole. This method does not contain any safeguards to prevent such data corruption. The lock proof serves as a reminder that the CALLER is responsible to ensure that the DEDUPLICATION CHECK is done elsewhere ATOMICALLY with this write operation.

No errors expected during normal operations.

func RetrieveClusterBlock

func RetrieveClusterBlock(r storage.Reader, blockID flow.Identifier, block *cluster.Block) error

RetrieveClusterBlock retrieves a cluster consensus block by block ID.

func RetrieveClusterPayload

func RetrieveClusterPayload(r storage.Reader, blockID flow.Identifier, payload *cluster.Payload) error

RetrieveClusterPayload retrieves a cluster consensus block payload by block ID.

func RetrieveIndex

func RetrieveIndex(r storage.Reader, blockID flow.Identifier, index *flow.Index) error

func RetrieveLatestFinalizedClusterHeader

func RetrieveLatestFinalizedClusterHeader(r storage.Reader, clusterID flow.ChainID, final *flow.Header) error

RetrieveLatestFinalizedClusterHeader retrieves the latest finalized cluster block header from the specified cluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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