|
|
@ -23,6 +23,7 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/consensus" |
|
|
|
"github.com/ethereum/go-ethereum/consensus" |
|
|
|
"github.com/ethereum/go-ethereum/consensus/misc" |
|
|
|
"github.com/ethereum/go-ethereum/consensus/misc" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/consensus/misc/eip1559" |
|
|
|
"github.com/ethereum/go-ethereum/core/rawdb" |
|
|
|
"github.com/ethereum/go-ethereum/core/rawdb" |
|
|
|
"github.com/ethereum/go-ethereum/core/state" |
|
|
|
"github.com/ethereum/go-ethereum/core/state" |
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
@ -202,7 +203,7 @@ func (b *BlockGen) AddUncle(h *types.Header) { |
|
|
|
// The gas limit and price should be derived from the parent
|
|
|
|
// The gas limit and price should be derived from the parent
|
|
|
|
h.GasLimit = parent.GasLimit |
|
|
|
h.GasLimit = parent.GasLimit |
|
|
|
if b.config.IsLondon(h.Number) { |
|
|
|
if b.config.IsLondon(h.Number) { |
|
|
|
h.BaseFee = misc.CalcBaseFee(b.config, parent) |
|
|
|
h.BaseFee = eip1559.CalcBaseFee(b.config, parent) |
|
|
|
if !b.config.IsLondon(parent.Number) { |
|
|
|
if !b.config.IsLondon(parent.Number) { |
|
|
|
parentGasLimit := parent.GasLimit * b.config.ElasticityMultiplier() |
|
|
|
parentGasLimit := parent.GasLimit * b.config.ElasticityMultiplier() |
|
|
|
h.GasLimit = CalcGasLimit(parentGasLimit, parentGasLimit) |
|
|
|
h.GasLimit = CalcGasLimit(parentGasLimit, parentGasLimit) |
|
|
@ -380,7 +381,7 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S |
|
|
|
Time: time, |
|
|
|
Time: time, |
|
|
|
} |
|
|
|
} |
|
|
|
if chain.Config().IsLondon(header.Number) { |
|
|
|
if chain.Config().IsLondon(header.Number) { |
|
|
|
header.BaseFee = misc.CalcBaseFee(chain.Config(), parent.Header()) |
|
|
|
header.BaseFee = eip1559.CalcBaseFee(chain.Config(), parent.Header()) |
|
|
|
if !chain.Config().IsLondon(parent.Number()) { |
|
|
|
if !chain.Config().IsLondon(parent.Number()) { |
|
|
|
parentGasLimit := parent.GasLimit() * chain.Config().ElasticityMultiplier() |
|
|
|
parentGasLimit := parent.GasLimit() * chain.Config().ElasticityMultiplier() |
|
|
|
header.GasLimit = CalcGasLimit(parentGasLimit, parentGasLimit) |
|
|
|
header.GasLimit = CalcGasLimit(parentGasLimit, parentGasLimit) |
|
|
|