consensus

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2022 License: Apache-2.0, BSD-2-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxNodesFaulty added in v0.2.0

func MaxNodesFaulty(n int) int

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

func MinNodesFair(n int) int

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

func MinNodesInQuorum(n int) int

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.

func New added in v0.2.0

func New(
	chainCore chain.ChainCore,
	mempool chain.Mempool,
	committee chain.Committee,
	peerGroup peering.GroupProvider,
	nodeConn chain.ChainNodeConnection,
	pullMissingRequestsFromCommittee bool,
	consensusMetrics metrics.ConsensusMetrics,
	wal chain.WAL,
	timersOpt ...ConsensusTimers,
) chain.Consensus

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
	SigShareOfStateOutputID tbls.SigShare
}

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 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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL