Skip to content

Commit

Permalink
Merge pull request #26 from testinprod-io/pcw109550/canyon/eip1559-de…
Browse files Browse the repository at this point in the history
…nominator-adjust

[Canyon Hard Fork] Add EIP1559 denominator config for canyon
  • Loading branch information
pcw109550 authored Nov 6, 2023
2 parents c087c41 + b93d9d1 commit bf9074a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions chain/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bf9074a

Please sign in to comment.