Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cluster ¶
Cluster represents a cluster of block producers.
func NewCluster ¶
NewCluster returns a new bp.Cluster.
func (*Cluster) BpID2Index ¶
BpID2Index returns the index corresponding to id.
func (*Cluster) BpIndex2ID ¶
BpIndex2ID returns the ID correspinding to idx.
type ClusterMember ¶ added in v0.9.4
ClusterMember is an interface which corresponds to BP member udpate.
type Snapshot ¶ added in v0.9.4
Snapshot represents the set of the elected BP at refBlockNo.
func NewSnapshot ¶ added in v0.9.4
NewSnapshot returns a Snapshot corresponding to blockNo and period.
type Snapshots ¶ added in v0.9.4
type Snapshots struct {
// contains filtered or unexported fields
}
Snapshots is a map from block no to *Snapshot.
func NewSnapshots ¶ added in v0.9.4
func NewSnapshots(c ClusterMember, cdb consensus.ChainDB, sdb *state.ChainStateDB) *Snapshots
NewSnapshots returns a new Snapshots.
func (*Snapshots) AddSnapshot ¶ added in v0.9.4
AddSnapshot add a new BP list corresponding to refBlockNO to sn.
func (*Snapshots) NeedToRefresh ¶ added in v0.9.4
NeedToRefresh reports whether blockNo corresponds to a BP regime change point.
func (*Snapshots) UpdateCluster ¶ added in v0.9.10
UpdateCluster updates the current BP list by the ones corresponding to blockNo.