snowman

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: BSD-3-Clause Imports: 18 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AncestorTree added in v1.6.4

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 added in v1.6.4

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 added in v1.7.4

func New(config Config) (Engine, error)

type EngineTest added in v1.7.5

type EngineTest struct {
	common.EngineTest

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

EngineTest is a test engine

func (*EngineTest) Default added in v1.7.5

func (e *EngineTest) Default(cant bool)

func (*EngineTest) GetBlock added in v1.7.5

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

type Transitive

type Transitive struct {
	Config

	// list of NoOpsHandler for messages dropped by engine
	common.AcceptedFrontierHandler
	common.AcceptedHandler
	common.AncestorsHandler

	RequestID uint32
	// contains filtered or unexported fields
}

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

func (*Transitive) AppGossip added in v1.5.3

func (t *Transitive) AppGossip(nodeID ids.ShortID, msg []byte) error

AppGossip implements the AppHandler interface

func (*Transitive) AppRequest added in v1.5.3

func (t *Transitive) AppRequest(nodeID ids.ShortID, requestID uint32, deadline time.Time, request []byte) error

AppRequest implements the AppHandler interface

func (*Transitive) AppRequestFailed added in v1.5.3

func (t *Transitive) AppRequestFailed(nodeID ids.ShortID, requestID uint32) error

AppRequestFailed implements the AppHandler interface

func (*Transitive) AppResponse added in v1.5.3

func (t *Transitive) AppResponse(nodeID ids.ShortID, requestID uint32, response []byte) error

AppResponse implements the AppHandler interface

func (*Transitive) Chits

func (t *Transitive) Chits(vdr ids.ShortID, requestID uint32, votes []ids.ID) error

Chits implements the ChitsHandler interface

func (*Transitive) Connected added in v1.7.4

func (t *Transitive) Connected(nodeID ids.ShortID, nodeVersion version.Application) error

Connected implements the InternalHandler interface.

func (*Transitive) Context

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

Context implements the common.Engine interface.

func (*Transitive) Disconnected added in v1.7.4

func (t *Transitive) Disconnected(nodeID ids.ShortID) error

Disconnected implements the InternalHandler interface.

func (*Transitive) GetBlock added in v1.3.2

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

GetBlock implements the snowman.Getter interface.

func (*Transitive) GetFailed

func (t *Transitive) GetFailed(vdr ids.ShortID, requestID uint32) error

GetFailed implements the PutHandler interface

func (*Transitive) GetVM added in v1.3.2

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

GetVM implements the common.Engine interface.

func (*Transitive) Gossip added in v0.8.0

func (t *Transitive) Gossip() error

Gossip implements the InternalHandler interface

func (*Transitive) Halt added in v1.7.4

func (t *Transitive) Halt()

Halt implements the InternalHandler interface

func (*Transitive) HealthCheck added in v1.2.1

func (t *Transitive) HealthCheck() (interface{}, error)

HealthCheck implements the common.Engine interface.

func (*Transitive) Initialize

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

Initialize the metrics

func (*Transitive) Notify

func (t *Transitive) Notify(msg common.Message) error

Notify implements the InternalHandler interface

func (*Transitive) PullQuery

func (t *Transitive) PullQuery(vdr ids.ShortID, requestID uint32, blkID ids.ID) error

PullQuery implements the QueryHandler interface

func (*Transitive) PushQuery

func (t *Transitive) PushQuery(vdr ids.ShortID, requestID uint32, blkBytes []byte) error

PushQuery implements the QueryHandler interface

func (*Transitive) Put

func (t *Transitive) Put(vdr ids.ShortID, requestID uint32, blkBytes []byte) error

Put implements the PutHandler interface

func (*Transitive) QueryFailed

func (t *Transitive) QueryFailed(vdr ids.ShortID, requestID uint32) error

QueryFailed implements the ChitsHandler interface

func (*Transitive) Shutdown

func (t *Transitive) Shutdown() error

Shutdown implements the InternalHandler interface

func (*Transitive) Start added in v1.7.4

func (t *Transitive) Start(startReqID uint32) error

Start implements the common.Engine interface.

func (*Transitive) Timeout added in v1.7.4

func (t *Transitive) Timeout() error

Timeout implements the InternalHandler interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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