consensus

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: LGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxStoredAvgTimeDiffs = 20
)

Variables

View Source
var (
	ForkDetected = errors.New("fork is detected")
)

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(chain *blockchain.Blockchain, gossipHandler *protocol.IdenaGossipHandler, proposals *pengings.Proposals, config *config.Config,
	appState *appstate.AppState,
	votes *pengings.Votes,
	txpool *mempool.TxPool, secStore *secstore.SecStore, downloader *protocol.Downloader,
	offlineDetector *blockchain.OfflineDetector,
	upgrader *upgrade.Upgrader,
	ipfsProxy ipfs.Proxy,
	eventBus eventbus.Bus,
	statsCollector collector.StatsCollector) *Engine

func (*Engine) AppStateForCheck added in v0.24.0

func (engine *Engine) AppStateForCheck() (*appstate.AppState, error)

func (*Engine) GetProcess

func (engine *Engine) GetProcess() string

func (*Engine) ReadonlyAppState

func (engine *Engine) ReadonlyAppState() (*appstate.AppState, error)

func (*Engine) Start

func (engine *Engine) Start()

func (*Engine) Synced

func (engine *Engine) Synced() bool

type ForkDetector

type ForkDetector interface {
	HasPotentialFork() bool
	GetForkedPeers() mapset.Set
	ClearPotentialForks()
}

type ForkResolver

type ForkResolver struct {
	// contains filtered or unexported fields
}

func NewForkResolver

func NewForkResolver(forkDetectors []ForkDetector, downloader *protocol.Downloader, chain *blockchain.Blockchain,
	statsCollector collector.StatsCollector) *ForkResolver

func (*ForkResolver) ApplyFork

func (resolver *ForkResolver) ApplyFork() (revertedTxs []*types.Transaction, err error)

func (*ForkResolver) HasLoadedFork

func (resolver *ForkResolver) HasLoadedFork() bool

func (*ForkResolver) Start

func (resolver *ForkResolver) Start()

type ForwardPeersProvider

type ForwardPeersProvider interface {
	PotentialForwardPeers(round uint64) []peer.ID
	PeerHeights() []uint64
}

Jump to

Keyboard shortcuts

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