consensus

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0, BSD-2-Clause Imports: 36 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 mempool_pkg.Mempool,
	committee chain.Committee,
	peerGroup peering.GroupProvider,
	pullMissingRequestsFromCommittee bool,
	consensusMetrics metrics.ConsensusMetrics,
	dssNode dss_node.DSSNode,
	consensusJournal journal.ConsensusJournal,
	wal chain.WAL,
	publishTx func(chainID *isc.ChainID, tx *iotago.Transaction) error,
	timersOpt ...ConsensusTimers,
) chain.Consensus

Types

type BatchProposal added in v0.2.0

type BatchProposal struct {
	ValidatorIndex          uint16
	StateOutputID           *iotago.UTXOInput
	RequestIDs              []isc.RequestID
	RequestHashes           [][32]byte
	TimeData                time.Time
	ConsensusManaPledge     identity.ID
	AccessManaPledge        identity.ID
	FeeDestination          isc.AgentID
	SigShareOfStateOutputID tbls.SigShare
	DSSNonceIndexProposal   util.BitVector
}

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 []isc.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 IscBatchTimestamp.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