cmd, core, eth, miner: deprecate miner.gastarget flag (#23213)
This commit is contained in:
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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() {
|
||||
|
@ -67,7 +67,6 @@ var (
|
||||
|
||||
testConfig = &Config{
|
||||
Recommit: time.Second,
|
||||
GasFloor: params.GenesisGasLimit,
|
||||
GasCeil: params.GenesisGasLimit,
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user