Documentation
¶
Index ¶
- func MaxNodesFaulty(n int) int
- func MinNodesFair(n int) int
- func MinNodesInQuorum(n int) int
- type BatchProposal
- type Consensus
- func (c *Consensus) Close()
- func (c *Consensus) EventAsynchronousCommonSubsetMsg(msg *messages.AsynchronousCommonSubsetMsg)
- func (c *Consensus) EventInclusionsStateMsg(msg *messages.InclusionStateMsg)
- func (c *Consensus) EventSignedResultAckMsg(msg *messages.SignedResultAckMsg)
- func (c *Consensus) EventSignedResultMsg(msg *messages.SignedResultMsg)
- func (c *Consensus) EventStateTransitionMsg(msg *messages.StateTransitionMsg)
- func (c *Consensus) EventTimerMsg(msg messages.TimerTick)
- func (c *Consensus) EventVMResultMsg(msg *messages.VMResultMsg)
- func (c *Consensus) GetStatusSnapshot() *chain.ConsensusInfo
- func (c *Consensus) IsReady() bool
- func (c *Consensus) ShouldReceiveMissingRequest(req iscp.Request) bool
- type ConsensusTimers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxNodesFaulty ¶ added in v0.2.0
MaxNodesFaulty calculates maximal number of nodes that can be assumed faulty F given a total number of nodes N.
func MinNodesFair ¶ added in v0.2.0
MinNodesFair returns a minimal number of nodes, that would include at least 1 fair node. It's F+1.
func MinNodesInQuorum ¶ added in v0.2.0
MinNodesInQuorum returns a minimal number T of nodes required for a quorum. If N=3F+1 then T=2F+1, but if if N is arbitrary, then T=N-F.
Types ¶
type BatchProposal ¶ added in v0.2.0
type BatchProposal struct {
ValidatorIndex uint16
StateOutputID ledgerstate.OutputID
RequestIDs []iscp.RequestID
RequestHashes [][32]byte
Timestamp time.Time
ConsensusManaPledge identity.ID
AccessManaPledge identity.ID
FeeDestination *iscp.AgentID
}
func BatchProposalFromBytes ¶ added in v0.2.0
func BatchProposalFromBytes(data []byte) (*BatchProposal, error)
func BatchProposalFromMarshalUtil ¶ added in v0.2.0
func BatchProposalFromMarshalUtil(mu *marshalutil.MarshalUtil) (*BatchProposal, error)
func (*BatchProposal) Bytes ¶ added in v0.2.0
func (b *BatchProposal) Bytes() []byte
func (*BatchProposal) EnsureTimestampConsistent ¶ added in v0.2.0
func (b *BatchProposal) EnsureTimestampConsistent(requests []iscp.Request, stateTimestamp time.Time) error
EnsureTimestampConsistent adjusts a batch timestamp, if it is not consistent with the requests in the BatchProposal and the previous transaction. The timestamp is consistent, if it is not bellow the timestamps of all the on-ledger requests and the previous transaction in the chain. This implement the "fixing" part described in IscpBatchTimestamp.tla.
type Consensus ¶ added in v0.2.0
type Consensus struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.2.0
func New(chainCore chain.ChainCore, mempool chain.Mempool, committee chain.Committee, nodeConn chain.NodeConnection, pullMissingRequestsFromCommittee bool, consensusMetrics metrics.ConsensusMetrics, timersOpt ...ConsensusTimers) *Consensus
func (*Consensus) EventAsynchronousCommonSubsetMsg ¶ added in v0.2.0
func (c *Consensus) EventAsynchronousCommonSubsetMsg(msg *messages.AsynchronousCommonSubsetMsg)
func (*Consensus) EventInclusionsStateMsg ¶ added in v0.2.0
func (c *Consensus) EventInclusionsStateMsg(msg *messages.InclusionStateMsg)
func (*Consensus) EventSignedResultAckMsg ¶ added in v0.2.0
func (c *Consensus) EventSignedResultAckMsg(msg *messages.SignedResultAckMsg)
func (*Consensus) EventSignedResultMsg ¶ added in v0.2.0
func (c *Consensus) EventSignedResultMsg(msg *messages.SignedResultMsg)
func (*Consensus) EventStateTransitionMsg ¶ added in v0.2.0
func (c *Consensus) EventStateTransitionMsg(msg *messages.StateTransitionMsg)
func (*Consensus) EventTimerMsg ¶ added in v0.2.0
func (*Consensus) EventVMResultMsg ¶ added in v0.2.0
func (c *Consensus) EventVMResultMsg(msg *messages.VMResultMsg)
func (*Consensus) GetStatusSnapshot ¶ added in v0.2.0
func (c *Consensus) GetStatusSnapshot() *chain.ConsensusInfo
type ConsensusTimers ¶ added in v0.2.0
type ConsensusTimers struct {
VMRunRetryToWaitForReadyRequests time.Duration
BroadcastSignedResultRetry time.Duration
PostTxSequenceStep time.Duration
PullInclusionStateRetry time.Duration
ProposeBatchRetry time.Duration
ProposeBatchDelayForNewState time.Duration
}
func NewConsensusTimers ¶ added in v0.2.0
func NewConsensusTimers() ConsensusTimers
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package commoncoin implements a common coin abstraction needed by the HoneyBadgerBFT for synchronization and randomness.
|
Package commoncoin implements a common coin abstraction needed by the HoneyBadgerBFT for synchronization and randomness. |