builder

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEndOfTime       = errors.New("program time is suspiciously far in the future")
	ErrNoPendingBlocks = errors.New("no pending blocks")
)

Functions

func NewRewardValidatorTx

func NewRewardValidatorTx(ctx context.Context, txCodec txs.Codec, txID ids.ID) (*txs.Tx, error)

NewRewardValidatorTx builds and signs the well-known RewardValidatorTx. The txCodec is the proto/p/txs wire codec used to marshal the unsigned tx for signature; callers thread it in from their PVM bundle (the codec sits on the block executor Manager via BlockCodec() since the block codec instance also has every tx type registered through txs.RegisterTypes).

Types

type Builder

type Builder interface {
	mempool.Mempool[*txs.Tx]

	// BuildBlock can be called to attempt to create a new block
	BuildBlock(context.Context) (chainblock.Block, error)

	// BuildBlockWithContext builds a block with context
	BuildBlockWithContext(context.Context, *chainblock.Context) (chainblock.Block, error)

	// Connected is called when a node connects
	Connected(context.Context, ids.NodeID, interface{}) error

	// Disconnected is called when a node disconnects
	Disconnected(context.Context, ids.NodeID) error

	// PackAllBlockTxs returns an array of all txs that could be packed into a
	// valid block of infinite size. The returned txs are all verified against
	// the preferred state.
	//
	// Note: This function does not call the consensus engine.
	PackAllBlockTxs() ([]*txs.Tx, error)
}

func New

func New(
	mempool mempool.Mempool[*txs.Tx],
	txExecutorBackend *txexecutor.Backend,
	blkManager blockexecutor.Manager,
) Builder

Jump to

Keyboard shortcuts

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