miner

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package miner is responsible for creating valid blocks that contain valid activation transactions and transactions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveSetFromEpochFirstBlock added in v1.0.8

func ActiveSetFromEpochFirstBlock(db sql.Executor, epoch types.EpochID) ([]types.ATXID, error)

Types

type ActiveSetPreparation added in v1.4.3

type ActiveSetPreparation struct {
	// Window describes how much in advance the active set should be prepared.
	Window time.Duration `mapstructure:"window"`
	// RetryInterval describes how often the active set is retried.
	RetryInterval time.Duration `mapstructure:"retry-interval"`
	// Tries describes how many times the active set is retried.
	Tries int `mapstructure:"tries"`
}

ActiveSetPreparation is a configuration to enable computation of activeset in advance.

func DefaultActiveSetPreparation added in v1.5.1

func DefaultActiveSetPreparation() ActiveSetPreparation

type Opt added in v1.0.0

type Opt func(h *ProposalBuilder)

Opt for configuring ProposalBuilder.

func WithActivesetPreparation added in v1.5.0

func WithActivesetPreparation(prep ActiveSetPreparation) Opt

WithActivesetPreparation overwrites configuration for activeset preparation.

func WithHdist added in v1.0.0

func WithHdist(dist uint32) Opt

func WithLayerPerEpoch added in v1.0.0

func WithLayerPerEpoch(layers uint32) Opt

WithLayerPerEpoch defines the number of layers per epoch.

func WithLayerSize added in v1.0.0

func WithLayerSize(size uint32) Opt

WithLayerSize defines the average number of proposal per layer.

func WithLogger added in v1.0.0

func WithLogger(logger log.Log) Opt

WithLogger defines the logger.

func WithMinGoodAtxPercent added in v1.2.2

func WithMinGoodAtxPercent(percent int) Opt

func WithMinimalActiveSetWeight added in v1.0.0

func WithMinimalActiveSetWeight(weight []types.EpochMinimalActiveWeight) Opt

func WithNetworkDelay added in v1.0.7

func WithNetworkDelay(delay time.Duration) Opt

func WithSigners added in v1.3.0

func WithSigners(signers ...*signing.EdSigner) Opt

WithSigners guarantees that builder will start execution with provided list of signers. Should be after logging.

func WithWorkersLimit added in v1.3.0

func WithWorkersLimit(limit int) Opt

WithWorkersLimit configures paralelization factor for builder operation when working with more than one signer.

type ProposalBuilder added in v1.0.0

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

ProposalBuilder builds Proposals for a miner.

func New added in v1.2.2

func New(
	clock layerClock,
	db sql.Executor,
	localdb sql.Executor,
	atxsdata *atxsdata.Data,
	publisher pubsub.Publisher,
	trtl votesEncoder,
	syncer system.SyncStateProvider,
	conState conservativeState,
	opts ...Opt,
) *ProposalBuilder

New creates a struct of block builder type.

func (*ProposalBuilder) Register added in v1.3.0

func (pb *ProposalBuilder) Register(sig *signing.EdSigner)

func (*ProposalBuilder) Run added in v1.2.2

func (pb *ProposalBuilder) Run(ctx context.Context) error

Start the loop that listens to layers and build proposals.

func (*ProposalBuilder) UpdateActiveSet added in v1.2.13

func (pb *ProposalBuilder) UpdateActiveSet(target types.EpochID, set []types.ATXID)

Directories

Path Synopsis
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