params: make eip1559 params non-global (#25994)

This PR changes geth to read the eip1559 params from the chain config instead of the globals.

This way the parameters may be changed by forking the chain config code, without creating a large diff throughout the past and future usages of the parameters.

Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
protolambda
2022-11-04 16:27:15 +01:00
committed by GitHub
co-authored by Martin Holst Swende
parent 08fb1aade6
commit a51188a163
5 changed files with 20 additions and 10 deletions
+2 -2
View File
@@ -174,7 +174,7 @@ func (b *BlockGen) AddUncle(h *types.Header) {
if b.config.IsLondon(h.Number) {
h.BaseFee = misc.CalcBaseFee(b.config, parent)
if !b.config.IsLondon(parent.Number) {
parentGasLimit := parent.GasLimit * params.ElasticityMultiplier
parentGasLimit := parent.GasLimit * b.config.ElasticityMultiplier()
h.GasLimit = CalcGasLimit(parentGasLimit, parentGasLimit)
}
}
@@ -322,7 +322,7 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S
if chain.Config().IsLondon(header.Number) {
header.BaseFee = misc.CalcBaseFee(chain.Config(), parent.Header())
if !chain.Config().IsLondon(parent.Number()) {
parentGasLimit := parent.GasLimit() * params.ElasticityMultiplier
parentGasLimit := parent.GasLimit() * chain.Config().ElasticityMultiplier()
header.GasLimit = CalcGasLimit(parentGasLimit, parentGasLimit)
}
}