iconsensus

package
v0.0.0-...-4f0ab6e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CEShardStateListener

type CEShardStateListener interface {
	OnShardDisabled()
}

CEShardStateListener is used to control the status of consensus.

type Consensus

type Consensus interface {
	// StartConsensusAtRound means set the consensus start at the round;
	StartConsensusAtRound(round int)
	// StopConsensusAtRound means when shard needs to be disabled, stop the consensus firstly
	StopConsensusAtRound(round int)
	// todo(MH): maybe remove
	// UpdateInShardProof will update consensusExecutor.inshardProof, it will be safe in concurrent.
	UpdateInShardProof(inShardProof []byte)
	// RegisterCEListener adds a listener to shardStateListeners
	RegisterCEShardStateListener(listener CEShardStateListener)

	Init()
	Start()
}

Consensus is the consensus engine

type DepositFetcher

type DepositFetcher interface {
	GetDepositUnit(pk []byte, round int32, index shard.Index) uint32
}

DepositFetcher get deposited information.

type Sortitionor

type Sortitionor interface {
	IsLeader(seed []byte, index shard.Index) bool
	IsInShard(proof []byte, depositUnit uint32, index shard.Index) bool
	SetLeaderRate(n int, index shard.Index)
}

Sortitionor use to elect potential leaders.

Jump to

Keyboard shortcuts

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