Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MutableState ¶ added in v0.14.0
type MutableState struct {
*State
// contains filtered or unexported fields
}
func NewMutableState ¶ added in v0.14.0
func (*MutableState) Extend ¶ added in v0.14.0
func (m *MutableState) Extend(proposal *cluster.Proposal) error
Extend introduces the given block into the cluster state as a pending without modifying the current finalized state. The block's parent must have already been successfully inserted. TODO(ramtin) pass context here Expected errors during normal operations:
- state.OutdatedExtensionError if the candidate block is outdated (e.g. orphaned)
- state.UnverifiableExtensionError if the reference block is _not_ a known finalized block
- state.InvalidExtensionError if the candidate block is invalid
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot pertains to a specific fork of the collector cluster consensus. Specifically, it references one block denoted as the `Head`. This Snapshot type is for collector clusters, so we are referencing a cluster block, aka collection, here.
This implementation must be used for KNOWN reference BLOCKs only.
func (*Snapshot) Collection ¶
func (s *Snapshot) Collection() (*flow.Collection, error)
Collection returns the collection designated as the reference for this snapshot. Technically, this is a portion of the payload of a cluster block.
By contract of the constructor, the blockID must correspond to a known collection in the database. No error returns are expected during normal operation.
func (*Snapshot) Head ¶
Head returns the header of the collection that designated as the reference for this snapshot.
By contract of the constructor, the blockID must correspond to a known collection in the database. No error returns are expected during normal operation.
func (*Snapshot) Pending ¶
func (s *Snapshot) Pending() ([]flow.Identifier, error)
Pending returns the IDs of all collections descending from the snapshot's head collection. The result is ordered such that parents are included before their children. While only valid descendants will be returned, note that the descendants may not be finalized yet. By contract of the constructor, the blockID must correspond to a known collection in the database. No error returns are expected during normal operation.
type State ¶
type State struct {
// contains filtered or unexported fields
}
func Bootstrap ¶ added in v0.14.0
Bootstrap initializes the persistent cluster state with a genesis block. The genesis block must have height 0, a parent hash of 32 zero bytes, and an empty collection as payload.
func (*State) AtBlockID ¶
func (s *State) AtBlockID(blockID flow.Identifier) cluster.Snapshot
AtBlockID returns the snapshot of the persistent cluster at the given block ID. It is available for any block that was introduced into the cluster state, and can thus represent an ambiguous state that was or will never be finalized. If the block is unknown, it returns an invalid snapshot, which returns state.ErrUnknownSnapshotReference for all methods
type StateRoot ¶ added in v0.14.0
type StateRoot struct {
// contains filtered or unexported fields
}
StateRoot is the root information required to bootstrap the cluster state.
func NewStateRoot ¶ added in v0.14.0
func (StateRoot) EpochCounter ¶ added in v0.31.0
func (StateRoot) QC ¶ added in v0.29.0
func (s StateRoot) QC() *flow.QuorumCertificate
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
Translator is a translation layer that determines the reference block on the main chain for a given cluster block, using the reference block from the cluster block's payload.
func NewTranslator ¶
func NewTranslator(payloads storage.ClusterPayloads, state protocol.State) *Translator
NewTranslator returns a new block ID translator.
func (*Translator) Translate ¶
func (t *Translator) Translate(blockID flow.Identifier) (flow.Identifier, error)
Translate retrieves the reference main-chain block ID for the given cluster block ID.