Documentation ¶
Index ¶
- type Cluster
- type CommittedEpoch
- type Config
- type DKG
- type EpochQuery
- type InvalidEpoch
- func (u *InvalidEpoch) Cluster(uint) (protocol.Cluster, error)
- func (u *InvalidEpoch) Clustering() (flow.ClusterList, error)
- func (u *InvalidEpoch) Counter() (uint64, error)
- func (u *InvalidEpoch) DKG() (protocol.DKG, error)
- func (u *InvalidEpoch) FinalView() (uint64, error)
- func (u *InvalidEpoch) FirstView() (uint64, error)
- func (u *InvalidEpoch) InitialIdentities() (flow.IdentityList, error)
- func (u *InvalidEpoch) Seed(...uint32) ([]byte, error)
- type InvalidEpochQuery
- type InvalidSnapshot
- func (u *InvalidSnapshot) Commit() (flow.StateCommitment, error)
- func (u *InvalidSnapshot) Epochs() protocol.EpochQuery
- func (u *InvalidSnapshot) Head() (*flow.Header, error)
- func (u *InvalidSnapshot) Identities(_ flow.IdentityFilter) (flow.IdentityList, error)
- func (u *InvalidSnapshot) Identity(_ flow.Identifier) (*flow.Identity, error)
- func (u *InvalidSnapshot) Pending() ([]flow.Identifier, error)
- func (u *InvalidSnapshot) Phase() (flow.EpochPhase, error)
- func (u *InvalidSnapshot) Seed(_ ...uint32) ([]byte, error)
- type Mutator
- func (m *Mutator) Bootstrap(root *flow.Block, result *flow.ExecutionResult, seal *flow.Seal) error
- func (m *Mutator) Extend(candidate *flow.Block) error
- func (m *Mutator) Finalize(blockID flow.Identifier) error
- func (m *Mutator) HeaderExtend(candidate *flow.Block) error
- func (m *Mutator) MarkValid(blockID flow.Identifier) error
- type Params
- type SetupEpoch
- func (es *SetupEpoch) Cluster(_ uint) (protocol.Cluster, error)
- func (es *SetupEpoch) Clustering() (flow.ClusterList, error)
- func (es *SetupEpoch) Counter() (uint64, error)
- func (es *SetupEpoch) DKG() (protocol.DKG, error)
- func (es *SetupEpoch) FinalView() (uint64, error)
- func (es *SetupEpoch) FirstView() (uint64, error)
- func (es *SetupEpoch) InitialIdentities() (flow.IdentityList, error)
- func (es *SetupEpoch) Seed(indices ...uint32) ([]byte, error)
- type Snapshot
- func (s *Snapshot) Commit() (flow.StateCommitment, error)
- 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) Pending() ([]flow.Identifier, error)
- func (s *Snapshot) Phase() (flow.EpochPhase, error)
- func (s *Snapshot) Seed(indices ...uint32) ([]byte, error)
- type State
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
}
Cluster implements interface protocol.Cluster It is a container with all information about a specific cluster.
func (Cluster) EpochCounter ¶
func (Cluster) Members ¶
func (c Cluster) Members() flow.IdentityList
func (Cluster) RootQC ¶
func (c Cluster) RootQC() *flow.QuorumCertificate
type CommittedEpoch ¶
type CommittedEpoch struct { SetupEpoch // contains filtered or unexported fields }
CommittedEpoch represents an epoch that has been committed. Both the EpochSetup and EpochCommitted events for the epoch have been emitted as of the point at which the epoch was queried.
func NewCommittedEpoch ¶
func NewCommittedEpoch(setupEvent *flow.EpochSetup, commitEvent *flow.EpochCommit) *CommittedEpoch
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func DefaultConfig ¶
func DefaultConfig() Config
type EpochQuery ¶
type EpochQuery struct {
// contains filtered or unexported fields
}
EpochQuery encapsulates querying epochs w.r.t. a snapshot.
func (*EpochQuery) Current ¶
func (q *EpochQuery) Current() protocol.Epoch
Current returns the current epoch.
func (*EpochQuery) Next ¶
func (q *EpochQuery) Next() protocol.Epoch
Next returns the next epoch, if it is available.
func (*EpochQuery) Previous ¶ added in v0.13.0
func (q *EpochQuery) Previous() protocol.Epoch
Previous returns the previous epoch. During the first epoch after the root block, this returns a sentinel error (since there is no previous epoch). For all other epochs, returns the previous epoch.
type InvalidEpoch ¶
type InvalidEpoch struct {
// contains filtered or unexported fields
}
InvalidEpoch represents an epoch that does not exist. Neither the EpochSetup nor EpochCommitted events for the epoch have been emitted as of the point at which the epoch was queried.
func NewInvalidEpoch ¶
func NewInvalidEpoch(err error) *InvalidEpoch
func (*InvalidEpoch) Clustering ¶
func (u *InvalidEpoch) Clustering() (flow.ClusterList, error)
func (*InvalidEpoch) Counter ¶
func (u *InvalidEpoch) Counter() (uint64, error)
func (*InvalidEpoch) FinalView ¶
func (u *InvalidEpoch) FinalView() (uint64, error)
func (*InvalidEpoch) FirstView ¶ added in v0.13.0
func (u *InvalidEpoch) FirstView() (uint64, error)
func (*InvalidEpoch) InitialIdentities ¶
func (u *InvalidEpoch) InitialIdentities() (flow.IdentityList, error)
type InvalidEpochQuery ¶
type InvalidEpochQuery struct {
// contains filtered or unexported fields
}
InvalidEpochQuery is an epoch query for an invalid snapshot.
func (*InvalidEpochQuery) Current ¶
func (u *InvalidEpochQuery) Current() protocol.Epoch
func (*InvalidEpochQuery) Next ¶
func (u *InvalidEpochQuery) Next() protocol.Epoch
func (*InvalidEpochQuery) Previous ¶ added in v0.13.0
func (u *InvalidEpochQuery) Previous() protocol.Epoch
type InvalidSnapshot ¶
type InvalidSnapshot struct {
// contains filtered or unexported fields
}
InvalidSnapshot represents a snapshot referencing an invalid block, or for which an error occurred while resolving the reference block.
func NewInvalidSnapshot ¶
func NewInvalidSnapshot(err error) *InvalidSnapshot
func (*InvalidSnapshot) Commit ¶
func (u *InvalidSnapshot) Commit() (flow.StateCommitment, error)
func (*InvalidSnapshot) Epochs ¶
func (u *InvalidSnapshot) Epochs() protocol.EpochQuery
func (*InvalidSnapshot) Identities ¶
func (u *InvalidSnapshot) Identities(_ flow.IdentityFilter) (flow.IdentityList, error)
func (*InvalidSnapshot) Identity ¶
func (u *InvalidSnapshot) Identity(_ flow.Identifier) (*flow.Identity, error)
func (*InvalidSnapshot) Pending ¶
func (u *InvalidSnapshot) Pending() ([]flow.Identifier, error)
func (*InvalidSnapshot) Phase ¶
func (u *InvalidSnapshot) Phase() (flow.EpochPhase, error)
type Mutator ¶
type Mutator struct {
// contains filtered or unexported fields
}
func (*Mutator) MarkValid ¶
func (m *Mutator) MarkValid(blockID flow.Identifier) error
MarkValid marks the block as valid in protocol state, and triggers `BlockProcessable` event to notify that its parent block is processable. why the parent block is processable, not the block itself? because a block having a child block means it has been verified by the majority of consensus participants. Hence, if a block has passed the header validity check, its parent block must have passed both the header validity check and the body validity check. So that consensus followers can skip the block body validity checks and wait for its child to arrive, and if the child passes the header validity check, it means the consensus participants have done a complete check on its parent block, so consensus followers can trust consensus nodes did the right job, and start processing the parent block. NOTE: since a parent can have multiple children, `BlockProcessable` event could be triggered multiple times for the same block. NOTE: BlockProcessable should not be blocking, otherwise, it will block the follower
type SetupEpoch ¶
type SetupEpoch struct {
// contains filtered or unexported fields
}
SetupEpoch represents an epoch that has been setup, but not committed. Only the EpochSetup event for the epoch has been emitted as of the point at which the epoch was queried.
func NewSetupEpoch ¶
func NewSetupEpoch(setupEvent *flow.EpochSetup) *SetupEpoch
func (*SetupEpoch) Clustering ¶
func (es *SetupEpoch) Clustering() (flow.ClusterList, error)
func (*SetupEpoch) Counter ¶
func (es *SetupEpoch) Counter() (uint64, error)
func (*SetupEpoch) FinalView ¶
func (es *SetupEpoch) FinalView() (uint64, error)
func (*SetupEpoch) FirstView ¶ added in v0.13.0
func (es *SetupEpoch) FirstView() (uint64, error)
func (*SetupEpoch) InitialIdentities ¶
func (es *SetupEpoch) InitialIdentities() (flow.IdentityList, error)
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot implements the protocol.Snapshot interface. It represents a read-only immutable snapshot of the protocol state at the block it is constructed with. It allows efficient access to data associated directly with blocks at a given state (finalized, sealed), such as the related header, commit, seed or pending children. A block snapshot can lazily convert to an epoch snapshot in order to make data associated directly with epochs accessible through its API.
func NewSnapshot ¶
func NewSnapshot(state *State, blockID flow.Identifier) *Snapshot
func (*Snapshot) Commit ¶
func (s *Snapshot) Commit() (flow.StateCommitment, error)
Commit retrieves the latest execution state commitment at the current block snapshot. This commitment represents the execution state as currently finalized.
func (*Snapshot) Epochs ¶
func (s *Snapshot) Epochs() protocol.EpochQuery
func (*Snapshot) Identities ¶
func (s *Snapshot) Identities(selector flow.IdentityFilter) (flow.IdentityList, error)
type State ¶
type State struct {
// contains filtered or unexported fields
}
func NewState ¶
func NewState( metrics module.ComplianceMetrics, tracer module.Tracer, db *badger.DB, headers storage.Headers, seals storage.Seals, index storage.Index, payloads storage.Payloads, blocks storage.Blocks, setups storage.EpochSetups, commits storage.EpochCommits, statuses storage.EpochStatuses, consumer protocol.Consumer, ) (*State, error)
NewState initializes a new state backed by a badger database, applying the optional configuration parameters.