Documentation ¶
Overview ¶
Package miner is responsible for creating valid blocks that contain valid activation transactions and transactions
Index ¶
Constants ¶
const AtxsPerBlockLimit = 100
AtxsPerBlockLimit indicates the maximum number of atxs a block can reference
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockBuilder ¶
type BlockBuilder struct { log.Log TransactionPool txPool // contains filtered or unexported fields }
BlockBuilder is the struct that orchestrates the building of blocks, it is responsible for receiving hare results. referencing txs and atxs from mem pool and referencing them in the created block it is also responsible for listening to the clock and querying when a block should be created according to the block oracle
func NewBlockBuilder ¶
func NewBlockBuilder( config Config, sgn signer, net p2p.Service, beginRoundEvent chan types.LayerID, orph meshProvider, bbp baseBlockProvider, blockOracle blockOracle, syncer syncer, projector projector, txPool txPool, logger log.Log, ) *BlockBuilder
NewBlockBuilder creates a struct of block builder type.
func (*BlockBuilder) Close ¶
func (t *BlockBuilder) Close() error
Close stops listeners and stops trying to create block in layers
func (*BlockBuilder) Start ¶
func (t *BlockBuilder) Start(ctx context.Context) error
Start starts the process of creating a block, it listens for txs and atxs received by gossip, and starts querying block oracle when it should create a block. This function returns an error if Start was already called once