Skip to content

Commit

Permalink
Add EIP1559 denominator adjustment for canyon
Browse files Browse the repository at this point in the history
  • Loading branch information
pcw109550 committed Nov 2, 2023
1 parent 293c0e7 commit b93d9d1
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)

Check failure on line 271 in chain/chain_config.go

View workflow job for this annotation

GitHub Actions / tests (ubuntu-20.04)

unnecessary conversion (unconvert)
Expand Down

0 comments on commit b93d9d1

Please sign in to comment.