snowman

package
v1.9.10-rc.9 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AncestorTree

type AncestorTree interface {
	Add(blkID ids.ID, parentID ids.ID)
	Has(blkID ids.ID) bool
	GetRoot(blkID ids.ID) ids.ID
	Remove(blkID ids.ID)
	RemoveSubtree(blkID ids.ID)
	Len() int
}

func NewAncestorTree

func NewAncestorTree() AncestorTree

type Config

type Config struct {
	common.AllGetsServer

	Ctx        *snow.ConsensusContext
	VM         block.ChainVM
	Sender     common.Sender
	Validators validators.Set
	Params     snowball.Parameters
	Consensus  snowman.Consensus
}

Config wraps all the parameters needed for a snowman engine

type Engine

type Engine interface {
	common.Engine
	block.Getter
}

Engine describes the events that can occur to a Snowman instance.

The engine is used to fetch, order, and decide on the fate of blocks. This engine runs the leaderless version of the Snowman consensus protocol. Therefore, the liveness of this protocol tolerant to O(sqrt(n)) Byzantine Nodes where n is the number of nodes in the network. Therefore, this protocol should only be run in a Crash Fault Tolerant environment, or in an environment where lose of liveness and manual intervention is tolerable.

func New

func New(config Config) (Engine, error)

func TraceEngine added in v1.9.2

func TraceEngine(engine Engine, tracer trace.Tracer) Engine

type EngineTest

type EngineTest struct {
	common.EngineTest

	CantGetBlock bool
	GetBlockF    func(context.Context, ids.ID) (snowman.Block, error)
}

EngineTest is a test engine

func (*EngineTest) Default

func (e *EngineTest) Default(cant bool)

func (*EngineTest) GetBlock

func (e *EngineTest) GetBlock(ctx context.Context, blkID ids.ID) (snowman.Block, error)

type Transitive

type Transitive struct {
	Config

	// list of NoOpsHandler for messages dropped by engine
	common.StateSummaryFrontierHandler
	common.AcceptedStateSummaryHandler
	common.AcceptedFrontierHandler
	common.AcceptedHandler
	common.AncestorsHandler
	common.AppHandler
	validators.Connector

	RequestID uint32
	// contains filtered or unexported fields
}

Transitive implements the Engine interface by attempting to fetch all Transitive dependencies.

func (*Transitive) Chits

func (t *Transitive) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, votes []ids.ID, accepted []ids.ID) error

func (*Transitive) Context

func (t *Transitive) Context() *snow.ConsensusContext

func (*Transitive) GetBlock

func (t *Transitive) GetBlock(ctx context.Context, blkID ids.ID) (snowman.Block, error)

func (*Transitive) GetFailed

func (t *Transitive) GetFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error

func (*Transitive) GetVM

func (t *Transitive) GetVM() common.VM

func (*Transitive) Gossip

func (t *Transitive) Gossip(ctx context.Context) error

func (*Transitive) Halt

func (*Transitive) Halt(context.Context)

func (*Transitive) HealthCheck

func (t *Transitive) HealthCheck(ctx context.Context) (interface{}, error)

func (*Transitive) Initialize

func (m *Transitive) Initialize(namespace string, reg prometheus.Registerer) error

Initialize the metrics

func (*Transitive) Notify

func (t *Transitive) Notify(ctx context.Context, msg common.Message) error

func (*Transitive) PullQuery

func (t *Transitive) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, blkID ids.ID) error

func (*Transitive) PushQuery

func (t *Transitive) PushQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, blkBytes []byte) error

func (*Transitive) Put

func (t *Transitive) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, blkBytes []byte) error

func (*Transitive) QueryFailed

func (t *Transitive) QueryFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error

func (*Transitive) Shutdown

func (t *Transitive) Shutdown(ctx context.Context) error

func (*Transitive) Start

func (t *Transitive) Start(ctx context.Context, startReqID uint32) error

func (*Transitive) Timeout

func (*Transitive) Timeout(context.Context) error

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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