inmem

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: AGPL-3.0 Imports: 11 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func FromCluster(from protocol.Cluster) (*Cluster, error)

FromCluster converts any protocol.Cluster to a memory-backed Cluster

func (Cluster) ChainID

func (c Cluster) ChainID() flow.ChainID

func (Cluster) EpochCounter

func (c Cluster) EpochCounter() uint64

func (Cluster) Index

func (c Cluster) Index() uint

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

func FromDKG(from protocol.DKG, participants flow.IdentityList) (*DKG, error)

FromDKG converts any protocol.DKG to a memory-backed DKG.

The given participant list must exactly match the DKG members.

func (DKG) GroupKey

func (d DKG) GroupKey() crypto.PublicKey

func (DKG) Index

func (d DKG) Index(nodeID flow.Identifier) (uint, error)

func (DKG) KeyShare

func (d DKG) KeyShare(nodeID flow.Identifier) (crypto.PublicKey, error)

func (DKG) Size

func (d DKG) Size() uint

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
	FinalView         uint64
	RandomSource      []byte
	InitialIdentities flow.IdentityList
	Clustering        flow.ClusterList
	Clusters          []EncodableCluster
	DKG               *EncodableDKG
}

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 EncodableSnapshot

type EncodableSnapshot struct {
	Head              *flow.Header
	Identities        flow.IdentityList
	LatestSeal        *flow.Seal
	LatestResult      *flow.ExecutionResult
	SealingSegment    []*flow.Block
	QuorumCertificate *flow.QuorumCertificate
	Phase             flow.EpochPhase
	Epochs            EncodableEpochs
}

EncodableSnapshot is the encoding format for protocol.Snapshot

type Epoch

type Epoch struct {
	// contains filtered or unexported fields
}

Epoch is a memory-backed implementation of protocol.Epoch.

func FromEpoch

func FromEpoch(from protocol.Epoch) (*Epoch, error)

FromEpoch converts any protocol.Epoch to a memory-backed Epoch.

func NewCommittedEpoch

func NewCommittedEpoch(setupEvent *flow.EpochSetup, commitEvent *flow.EpochCommit) (*Epoch, error)

NewSetupEpoch returns an memory-backed epoch implementation based on an EpochSetup and EpochCommit event.

func NewSetupEpoch

func NewSetupEpoch(setupEvent *flow.EpochSetup) (*Epoch, error)

NewSetupEpoch returns an 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.

func (Epoch) Cluster

func (e Epoch) Cluster(i uint) (protocol.Cluster, error)

func (Epoch) Clustering

func (e Epoch) Clustering() (flow.ClusterList, error)

func (Epoch) Counter

func (e Epoch) Counter() (uint64, error)

func (Epoch) DKG

func (e Epoch) DKG() (protocol.DKG, error)

func (Epoch) FinalView

func (e Epoch) FinalView() (uint64, error)

func (Epoch) FirstView

func (e Epoch) FirstView() (uint64, error)

func (Epoch) InitialIdentities

func (e Epoch) InitialIdentities() (flow.IdentityList, error)

func (Epoch) RandomSource

func (e Epoch) RandomSource() ([]byte, error)

func (Epoch) Seed

func (e Epoch) Seed(indices ...uint32) ([]byte, error)

type Epochs

type Epochs struct {
	// contains filtered or unexported fields
}

func (Epochs) Current

func (eq Epochs) Current() protocol.Epoch

func (Epochs) Next

func (eq Epochs) Next() protocol.Epoch

func (Epochs) Previous

func (eq Epochs) Previous() protocol.Epoch

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

func FromSnapshot(from protocol.Snapshot) (*Snapshot, error)

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.

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 SnapshotFromEncodable

func SnapshotFromEncodable(enc EncodableSnapshot) *Snapshot

func (Snapshot) Commit

func (s Snapshot) Commit() (flow.StateCommitment, error)

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) Head

func (s Snapshot) Head() (*flow.Header, error)

func (Snapshot) Identities

func (s Snapshot) Identities(selector flow.IdentityFilter) (flow.IdentityList, error)

func (Snapshot) Identity

func (s Snapshot) Identity(nodeID flow.Identifier) (*flow.Identity, error)

func (Snapshot) Phase

func (s Snapshot) Phase() (flow.EpochPhase, error)

func (Snapshot) QuorumCertificate

func (s Snapshot) QuorumCertificate() (*flow.QuorumCertificate, error)

func (Snapshot) SealedResult

func (s Snapshot) SealedResult() (*flow.ExecutionResult, *flow.Seal, error)

func (Snapshot) SealingSegment

func (s Snapshot) SealingSegment() ([]*flow.Block, error)

func (Snapshot) Seed

func (s Snapshot) Seed(indices ...uint32) ([]byte, error)

func (Snapshot) ValidDescendants added in v0.17.6

func (s Snapshot) ValidDescendants() ([]flow.Identifier, error)

Jump to

Keyboard shortcuts

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