Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Canyon Hard Fork] Add EIP1559 denominator config for canyon #26

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

// 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,11 +261,14 @@
}

// 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)
}

// ElasticityMultiplier bounds the maximum gas limit an EIP-1559 block may have.
Expand Down
Loading