diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 9148bdbe8d..fad567cd55 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1273,7 +1273,7 @@ func setEtherbase(ctx *cli.Context, cfg *ethconfig.Config) { Fatalf("-%s: invalid pending block producer address %q", MinerPendingFeeRecipientFlag.Name, addr) return } - cfg.Miner.Etherbase = common.BytesToAddress(b) + cfg.Miner.PendingFeeRecipient = common.BytesToAddress(b) } // MakePasswordList reads password lines from the file specified by the global --password flag. @@ -1783,8 +1783,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { // Figure out the dev account address. // setEtherbase has been called above, configuring the miner address from command line flags. - if cfg.Miner.Etherbase != (common.Address{}) { - developer = accounts.Account{Address: cfg.Miner.Etherbase} + if cfg.Miner.PendingFeeRecipient != (common.Address{}) { + developer = accounts.Account{Address: cfg.Miner.PendingFeeRecipient} } else if accs := ks.Accounts(); len(accs) > 0 { developer = ks.Accounts()[0] } else { @@ -1795,7 +1795,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } // Make sure the address is configured as fee recipient, otherwise // the miner will fail to start. - cfg.Miner.Etherbase = developer.Address + cfg.Miner.PendingFeeRecipient = developer.Address if err := ks.Unlock(developer, passphrase); err != nil { Fatalf("Failed to unlock developer account: %v", err) diff --git a/console/console_test.go b/console/console_test.go index 8dd031ebe6..4c30c1b49c 100644 --- a/console/console_test.go +++ b/console/console_test.go @@ -96,7 +96,7 @@ func newTester(t *testing.T, confOverride func(*ethconfig.Config)) *tester { ethConf := ðconfig.Config{ Genesis: core.DeveloperGenesisBlock(11_500_000, nil), Miner: miner.Config{ - Etherbase: common.HexToAddress(testAddress), + PendingFeeRecipient: common.HexToAddress(testAddress), }, } if confOverride != nil { diff --git a/eth/backend.go b/eth/backend.go index 57e25848d3..9cfef9c633 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -165,7 +165,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { closeBloomHandler: make(chan struct{}), networkID: networkID, gasPrice: config.Miner.GasPrice, - etherbase: config.Miner.Etherbase, + etherbase: config.Miner.PendingFeeRecipient, bloomRequests: make(chan chan *bloombits.Retrieval), bloomIndexer: core.NewBloomIndexer(chainDb, params.BloomBitsBlocks, params.BloomConfirms), p2pServer: stack.Server(), diff --git a/eth/catalyst/api_test.go b/eth/catalyst/api_test.go index 94a780b504..5f087c160c 100644 --- a/eth/catalyst/api_test.go +++ b/eth/catalyst/api_test.go @@ -448,7 +448,7 @@ func startEthService(t *testing.T, genesis *core.Genesis, blocks []*types.Block) } mcfg := miner.DefaultConfig - mcfg.Etherbase = testAddr + mcfg.PendingFeeRecipient = testAddr ethcfg := ðconfig.Config{Genesis: genesis, SyncMode: downloader.FullSync, TrieTimeout: time.Minute, TrieDirtyCache: 256, TrieCleanCache: 256, Miner: mcfg} ethservice, err := eth.New(n, ethcfg) if err != nil { diff --git a/miner/miner.go b/miner/miner.go index 4d47770e96..800ed652cb 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -42,11 +42,12 @@ type Backend interface { // Config is the configuration parameters of mining. type Config struct { - Etherbase common.Address `toml:",omitempty"` // Public address for block mining rewards - ExtraData hexutil.Bytes `toml:",omitempty"` // Block extra data set by the miner - GasCeil uint64 // Target gas ceiling for mined blocks. - GasPrice *big.Int // Minimum gas price for mining a transaction - Recommit time.Duration // The time interval for miner to re-create mining work. + Etherbase common.Address `toml:"-"` // Deprecated + PendingFeeRecipient common.Address `toml:"-"` // Address for pending block rewards. + ExtraData hexutil.Bytes `toml:",omitempty"` // Block extra data set by the miner + GasCeil uint64 // Target gas ceiling for mined blocks. + GasPrice *big.Int // Minimum gas price for mining a transaction + Recommit time.Duration // The time interval for miner to re-create mining work. } // DefaultConfig contains default settings for miner. @@ -132,7 +133,7 @@ func (miner *Miner) BuildPayload(args *BuildPayloadArgs) (*Payload, error) { // The result might be nil if pending generation is failed. func (miner *Miner) getPending() *newPayloadResult { miner.confMu.RLock() - coinbase := miner.config.Etherbase + coinbase := miner.config.PendingFeeRecipient miner.confMu.RUnlock() header := miner.chain.CurrentHeader() diff --git a/miner/miner_test.go b/miner/miner_test.go index bfb49c1454..7c39564240 100644 --- a/miner/miner_test.go +++ b/miner/miner_test.go @@ -139,7 +139,7 @@ func minerTestGenesisBlock(period uint64, gasLimit uint64, faucet common.Address func createMiner(t *testing.T) *Miner { // Create Ethash config config := Config{ - Etherbase: common.HexToAddress("123456789"), + PendingFeeRecipient: common.HexToAddress("123456789"), } // Create chainConfig chainDB := rawdb.NewMemoryDatabase() diff --git a/miner/payload_building_test.go b/miner/payload_building_test.go index 98b9db27fd..b769ee8121 100644 --- a/miner/payload_building_test.go +++ b/miner/payload_building_test.go @@ -58,9 +58,9 @@ var ( newTxs []*types.Transaction testConfig = Config{ - Etherbase: testBankAddress, - Recommit: time.Second, - GasCeil: params.GenesisGasLimit, + PendingFeeRecipient: testBankAddress, + Recommit: time.Second, + GasCeil: params.GenesisGasLimit, } )