From b93d9d11c10ff4a30da037e55ca9e6b54055bac3 Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Thu, 2 Nov 2023 14:45:16 +0900 Subject: [PATCH] Add EIP1559 denominator adjustment for canyon --- chain/chain_config.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chain/chain_config.go b/chain/chain_config.go index bc9bb5ddd..c17ad16ea 100644 --- a/chain/chain_config.go +++ b/chain/chain_config.go @@ -86,8 +86,9 @@ type Config struct { // OptimismConfig is the optimism config. type OptimismConfig struct { - EIP1559Elasticity uint64 `json:"eip1559Elasticity"` - EIP1559Denominator uint64 `json:"eip1559Denominator"` + EIP1559Elasticity uint64 `json:"eip1559Elasticity"` + EIP1559Denominator uint64 `json:"eip1559Denominator"` + EIP1559DenominatorPostCanyon uint64 `json:"eip1559DenominatorPostCanyon"` } // String implements the stringer interface, returning the optimism fee config details. @@ -260,8 +261,11 @@ func (c *Config) IsOptimismPreBedrock(num uint64) bool { } // BaseFeeChangeDenominator bounds the amount the base fee can change between blocks. -func (c *Config) BaseFeeChangeDenominator(defaultParam int) uint64 { +func (c *Config) BaseFeeChangeDenominator(defaultParam, time uint64) uint64 { if c.IsOptimism() { + if c.IsCanyon(time) { + return c.Optimism.EIP1559DenominatorPostCanyon + } return c.Optimism.EIP1559Denominator } return uint64(defaultParam)