Documentation ¶
Index ¶
- func New(role beacon.RoleType, identifier []byte, logger *zap.Logger, ...) ibft.Controller
- type Controller
- func (i *Controller) GetIBFTCommittee() map[uint64]*proto.Node
- func (i *Controller) GetIdentifier() []byte
- func (i *Controller) Init() error
- func (i *Controller) NextSeqNumber() (uint64, error)
- func (i *Controller) ProcessDecidedMessage(msg *proto.SignedMessage)
- func (i *Controller) ProcessSyncMessage(msg *network.SyncChanObj)
- func (i *Controller) StartInstance(opts ibft.ControllerStartInstanceOptions) (*ibft.InstanceResult, error)
- func (i *Controller) SyncIBFT() error
- func (i *Controller) ValidateDecidedMsg(msg *proto.SignedMessage) error
- func (i *Controller) ValidateDecidedMsgV0() pipeline.Pipeline
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New( role beacon.RoleType, identifier []byte, logger *zap.Logger, storage collections.Iibft, network network.Network, queue *msgqueue.MessageQueue, instanceConfig *proto.InstanceConfig, ValidatorShare *storage.Share, fork contollerforks.Fork, ) ibft.Controller
New is the constructor of Controller
Types ¶
type Controller ¶
type Controller struct { Identifier []byte // contains filtered or unexported fields }
Controller implements Controller interface
func (*Controller) GetIBFTCommittee ¶
func (i *Controller) GetIBFTCommittee() map[uint64]*proto.Node
GetIBFTCommittee returns a map of the iBFT committee where the key is the member's id.
func (*Controller) GetIdentifier ¶
func (i *Controller) GetIdentifier() []byte
GetIdentifier returns ibft identifier made of public key and role (type)
func (*Controller) Init ¶
func (i *Controller) Init() error
Init sets all major processes of iBFT while blocking until completed.
func (*Controller) NextSeqNumber ¶
func (i *Controller) NextSeqNumber() (uint64, error)
NextSeqNumber returns the previous decided instance seq number + 1 In case it's the first instance it returns 0
func (*Controller) ProcessDecidedMessage ¶
func (i *Controller) ProcessDecidedMessage(msg *proto.SignedMessage)
ProcessDecidedMessage is responsible for processing an incoming decided message. If the decided message is known or belong to the current executing instance, do nothing. Else perform a sync operation
From https://arxiv.org/pdf/2002.03613.pdf
We can omit this if we assume some mechanism external to the consensus algorithm that ensures synchronization of decided values. upon receiving a valid hROUND-CHANGE, λi, −, −, −i message from pj ∧ pi has decided by calling Decide(λi,− , Qcommit) do
send Qcommit to process pj
func (*Controller) ProcessSyncMessage ¶
func (i *Controller) ProcessSyncMessage(msg *network.SyncChanObj)
ProcessSyncMessage - processes sync messages
func (*Controller) StartInstance ¶
func (i *Controller) StartInstance(opts ibft.ControllerStartInstanceOptions) (*ibft.InstanceResult, error)
StartInstance - starts an ibft instance or returns error
func (*Controller) SyncIBFT ¶
func (i *Controller) SyncIBFT() error
SyncIBFT will fetch best known decided message (highest sequence) from the network and sync to it.
func (*Controller) ValidateDecidedMsg ¶
func (i *Controller) ValidateDecidedMsg(msg *proto.SignedMessage) error
ValidateDecidedMsg - the main decided msg pipeline
func (*Controller) ValidateDecidedMsgV0 ¶
func (i *Controller) ValidateDecidedMsgV0() pipeline.Pipeline
ValidateDecidedMsgV0 - genesis version 0