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:
co-authored by
Martin Holst Swende
parent
08fb1aade6
commit
a51188a163
@@ -709,6 +709,16 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
|
||||
return nil
|
||||
}
|
||||
|
||||
// BaseFeeChangeDenominator bounds the amount the base fee can change between blocks.
|
||||
func (c *ChainConfig) BaseFeeChangeDenominator() uint64 {
|
||||
return DefaultBaseFeeChangeDenominator
|
||||
}
|
||||
|
||||
// ElasticityMultiplier bounds the maximum gas limit an EIP-1559 block may have.
|
||||
func (c *ChainConfig) ElasticityMultiplier() uint64 {
|
||||
return DefaultElasticityMultiplier
|
||||
}
|
||||
|
||||
// isForkIncompatible returns true if a fork scheduled at s1 cannot be rescheduled to
|
||||
// block s2 because head is already past the fork.
|
||||
func isForkIncompatible(s1, s2, head *big.Int) bool {
|
||||
|
||||
@@ -119,9 +119,9 @@ const (
|
||||
// Introduced in Tangerine Whistle (Eip 150)
|
||||
CreateBySelfdestructGas uint64 = 25000
|
||||
|
||||
BaseFeeChangeDenominator = 8 // Bounds the amount the base fee can change between blocks.
|
||||
ElasticityMultiplier = 2 // Bounds the maximum gas limit an EIP-1559 block may have.
|
||||
InitialBaseFee = 1000000000 // Initial base fee for EIP-1559 blocks.
|
||||
DefaultBaseFeeChangeDenominator = 8 // Bounds the amount the base fee can change between blocks.
|
||||
DefaultElasticityMultiplier = 2 // Bounds the maximum gas limit an EIP-1559 block may have.
|
||||
InitialBaseFee = 1000000000 // Initial base fee for EIP-1559 blocks.
|
||||
|
||||
MaxCodeSize = 24576 // Maximum bytecode to permit for a contract
|
||||
|
||||
|
||||
Reference in New Issue
Block a user