Documentation
¶
Index ¶
- func BaseCommitValidation(config qbft.IConfig, signedCommit *specqbft.SignedMessage, ...) error
- func CreateCommit(state *specqbft.State, config qbft.IConfig, value []byte) (*specqbft.SignedMessage, error)
- func CreatePrepare(state *specqbft.State, config qbft.IConfig, newRound specqbft.Round, ...) (*specqbft.SignedMessage, error)
- func CreateProposal(state *specqbft.State, config qbft.IConfig, value []byte, ...) (*specqbft.SignedMessage, error)
- func CreateRoundChange(state *specqbft.State, config qbft.IConfig, newRound specqbft.Round, ...) (*specqbft.SignedMessage, error)
- type Instance
- func (i *Instance) BaseMsgValidation(msg *specqbft.SignedMessage) error
- func (i *Instance) Broadcast(msg *specqbft.SignedMessage) error
- func (i *Instance) Decode(data []byte) error
- func (i *Instance) Encode() ([]byte, error)
- func (i *Instance) GetConfig() qbft.IConfig
- func (i *Instance) GetHeight() specqbft.Height
- func (i *Instance) GetRoot() ([]byte, error)
- func (i *Instance) IsDecided() (bool, []byte)
- func (i *Instance) ProcessMsg(msg *specqbft.SignedMessage) (decided bool, decidedValue []byte, aggregatedCommit *specqbft.SignedMessage, ...)
- func (i *Instance) SetConfig(config qbft.IConfig)
- func (i *Instance) Start(value []byte, height specqbft.Height)
- func (i *Instance) UponCommit(signedCommit *specqbft.SignedMessage, ...) (bool, []byte, *specqbft.SignedMessage, error)
- func (i *Instance) UponRoundTimeout() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseCommitValidation ¶
func CreateCommit ¶
func CreateCommit(state *specqbft.State, config qbft.IConfig, value []byte) (*specqbft.SignedMessage, error)
CreateCommit * Commit(
signCommit(
UnsignedCommit(
|current.blockchain|,
current.round,
signHash(hashBlockForCommitSeal(proposedBlock), current.id),
digest(proposedBlock)),
current.id
)
);
func CreatePrepare ¶
func CreatePrepare(state *specqbft.State, config qbft.IConfig, newRound specqbft.Round, value []byte) (*specqbft.SignedMessage, error)
CreatePrepare * Prepare(
signPrepare(
UnsignedPrepare(
|current.blockchain|,
newRound,
digest(m.proposedBlock)),
current.id
)
);
func CreateProposal ¶
func CreateProposal(state *specqbft.State, config qbft.IConfig, value []byte, roundChanges, prepares []*specqbft.SignedMessage) (*specqbft.SignedMessage, error)
CreateProposal *
Proposal(
signProposal(
UnsignedProposal(
|current.blockchain|,
newRound,
digest(block)),
current.id),
block,
extractSignedRoundChanges(roundChanges),
extractSignedPrepares(prepares));
func CreateRoundChange ¶
func CreateRoundChange(state *specqbft.State, config qbft.IConfig, newRound specqbft.Round, instanceStartValue []byte) (*specqbft.SignedMessage, error)
CreateRoundChange * RoundChange(
signRoundChange(
UnsignedRoundChange(
|current.blockchain|,
newRound,
digestOptionalBlock(current.lastPreparedBlock),
current.lastPreparedRound),
current.id),
current.lastPreparedBlock,
getRoundChangeJustification(current)
)
Types ¶
type Instance ¶
type Instance struct {
State *specqbft.State
StartValue []byte
// contains filtered or unexported fields
}
Instance is a single QBFT instance that starts with a Start call (including a value). Every new msg the ProcessMsg function needs to be called
func NewInstance ¶
func (*Instance) BaseMsgValidation ¶
func (i *Instance) BaseMsgValidation(msg *specqbft.SignedMessage) error
func (*Instance) ProcessMsg ¶
func (i *Instance) ProcessMsg(msg *specqbft.SignedMessage) (decided bool, decidedValue []byte, aggregatedCommit *specqbft.SignedMessage, err error)
ProcessMsg processes a new QBFT msg, returns non nil error on msg processing error
func (*Instance) UponCommit ¶
func (i *Instance) UponCommit(signedCommit *specqbft.SignedMessage, commitMsgContainer *specqbft.MsgContainer) (bool, []byte, *specqbft.SignedMessage, error)
UponCommit returns true if a quorum of commit messages was received. Assumes commit message is valid!
func (*Instance) UponRoundTimeout ¶
Click to show internal directories.
Click to hide internal directories.