Documentation
¶
Overview ¶
Package miner implements Ethereum block creation and mining.
Index ¶
- Variables
- type Backend
- type BidRuntime
- type BuilderConfig
- type Config
- type MevConfig
- type Miner
- func (miner *Miner) BestPackedBlockReward(parentHash common.Hash) *big.Int
- func (miner *Miner) GenerateBlock(predicateContext *precompileconfig.PredicateContext) (*types.Block, error)
- func (miner *Miner) MevParams() *bidTypes.MevParams
- func (miner *Miner) MevRunning() bool
- func (miner *Miner) SendBid(ctx context.Context, bidArgs *bidTypes.BidArgs) (common.Hash, error)
- func (miner *Miner) SetEtherbase(addr common.Address)
- func (miner *Miner) SubscribePendingLogs(ch chan<- []*types.Log) event.Subscription
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInsufficientGasCapacityToBuild = errors.New("insufficient gas capacity to build block")
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
BlockChain() *core.BlockChain
TxPool() *txpool.TxPool
}
Backend wraps all methods required for mining.
type BidRuntime ¶
type BidRuntime struct {
// contains filtered or unexported fields
}
type BuilderConfig ¶
type Config ¶
type Config struct {
Etherbase common.Address `toml:",omitempty"` // Public address for block mining rewards
TestOnlyAllowDuplicateBlocks bool // Allow mining of duplicate blocks (used in tests only)
Mev MevConfig // Mev configuration
}
Config is the configuration parameters of mining.
type MevConfig ¶
type MevConfig struct {
Enabled bool `json:"enabled"` // Whether to enable Mev or not
Builders []BuilderConfig `json:"builders"` // The list of builders
ValidatorCommission uint64 `json:"validatorCommission"` // 100 means the validator claims 1% from block reward
ValidatorWallet common.Address `json:"validatorWallet"` // The wallet of the validator that gets the rewards
}
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
func (*Miner) BestPackedBlockReward ¶
func (*Miner) GenerateBlock ¶
func (miner *Miner) GenerateBlock(predicateContext *precompileconfig.PredicateContext) (*types.Block, error)
func (*Miner) MevRunning ¶
MevRunning return true if mev is running.
func (*Miner) SetEtherbase ¶
func (*Miner) SubscribePendingLogs ¶
func (miner *Miner) SubscribePendingLogs(ch chan<- []*types.Log) event.Subscription
SubscribePendingLogs starts delivering logs from pending transactions to the given channel.
Click to show internal directories.
Click to hide internal directories.