Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Majority ¶
type Majority struct {
// contains filtered or unexported fields
}
Majority implements the bootstrapping poll to filter the initial set of potentially accaptable blocks into a set of accepted blocks to sync to.
Once the last accepted blocks have been fetched from the initial set of peers, the set of blocks are sent to all peers. Each peer is expected to filter the provided blocks and report which of them they consider accepted. If a majority of the peers report that a block is accepted, then the node will consider that block to be accepted by the network. This assumes that a majority of the network is correct. If a majority of the network is malicious, the node may accept an incorrect block.
func NewMajority ¶
func (*Majority) RecordOpinion ¶
type Minority ¶
type Minority struct {
// contains filtered or unexported fields
}
Minority implements the bootstrapping poll to determine the initial set of potentially accaptable blocks.
This poll fetches the last accepted block from an initial set of peers. In order for the protocol to find a recently accepted block, there must be at least one correct node in this set of peers. If there is not a correct node in the set of peers, the node will not accept an incorrect block. However, the node may be unable to find an acceptable block.
func NewMinority ¶
func (*Minority) RecordOpinion ¶
type Poll ¶
type Poll interface { // GetPeers returns the set of peers whose opinion should be requested. It // is expected to repeatedly call this function along with [RecordOpinion] // until [Result] returns finalized. GetPeers(ctx context.Context) (peers set.Set[ids.NodeID]) // RecordOpinion of a node whose opinion was requested. RecordOpinion(ctx context.Context, nodeID ids.NodeID, blkIDs set.Set[ids.ID]) error // Result returns the evaluation of all the peer's opinions along with a // flag to identify that the result has finished being calculated. Result(ctx context.Context) (blkIDs []ids.ID, finalized bool) }
var Noop Poll = noop{}