miner

package
v0.0.0-test-go-svm-build2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	// ATXsPerBallotLimit indicates the maximum number of ATXs a Ballot can reference.
	ATXsPerBallotLimit = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt added in v1.0.0

type Opt func(h *ProposalBuilder)

Opt for configuring ProposalBuilder.

func WithDBPath

func WithDBPath(path string) Opt

WithDBPath defines the path to create miner's database.

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 WithMinerID

func WithMinerID(id types.NodeID) Opt

WithMinerID defines the miner's NodeID.

func WithTxsPerProposal

func WithTxsPerProposal(numTxs int) Opt

WithTxsPerProposal defines the number of TXs in a Proposal.

type Oracle added in v0.1.15

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

Oracle provides proposal eligibility proofs for the miner.

func (*Oracle) GetProposalEligibility added in v1.0.0

func (o *Oracle) GetProposalEligibility(lid types.LayerID, beacon types.Beacon) (types.ATXID, []types.ATXID, []types.VotingEligibilityProof, error)

GetProposalEligibility returns the miner's ATXID and the active set for the layer's epoch, along with the list of eligibility proofs for that layer.

type ProposalBuilder added in v1.0.0

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

ProposalBuilder builds Proposals for a miner.

func NewProposalBuilder added in v1.0.0

func NewProposalBuilder(
	ctx context.Context,
	layerTimer timesync.LayerTimer,
	signer *signing.EdSigner,
	vrfSigner *signing.VRFSigner,
	atxDB activationDB,
	publisher pubsub.Publisher,
	pdb proposalDB,
	bbp baseBallotProvider,
	beaconProvider system.BeaconGetter,
	syncer system.SyncStateProvider,
	projector projector,
	txPool txPool,
	opts ...Opt,
) *ProposalBuilder

NewProposalBuilder creates a struct of block builder type.

func (*ProposalBuilder) Close added in v1.0.0

func (pb *ProposalBuilder) Close()

Close stops the loop that listens to layers and build proposals.

func (*ProposalBuilder) Start added in v1.0.0

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

Start starts the loop that listens to layers and build proposals.

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