avalanche

package
v0.0.0-...-897bf55 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: BSD-3-Clause Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package avalanche is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Ctx *snow.ConsensusContext
	common.AllGetsServer
	VM         vertex.DAGVM
	Manager    vertex.Manager
	Sender     common.Sender
	Validators validators.Set

	Params    avalanche.Parameters
	Consensus avalanche.Consensus
}

Config wraps all the parameters needed for an avalanche engine

type Engine

type Engine interface {
	common.Engine

	// GetVtx returns a vertex by its ID.
	// Returns an error if unknown.
	GetVtx(ctx context.Context, vtxID ids.ID) (avalanche.Vertex, error)
}

Engine describes the events that can occur on a consensus instance

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

	CantGetVtx bool
	GetVtxF    func(ctx context.Context, vtxID ids.ID) (avalanche.Vertex, error)
}

EngineTest is a test engine

func (*EngineTest) Default

func (e *EngineTest) Default(cant bool)

func (*EngineTest) GetVtx

func (e *EngineTest) GetVtx(ctx context.Context, vtxID ids.ID) (avalanche.Vertex, 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) 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) GetVtx

func (m *MockEngine) GetVtx(arg0 context.Context, arg1 ids.ID) (avalanche.Vertex, error)

GetVtx 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) 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) GetVtx

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

GetVtx indicates an expected call of GetVtx.

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) 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) GetVtx

func (t *Transitive) GetVtx(ctx context.Context, vtxID ids.ID) (avalanche.Vertex, error)

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

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, vtxID ids.ID) error

func (*Transitive) PushQuery

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

func (*Transitive) Put

func (t *Transitive) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxBytes []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
Package state manages the meta-data required by consensus for an avalanche dag.
Package state manages the meta-data required by consensus for an avalanche dag.
Package vertex is a generated GoMock package.
Package vertex is a generated GoMock package.

Jump to

Keyboard shortcuts

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