snowman

package
v0.0.0-...-7be9c83 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: BSD-3-Clause Imports: 16 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 {
	bootstrap.Config

	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

	// Initialize this engine.
	Initialize(Config) error
}

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.

type Transitive

type Transitive struct {
	bootstrap.Bootstrapper

	Params    snowball.Parameters
	Consensus snowman.Consensus
	// contains filtered or unexported fields
}

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

func (*Transitive) AppGossip

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

AppGossip implements the Engine interface

func (*Transitive) AppRequest

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

AppRequest implements the Engine interface

func (*Transitive) AppRequestFailed

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

AppRequestFailed implements the Engine interface

func (*Transitive) AppResponse

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

AppResponse implements the Engine interface

func (*Transitive) Chits

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

Chits implements the Engine interface

func (*Transitive) Get

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

Get implements the Engine interface

func (*Transitive) GetAncestors

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

GetAncestors implements the Engine interface

func (*Transitive) GetBlock

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

GetBlock implements the snowman.Engine interface

func (*Transitive) GetFailed

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

GetFailed implements the Engine interface

func (*Transitive) GetVM

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

GetVM implements the snowman.Engine interface

func (*Transitive) Gossip

func (t *Transitive) Gossip() error

Gossip implements the Engine interface

func (*Transitive) HealthCheck

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

HealthCheck implements the common.Engine interface

func (*Transitive) Initialize

func (t *Transitive) Initialize(config Config) error

Initialize implements the Engine interface

func (*Transitive) IsBootstrapped

func (t *Transitive) IsBootstrapped() bool

IsBootstrapped returns true iff this chain is done bootstrapping

func (*Transitive) Notify

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

Notify implements the Engine interface

func (*Transitive) PullQuery

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

PullQuery implements the Engine interface

func (*Transitive) PushQuery

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

PushQuery implements the Engine interface

func (*Transitive) Put

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

Put implements the Engine interface

func (*Transitive) QueryFailed

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

QueryFailed implements the Engine interface

func (*Transitive) Shutdown

func (t *Transitive) Shutdown() error

Shutdown implements the Engine interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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