bootstrap

package
v1.22.46 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocker added in v1.22.46

type Blocker interface {
	// Register registers a job to be unblocked
	Register(ctx context.Context, id ids.ID) (bool, error)

	// PushJob pushes a job to be processed
	PushJob(ctx context.Context, id ids.ID) error

	// Unblock marks a job as unblocked
	Unblock(ctx context.Context, id ids.ID) error

	// Clear clears all blocked jobs
	Clear()
}

Blocker blocks/unblocks processing

type BootstrapableEngine added in v1.22.46

type BootstrapableEngine interface {
	// Start starts the engine
	Start(ctx context.Context, startReqID uint32) error

	// HealthCheck checks engine health
	HealthCheck(ctx context.Context) (interface{}, error)

	// Shutdown shuts down the engine
	Shutdown(ctx context.Context) error

	// IsBootstrapped returns whether bootstrapping is complete
	IsBootstrapped() bool
}

BootstrapableEngine is an engine that can be bootstrapped

type Bootstrapper

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

Bootstrapper bootstraps a DAG chain

func New

func New(config Config, onFinished func(ctx context.Context, lastReqID uint32) error) (*Bootstrapper, error)

New creates a new DAG bootstrapper

func Trace added in v1.22.46

func Trace(b *Bootstrapper, tracer interface{}) *Bootstrapper

Trace wraps a bootstrapper with tracing

func (*Bootstrapper) Ancestors added in v1.22.46

func (b *Bootstrapper) Ancestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error

Ancestors handles received ancestors

func (*Bootstrapper) Chits added in v1.22.46

func (b *Bootstrapper) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, preferredIDAtHeight ids.ID, acceptedID ids.ID) error

Chits handles chit messages

func (*Bootstrapper) Connected

func (b *Bootstrapper) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion string) error

Connected handles peer connection

func (*Bootstrapper) Disconnected

func (b *Bootstrapper) Disconnected(ctx context.Context, nodeID ids.NodeID) error

Disconnected handles peer disconnection

func (*Bootstrapper) GetAncestors added in v1.22.46

func (b *Bootstrapper) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error

GetAncestors handles ancestor requests

func (*Bootstrapper) GetFailed added in v1.22.46

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

GetFailed handles a failed get request

func (*Bootstrapper) HealthCheck

func (b *Bootstrapper) HealthCheck(ctx context.Context) (interface{}, error)

HealthCheck returns health information

func (*Bootstrapper) IsBootstrapped added in v1.22.46

func (b *Bootstrapper) IsBootstrapped() bool

IsBootstrapped returns whether bootstrapping is complete

func (*Bootstrapper) PullQuery added in v1.22.46

func (b *Bootstrapper) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error

PullQuery handles pull query

func (*Bootstrapper) PushQuery added in v1.22.46

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

PushQuery handles push query

func (*Bootstrapper) Put added in v1.22.46

func (b *Bootstrapper) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxBytes []byte) error

Put handles vertex put

func (*Bootstrapper) QueryFailed added in v1.22.46

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

QueryFailed handles query failure

func (*Bootstrapper) Shutdown added in v1.22.46

func (b *Bootstrapper) Shutdown(ctx context.Context) error

Shutdown shuts down the bootstrapper

func (*Bootstrapper) Start

func (b *Bootstrapper) Start(ctx context.Context, startReqID uint32) error

Start starts the bootstrapping process

type Config added in v1.22.46

type Config struct {
	// AllGetsServer handles ancestor fetching
	AllGetsServer getter.Handler

	// Ctx is the consensus context
	Ctx context.Context

	// Beacons are the validators used for bootstrapping
	Beacons interface {
		TotalWeight(netID ids.ID) (uint64, error)
	}

	// StartupTracker tracks startup progress
	StartupTracker interface {
		ShouldStart() bool
	}

	// Sender sends messages to peers
	Sender interface {
		SendGetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error
	}

	// AncestorsMaxContainersReceived limits the number of containers received
	AncestorsMaxContainersReceived int

	// VtxBlocked is the blocker for vertex processing
	VtxBlocked Blocker

	// TxBlocked is the blocker for transaction processing
	TxBlocked Blocker

	// Manager manages vertex state
	Manager state.Manager

	// VM is the linearizable DAG VM
	VM LinearizableVM

	// Haltable provides halt functionality
	Haltable Halter

	// StopVertexID is an optional vertex ID to stop at (for upgrades)
	StopVertexID ids.ID
}

Config configures the DAG bootstrapper

type Halter added in v1.22.46

type Halter interface {
	// Halt stops execution
	Halt(ctx context.Context)

	// Halted returns whether halted
	Halted() bool
}

Halter can halt execution

type LinearizableVM added in v1.22.46

type LinearizableVM interface {
	// Linearize converts DAG to linear chain
	Linearize(ctx context.Context, stopVertexID ids.ID) error

	// ParseVtx parses a vertex from bytes
	ParseVtx(ctx context.Context, bytes []byte) (state.Vertex, error)
}

LinearizableVM is a DAG VM that can be linearized

Directories

Path Synopsis
Package queue provides a simple blocking queue for DAG bootstrap
Package queue provides a simple blocking queue for DAG bootstrap

Jump to

Keyboard shortcuts

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