Help us shape the future of Go! Take the 2026 Go Developer Survey

builder

package
v1.16.17 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: BSD-3-Clause Imports: 18 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, txID ids.ID) (*txs.Tx, error)

Types

type Builder

type Builder interface {
	mempool.Mempool

	// StartBlockTimer starts to issue block creation requests to advance the
	// chain timestamp.
	StartBlockTimer()

	// ResetBlockTimer forces the block timer to recalculate when it should
	// advance the chain timestamp.
	ResetBlockTimer()

	// ShutdownBlockTimer stops block creation requests to advance the chain
	// timestamp.
	//
	// Invariant: Assumes the context lock is held when calling.
	ShutdownBlockTimer()

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

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

func New

func New(
	mempool mempool.Mempool,
	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