snowman

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Overview

Package snowman is a generated GoMock package.

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

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 MockEngine

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

MockEngine is a mock of Engine interface.

func NewMockEngine

func NewMockEngine(ctrl *gomock.Controller) *MockEngine

NewMockEngine creates a new mock instance.

func (*MockEngine) Accepted

func (m *MockEngine) Accepted(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []ids.ID) error

Accepted mocks base method.

func (*MockEngine) AcceptedFrontier

func (m *MockEngine) AcceptedFrontier(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []ids.ID) error

AcceptedFrontier mocks base method.

func (*MockEngine) AcceptedStateSummary

func (m *MockEngine) AcceptedStateSummary(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []ids.ID) error

AcceptedStateSummary mocks base method.

func (*MockEngine) Ancestors

func (m *MockEngine) Ancestors(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 [][]byte) error

Ancestors mocks base method.

func (*MockEngine) AppGossip

func (m *MockEngine) AppGossip(arg0 context.Context, arg1 ids.NodeID, arg2 []byte) error

AppGossip mocks base method.

func (*MockEngine) AppRequest

func (m *MockEngine) AppRequest(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 time.Time, arg4 []byte) error

AppRequest mocks base method.

func (*MockEngine) AppRequestFailed

func (m *MockEngine) AppRequestFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

AppRequestFailed mocks base method.

func (*MockEngine) AppResponse

func (m *MockEngine) AppResponse(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []byte) error

AppResponse mocks base method.

func (*MockEngine) Chits

func (m *MockEngine) Chits(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []ids.ID) error

Chits mocks base method.

func (*MockEngine) Connected

func (m *MockEngine) Connected(arg0 context.Context, arg1 ids.NodeID, arg2 *version.Application) error

Connected mocks base method.

func (*MockEngine) Context

func (m *MockEngine) Context() *snow.ConsensusContext

Context mocks base method.

func (*MockEngine) CrossChainAppRequest

func (m *MockEngine) CrossChainAppRequest(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 time.Time, arg4 []byte) error

CrossChainAppRequest mocks base method.

func (*MockEngine) CrossChainAppRequestFailed

func (m *MockEngine) CrossChainAppRequestFailed(arg0 context.Context, arg1 ids.ID, arg2 uint32) error

CrossChainAppRequestFailed mocks base method.

func (*MockEngine) CrossChainAppResponse

func (m *MockEngine) CrossChainAppResponse(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 []byte) error

CrossChainAppResponse mocks base method.

func (*MockEngine) Disconnected

func (m *MockEngine) Disconnected(arg0 context.Context, arg1 ids.NodeID) error

Disconnected mocks base method.

func (*MockEngine) EXPECT

func (m *MockEngine) EXPECT() *MockEngineMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEngine) Get

func (m *MockEngine) Get(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 ids.ID) error

Get mocks base method.

func (*MockEngine) GetAccepted

func (m *MockEngine) GetAccepted(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []ids.ID) error

GetAccepted mocks base method.

func (*MockEngine) GetAcceptedFailed

func (m *MockEngine) GetAcceptedFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

GetAcceptedFailed mocks base method.

func (*MockEngine) GetAcceptedFrontier

func (m *MockEngine) GetAcceptedFrontier(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

GetAcceptedFrontier mocks base method.

func (*MockEngine) GetAcceptedFrontierFailed

func (m *MockEngine) GetAcceptedFrontierFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

GetAcceptedFrontierFailed mocks base method.

func (*MockEngine) GetAcceptedStateSummary

func (m *MockEngine) GetAcceptedStateSummary(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []uint64) error

GetAcceptedStateSummary mocks base method.

func (*MockEngine) GetAcceptedStateSummaryFailed

func (m *MockEngine) GetAcceptedStateSummaryFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

GetAcceptedStateSummaryFailed mocks base method.

func (*MockEngine) GetAncestors

func (m *MockEngine) GetAncestors(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 ids.ID) error

GetAncestors mocks base method.

func (*MockEngine) GetAncestorsFailed

func (m *MockEngine) GetAncestorsFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

GetAncestorsFailed mocks base method.

func (*MockEngine) GetBlock

func (m *MockEngine) GetBlock(arg0 context.Context, arg1 ids.ID) (snowman.Block, error)

GetBlock mocks base method.

func (*MockEngine) GetFailed

func (m *MockEngine) GetFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

GetFailed mocks base method.

func (*MockEngine) GetStateSummaryFrontier

func (m *MockEngine) GetStateSummaryFrontier(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

GetStateSummaryFrontier mocks base method.

func (*MockEngine) GetStateSummaryFrontierFailed

func (m *MockEngine) GetStateSummaryFrontierFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

GetStateSummaryFrontierFailed mocks base method.

func (*MockEngine) GetVM

func (m *MockEngine) GetVM() common.VM

GetVM mocks base method.

func (*MockEngine) Gossip

func (m *MockEngine) Gossip(arg0 context.Context) error

Gossip mocks base method.

func (*MockEngine) Halt

func (m *MockEngine) Halt(arg0 context.Context)

Halt mocks base method.

func (*MockEngine) HealthCheck

func (m *MockEngine) HealthCheck(arg0 context.Context) (interface{}, error)

HealthCheck mocks base method.

func (*MockEngine) Notify

func (m *MockEngine) Notify(arg0 context.Context, arg1 common.Message) error

Notify mocks base method.

func (*MockEngine) PullQuery

func (m *MockEngine) PullQuery(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 ids.ID) error

PullQuery mocks base method.

func (*MockEngine) PushQuery

func (m *MockEngine) PushQuery(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []byte) error

PushQuery mocks base method.

func (*MockEngine) Put

func (m *MockEngine) Put(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []byte) error

Put mocks base method.

func (*MockEngine) QueryFailed

func (m *MockEngine) QueryFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32) error

QueryFailed mocks base method.

func (*MockEngine) Shutdown

func (m *MockEngine) Shutdown(arg0 context.Context) error

Shutdown mocks base method.

func (*MockEngine) Start

func (m *MockEngine) Start(arg0 context.Context, arg1 uint32) error

Start mocks base method.

func (*MockEngine) StateSummaryFrontier

func (m *MockEngine) StateSummaryFrontier(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []byte) error

StateSummaryFrontier mocks base method.

func (*MockEngine) Timeout

func (m *MockEngine) Timeout(arg0 context.Context) error

Timeout mocks base method.

type MockEngineMockRecorder

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

MockEngineMockRecorder is the mock recorder for MockEngine.

func (*MockEngineMockRecorder) Accepted

func (mr *MockEngineMockRecorder) Accepted(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Accepted indicates an expected call of Accepted.

func (*MockEngineMockRecorder) AcceptedFrontier

func (mr *MockEngineMockRecorder) AcceptedFrontier(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

AcceptedFrontier indicates an expected call of AcceptedFrontier.

func (*MockEngineMockRecorder) AcceptedStateSummary

func (mr *MockEngineMockRecorder) AcceptedStateSummary(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

AcceptedStateSummary indicates an expected call of AcceptedStateSummary.

func (*MockEngineMockRecorder) Ancestors

func (mr *MockEngineMockRecorder) Ancestors(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Ancestors indicates an expected call of Ancestors.

func (*MockEngineMockRecorder) AppGossip

func (mr *MockEngineMockRecorder) AppGossip(arg0, arg1, arg2 interface{}) *gomock.Call

AppGossip indicates an expected call of AppGossip.

func (*MockEngineMockRecorder) AppRequest

func (mr *MockEngineMockRecorder) AppRequest(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

AppRequest indicates an expected call of AppRequest.

func (*MockEngineMockRecorder) AppRequestFailed

func (mr *MockEngineMockRecorder) AppRequestFailed(arg0, arg1, arg2 interface{}) *gomock.Call

AppRequestFailed indicates an expected call of AppRequestFailed.

func (*MockEngineMockRecorder) AppResponse

func (mr *MockEngineMockRecorder) AppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

AppResponse indicates an expected call of AppResponse.

func (*MockEngineMockRecorder) Chits

func (mr *MockEngineMockRecorder) Chits(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Chits indicates an expected call of Chits.

func (*MockEngineMockRecorder) Connected

func (mr *MockEngineMockRecorder) Connected(arg0, arg1, arg2 interface{}) *gomock.Call

Connected indicates an expected call of Connected.

func (*MockEngineMockRecorder) Context

func (mr *MockEngineMockRecorder) Context() *gomock.Call

Context indicates an expected call of Context.

func (*MockEngineMockRecorder) CrossChainAppRequest

func (mr *MockEngineMockRecorder) CrossChainAppRequest(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

CrossChainAppRequest indicates an expected call of CrossChainAppRequest.

func (*MockEngineMockRecorder) CrossChainAppRequestFailed

func (mr *MockEngineMockRecorder) CrossChainAppRequestFailed(arg0, arg1, arg2 interface{}) *gomock.Call

CrossChainAppRequestFailed indicates an expected call of CrossChainAppRequestFailed.

func (*MockEngineMockRecorder) CrossChainAppResponse

func (mr *MockEngineMockRecorder) CrossChainAppResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

CrossChainAppResponse indicates an expected call of CrossChainAppResponse.

func (*MockEngineMockRecorder) Disconnected

func (mr *MockEngineMockRecorder) Disconnected(arg0, arg1 interface{}) *gomock.Call

Disconnected indicates an expected call of Disconnected.

func (*MockEngineMockRecorder) Get

func (mr *MockEngineMockRecorder) Get(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockEngineMockRecorder) GetAccepted

func (mr *MockEngineMockRecorder) GetAccepted(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

GetAccepted indicates an expected call of GetAccepted.

func (*MockEngineMockRecorder) GetAcceptedFailed

func (mr *MockEngineMockRecorder) GetAcceptedFailed(arg0, arg1, arg2 interface{}) *gomock.Call

GetAcceptedFailed indicates an expected call of GetAcceptedFailed.

func (*MockEngineMockRecorder) GetAcceptedFrontier

func (mr *MockEngineMockRecorder) GetAcceptedFrontier(arg0, arg1, arg2 interface{}) *gomock.Call

GetAcceptedFrontier indicates an expected call of GetAcceptedFrontier.

func (*MockEngineMockRecorder) GetAcceptedFrontierFailed

func (mr *MockEngineMockRecorder) GetAcceptedFrontierFailed(arg0, arg1, arg2 interface{}) *gomock.Call

GetAcceptedFrontierFailed indicates an expected call of GetAcceptedFrontierFailed.

func (*MockEngineMockRecorder) GetAcceptedStateSummary

func (mr *MockEngineMockRecorder) GetAcceptedStateSummary(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

GetAcceptedStateSummary indicates an expected call of GetAcceptedStateSummary.

func (*MockEngineMockRecorder) GetAcceptedStateSummaryFailed

func (mr *MockEngineMockRecorder) GetAcceptedStateSummaryFailed(arg0, arg1, arg2 interface{}) *gomock.Call

GetAcceptedStateSummaryFailed indicates an expected call of GetAcceptedStateSummaryFailed.

func (*MockEngineMockRecorder) GetAncestors

func (mr *MockEngineMockRecorder) GetAncestors(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

GetAncestors indicates an expected call of GetAncestors.

func (*MockEngineMockRecorder) GetAncestorsFailed

func (mr *MockEngineMockRecorder) GetAncestorsFailed(arg0, arg1, arg2 interface{}) *gomock.Call

GetAncestorsFailed indicates an expected call of GetAncestorsFailed.

func (*MockEngineMockRecorder) GetBlock

func (mr *MockEngineMockRecorder) GetBlock(arg0, arg1 interface{}) *gomock.Call

GetBlock indicates an expected call of GetBlock.

func (*MockEngineMockRecorder) GetFailed

func (mr *MockEngineMockRecorder) GetFailed(arg0, arg1, arg2 interface{}) *gomock.Call

GetFailed indicates an expected call of GetFailed.

func (*MockEngineMockRecorder) GetStateSummaryFrontier

func (mr *MockEngineMockRecorder) GetStateSummaryFrontier(arg0, arg1, arg2 interface{}) *gomock.Call

GetStateSummaryFrontier indicates an expected call of GetStateSummaryFrontier.

func (*MockEngineMockRecorder) GetStateSummaryFrontierFailed

func (mr *MockEngineMockRecorder) GetStateSummaryFrontierFailed(arg0, arg1, arg2 interface{}) *gomock.Call

GetStateSummaryFrontierFailed indicates an expected call of GetStateSummaryFrontierFailed.

func (*MockEngineMockRecorder) GetVM

func (mr *MockEngineMockRecorder) GetVM() *gomock.Call

GetVM indicates an expected call of GetVM.

func (*MockEngineMockRecorder) Gossip

func (mr *MockEngineMockRecorder) Gossip(arg0 interface{}) *gomock.Call

Gossip indicates an expected call of Gossip.

func (*MockEngineMockRecorder) Halt

func (mr *MockEngineMockRecorder) Halt(arg0 interface{}) *gomock.Call

Halt indicates an expected call of Halt.

func (*MockEngineMockRecorder) HealthCheck

func (mr *MockEngineMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call

HealthCheck indicates an expected call of HealthCheck.

func (*MockEngineMockRecorder) Notify

func (mr *MockEngineMockRecorder) Notify(arg0, arg1 interface{}) *gomock.Call

Notify indicates an expected call of Notify.

func (*MockEngineMockRecorder) PullQuery

func (mr *MockEngineMockRecorder) PullQuery(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

PullQuery indicates an expected call of PullQuery.

func (*MockEngineMockRecorder) PushQuery

func (mr *MockEngineMockRecorder) PushQuery(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

PushQuery indicates an expected call of PushQuery.

func (*MockEngineMockRecorder) Put

func (mr *MockEngineMockRecorder) Put(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Put indicates an expected call of Put.

func (*MockEngineMockRecorder) QueryFailed

func (mr *MockEngineMockRecorder) QueryFailed(arg0, arg1, arg2 interface{}) *gomock.Call

QueryFailed indicates an expected call of QueryFailed.

func (*MockEngineMockRecorder) Shutdown

func (mr *MockEngineMockRecorder) Shutdown(arg0 interface{}) *gomock.Call

Shutdown indicates an expected call of Shutdown.

func (*MockEngineMockRecorder) Start

func (mr *MockEngineMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call

Start indicates an expected call of Start.

func (*MockEngineMockRecorder) StateSummaryFrontier

func (mr *MockEngineMockRecorder) StateSummaryFrontier(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

StateSummaryFrontier indicates an expected call of StateSummaryFrontier.

func (*MockEngineMockRecorder) Timeout

func (mr *MockEngineMockRecorder) Timeout(arg0 interface{}) *gomock.Call

Timeout indicates an expected call of Timeout.

type Transitive

type Transitive struct {
	Config

	// list of NoOpsHandler for messages dropped by engine
	common.StateSummaryFrontierHandler
	common.AcceptedStateSummaryHandler
	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

func (t *Transitive) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error

func (*Transitive) AppRequest

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

func (*Transitive) AppRequestFailed

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

func (*Transitive) AppResponse

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

func (*Transitive) Chits

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

func (*Transitive) Connected

func (t *Transitive) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error

func (*Transitive) Context

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

func (*Transitive) CrossChainAppRequest

func (t *Transitive) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, request []byte) error

func (*Transitive) CrossChainAppRequestFailed

func (t *Transitive) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32) error

func (*Transitive) CrossChainAppResponse

func (t *Transitive) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, response []byte) error

func (*Transitive) Disconnected

func (t *Transitive) Disconnected(ctx context.Context, nodeID ids.NodeID) error

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