cmd, core, eth, miner: deprecate miner.gastarget flag (#23213)

This commit is contained in:
gary rong
2021-08-10 16:28:33 +08:00
committed by GitHub
parent 520f25688a
commit 6d175460df
13 changed files with 32 additions and 71 deletions

View File

@ -242,7 +242,6 @@ func makeMiner(genesis *core.Genesis) (*node.Node, *eth.Ethereum, error) {
GPO: ethconfig.Defaults.GPO,
Ethash: ethconfig.Defaults.Ethash,
Miner: miner.Config{
GasFloor: genesis.GasLimit * 9 / 10,
GasCeil: genesis.GasLimit * 11 / 10,
GasPrice: big.NewInt(1),
Recommit: time.Second,

View File

@ -193,7 +193,6 @@ func makeSealer(genesis *core.Genesis) (*node.Node, *eth.Ethereum, error) {
TxPool: core.DefaultTxPoolConfig,
GPO: ethconfig.Defaults.GPO,
Miner: miner.Config{
GasFloor: genesis.GasLimit * 9 / 10,
GasCeil: genesis.GasLimit * 11 / 10,
GasPrice: big.NewInt(1),
Recommit: time.Second,

View File

@ -171,7 +171,6 @@ func makeMiner(genesis *core.Genesis) (*node.Node, *eth.Ethereum, error) {
GPO: ethconfig.Defaults.GPO,
Ethash: ethconfig.Defaults.Ethash,
Miner: miner.Config{
GasFloor: genesis.GasLimit * 9 / 10,
GasCeil: genesis.GasLimit * 11 / 10,
GasPrice: big.NewInt(1),
Recommit: time.Second,

View File

@ -897,19 +897,17 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
header := &types.Header{
ParentHash: parent.Hash(),
Number: num.Add(num, common.Big1),
GasLimit: core.CalcGasLimit(parent.GasUsed(), parent.GasLimit(), w.config.GasFloor, w.config.GasCeil),
GasLimit: core.CalcGasLimit(parent.GasLimit(), w.config.GasCeil),
Extra: w.extra,
Time: uint64(timestamp),
}
// Set baseFee and GasLimit if we are on an EIP-1559 chain
if w.chainConfig.IsLondon(header.Number) {
header.BaseFee = misc.CalcBaseFee(w.chainConfig, parent.Header())
parentGasLimit := parent.GasLimit()
if !w.chainConfig.IsLondon(parent.Number()) {
// Bump by 2x
parentGasLimit = parent.GasLimit() * params.ElasticityMultiplier
parentGasLimit := parent.GasLimit() * params.ElasticityMultiplier
header.GasLimit = core.CalcGasLimit(parentGasLimit, w.config.GasCeil)
}
header.GasLimit = core.CalcGasLimit1559(parentGasLimit, w.config.GasCeil)
}
// Only set the coinbase if our consensus engine is running (avoid spurious block rewards)
if w.isRunning() {

View File

@ -67,7 +67,6 @@ var (
testConfig = &Config{
Recommit: time.Second,
GasFloor: params.GenesisGasLimit,
GasCeil: params.GenesisGasLimit,
}
)