Documentation ¶
Index ¶
- func ClusteringFromSetupEvent(setupEvent *flow.EpochSetup) (flow.ClusterList, error)
- func NewCommittedEpoch(setupEvent *flow.EpochSetup, commitEvent *flow.EpochCommit) protocol.Epoch
- func NewEndedEpoch(setupEvent *flow.EpochSetup, commitEvent *flow.EpochCommit, ...) protocol.Epoch
- func NewSetupEpoch(setupEvent *flow.EpochSetup) protocol.Epoch
- func NewStartedEpoch(setupEvent *flow.EpochSetup, commitEvent *flow.EpochCommit, firstHeight uint64) protocol.Epoch
- type Cluster
- type DKG
- type EncodableCluster
- type EncodableDKG
- type EncodableEpoch
- type EncodableEpochs
- type EncodableFullDKG
- type EncodableParams
- type EncodableSnapshot
- type Epoch
- func (e Epoch) Cluster(i uint) (protocol.Cluster, error)
- func (e Epoch) ClusterByChainID(chainID flow.ChainID) (protocol.Cluster, error)
- func (e Epoch) Clustering() (flow.ClusterList, error)
- func (e Epoch) Counter() (uint64, error)
- func (e Epoch) DKG() (protocol.DKG, error)
- func (e Epoch) DKGPhase1FinalView() (uint64, error)
- func (e Epoch) DKGPhase2FinalView() (uint64, error)
- func (e Epoch) DKGPhase3FinalView() (uint64, error)
- func (e Epoch) Encodable() EncodableEpoch
- func (e Epoch) FinalHeight() (uint64, error)
- func (e Epoch) FinalView() (uint64, error)
- func (e Epoch) FirstHeight() (uint64, error)
- func (e Epoch) FirstView() (uint64, error)
- func (e Epoch) InitialIdentities() (flow.IdentityList, error)
- func (e Epoch) RandomSource() ([]byte, error)
- type Epochs
- type Params
- type Snapshot
- func FromSnapshot(from protocol.Snapshot) (*Snapshot, error)
- func SnapshotFromBootstrapState(root *flow.Block, result *flow.ExecutionResult, seal *flow.Seal, ...) (*Snapshot, error)
- func SnapshotFromBootstrapStateWithParams(root *flow.Block, result *flow.ExecutionResult, seal *flow.Seal, ...) (*Snapshot, error)
- func SnapshotFromEncodable(enc EncodableSnapshot) *Snapshot
- func (s Snapshot) Commit() (flow.StateCommitment, error)
- func (s Snapshot) Descendants() ([]flow.Identifier, error)
- func (s Snapshot) Encodable() EncodableSnapshot
- func (s Snapshot) Epochs() protocol.EpochQuery
- func (s Snapshot) Head() (*flow.Header, error)
- func (s Snapshot) Identities(selector flow.IdentityFilter) (flow.IdentityList, error)
- func (s Snapshot) Identity(nodeID flow.Identifier) (*flow.Identity, error)
- func (s Snapshot) Params() protocol.GlobalParams
- func (s Snapshot) Phase() (flow.EpochPhase, error)
- func (s Snapshot) QuorumCertificate() (*flow.QuorumCertificate, error)
- func (s Snapshot) RandomSource() ([]byte, error)
- func (s Snapshot) SealedResult() (*flow.ExecutionResult, *flow.Seal, error)
- func (s Snapshot) SealingSegment() (*flow.SealingSegment, error)
- func (s Snapshot) VersionBeacon() (*flow.SealedVersionBeacon, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusteringFromSetupEvent ¶ added in v0.26.1
func ClusteringFromSetupEvent(setupEvent *flow.EpochSetup) (flow.ClusterList, error)
func NewCommittedEpoch ¶
func NewCommittedEpoch(setupEvent *flow.EpochSetup, commitEvent *flow.EpochCommit) protocol.Epoch
NewCommittedEpoch returns a memory-backed epoch implementation based on an EpochSetup and EpochCommit events. No errors are expected during normal operations.
func NewEndedEpoch ¶ added in v0.30.0
func NewEndedEpoch(setupEvent *flow.EpochSetup, commitEvent *flow.EpochCommit, firstHeight, finalHeight uint64) protocol.Epoch
NewEndedEpoch returns a memory-backed epoch implementation based on an EpochSetup and EpochCommit events, and the epoch's final block height. No errors are expected during normal operations.
func NewSetupEpoch ¶
func NewSetupEpoch(setupEvent *flow.EpochSetup) protocol.Epoch
NewSetupEpoch returns a memory-backed epoch implementation based on an EpochSetup event. Epoch information available after the setup phase will not be accessible in the resulting epoch instance. No errors are expected during normal operations.
func NewStartedEpoch ¶ added in v0.30.0
func NewStartedEpoch(setupEvent *flow.EpochSetup, commitEvent *flow.EpochCommit, firstHeight uint64) protocol.Epoch
NewStartedEpoch returns a memory-backed epoch implementation based on an EpochSetup and EpochCommit events, and the epoch's first block height. No errors are expected during normal operations.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func ClusterFromEncodable ¶
func ClusterFromEncodable(enc EncodableCluster) (*Cluster, error)
ClusterFromEncodable returns a Cluster backed by the given encodable representation.
func FromCluster ¶
FromCluster converts any protocol.Cluster to a memory-backed Cluster. No errors are expected during normal operation.
func (Cluster) EpochCounter ¶
func (Cluster) Members ¶
func (c Cluster) Members() flow.IdentityList
func (Cluster) RootBlock ¶
func (c Cluster) RootBlock() *clustermodel.Block
func (Cluster) RootQC ¶
func (c Cluster) RootQC() *flow.QuorumCertificate
type DKG ¶
type DKG struct {
// contains filtered or unexported fields
}
func DKGFromEncodable ¶
func DKGFromEncodable(enc EncodableDKG) (*DKG, error)
DKGFromEncodable returns a DKG backed by the given encodable representation.
func FromDKG ¶
FromDKG converts any protocol.DKG to a memory-backed DKG.
The given participant list must exactly match the DKG members. All errors indicate inconsistent or invalid inputs. No errors are expected during normal operation.
func (DKG) Index ¶
func (d DKG) Index(nodeID flow.Identifier) (uint, error)
Index returns the index for the given node. Error Returns: protocol.IdentityNotFoundError if nodeID is not a valid DKG participant.
type EncodableCluster ¶
type EncodableCluster struct { Index uint Counter uint64 Members flow.IdentityList RootBlock *cluster.Block RootQC *flow.QuorumCertificate }
EncodableCluster is the encoding format for protocol.Cluster
type EncodableDKG ¶
type EncodableDKG struct { GroupKey encodable.RandomBeaconPubKey Participants map[flow.Identifier]flow.DKGParticipant }
EncodableDKG is the encoding format for protocol.DKG
type EncodableEpoch ¶
type EncodableEpoch struct { Counter uint64 FirstView uint64 DKGPhase1FinalView uint64 DKGPhase2FinalView uint64 DKGPhase3FinalView uint64 FinalView uint64 RandomSource []byte InitialIdentities flow.IdentityList Clustering flow.ClusterList Clusters []EncodableCluster DKG *EncodableDKG FirstHeight *uint64 FinalHeight *uint64 }
EncodableEpoch is the encoding format for protocol.Epoch
type EncodableEpochs ¶
type EncodableEpochs struct { Previous *EncodableEpoch Current EncodableEpoch // cannot be nil Next *EncodableEpoch }
EncodableEpochs is the encoding format for protocol.EpochQuery
type EncodableFullDKG ¶ added in v0.22.8
type EncodableFullDKG struct { GroupKey encodable.RandomBeaconPubKey }
type EncodableParams ¶ added in v0.23.2
type EncodableParams struct { ChainID flow.ChainID SporkID flow.Identifier SporkRootBlockHeight uint64 ProtocolVersion uint EpochCommitSafetyThreshold uint64 }
EncodableParams is the encoding format for protocol.GlobalParams
type EncodableSnapshot ¶
type EncodableSnapshot struct { Head *flow.Header Identities flow.IdentityList LatestSeal *flow.Seal LatestResult *flow.ExecutionResult SealingSegment *flow.SealingSegment QuorumCertificate *flow.QuorumCertificate Phase flow.EpochPhase Epochs EncodableEpochs Params EncodableParams SealedVersionBeacon *flow.SealedVersionBeacon }
EncodableSnapshot is the encoding format for protocol.Snapshot
func StrippedInmemSnapshot ¶ added in v0.22.0
func StrippedInmemSnapshot(snapshot EncodableSnapshot) EncodableSnapshot
StrippedInmemSnapshot removes all the networking address in the snapshot
type Epoch ¶
type Epoch struct {
// contains filtered or unexported fields
}
Epoch is a memory-backed implementation of protocol.Epoch.
func FromEpoch ¶
FromEpoch converts any protocol.Epoch to a memory-backed Epoch. Error returns: * protocol.ErrNoPreviousEpoch - if the epoch represents a previous epoch which does not exist. * protocol.ErrNextEpochNotSetup - if the epoch represents a next epoch which has not been set up. * state.ErrUnknownSnapshotReference - if the epoch is queried from an unresolvable snapshot.
func (Epoch) ClusterByChainID ¶ added in v0.26.1
func (Epoch) Clustering ¶
func (e Epoch) Clustering() (flow.ClusterList, error)
func (Epoch) DKGPhase1FinalView ¶ added in v0.20.0
func (Epoch) DKGPhase2FinalView ¶ added in v0.20.0
func (Epoch) DKGPhase3FinalView ¶ added in v0.20.0
func (Epoch) Encodable ¶ added in v0.20.0
func (e Epoch) Encodable() EncodableEpoch
func (Epoch) FinalHeight ¶ added in v0.30.0
func (Epoch) FirstHeight ¶ added in v0.30.0
func (Epoch) InitialIdentities ¶
func (e Epoch) InitialIdentities() (flow.IdentityList, error)
func (Epoch) RandomSource ¶
type Params ¶ added in v0.23.2
type Params struct {
// contains filtered or unexported fields
}
func FromParams ¶ added in v0.23.2
func FromParams(from protocol.GlobalParams) (*Params, error)
FromParams converts any protocol.GlobalParams to a memory-backed Params. TODO error docs
func (Params) EpochCommitSafetyThreshold ¶ added in v0.29.0
func (Params) ProtocolVersion ¶ added in v0.23.2
func (Params) SporkRootBlockHeight ¶ added in v0.29.6
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot is a memory-backed implementation of protocol.Snapshot. The snapshot data is stored in the embedded encodable snapshot model, which defines the canonical structure of an encoded snapshot for the purposes of serialization.
func FromSnapshot ¶
FromSnapshot generates a memory-backed snapshot from the input snapshot. Typically, this would be used to convert a database-backed snapshot to one that can easily be serialized to disk or to network. TODO error docs
func SnapshotFromBootstrapState ¶
func SnapshotFromBootstrapState(root *flow.Block, result *flow.ExecutionResult, seal *flow.Seal, qc *flow.QuorumCertificate) (*Snapshot, error)
SnapshotFromBootstrapState generates a protocol.Snapshot representing a root bootstrap state. This is used to bootstrap the protocol state for genesis or post-spork states.
func SnapshotFromBootstrapStateWithParams ¶ added in v0.29.0
func SnapshotFromBootstrapStateWithParams( root *flow.Block, result *flow.ExecutionResult, seal *flow.Seal, qc *flow.QuorumCertificate, protocolVersion uint, epochCommitSafetyThreshold uint64, ) (*Snapshot, error)
SnapshotFromBootstrapStateWithParams is SnapshotFromBootstrapState with a caller-specified protocol version.
func SnapshotFromEncodable ¶
func SnapshotFromEncodable(enc EncodableSnapshot) *Snapshot
func (Snapshot) Descendants ¶ added in v0.17.6
func (s Snapshot) Descendants() ([]flow.Identifier, error)
func (Snapshot) Encodable ¶
func (s Snapshot) Encodable() EncodableSnapshot
func (Snapshot) Epochs ¶
func (s Snapshot) Epochs() protocol.EpochQuery
func (Snapshot) Identities ¶
func (s Snapshot) Identities(selector flow.IdentityFilter) (flow.IdentityList, error)
func (Snapshot) Params ¶ added in v0.23.2
func (s Snapshot) Params() protocol.GlobalParams
func (Snapshot) QuorumCertificate ¶
func (s Snapshot) QuorumCertificate() (*flow.QuorumCertificate, error)
func (Snapshot) RandomSource ¶ added in v0.25.0
func (Snapshot) SealedResult ¶
func (Snapshot) SealingSegment ¶
func (s Snapshot) SealingSegment() (*flow.SealingSegment, error)
func (Snapshot) VersionBeacon ¶ added in v0.31.0
func (s Snapshot) VersionBeacon() (*flow.SealedVersionBeacon, error)