Skip to content

Commit

Permalink
Base Fee Floor (fixed) configuration (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonponti authored and karlb committed Oct 14, 2024
1 parent 75e23d7 commit d493374
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions op-chain-ops/cmd/celo-migrate/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ func applyStateMigrationChanges(config *genesis.DeployConfig, l2Allocs types.Gen
EIP1559DenominatorCanyon: &config.EIP1559DenominatorCanyon,
EIP1559Elasticity: config.EIP1559Elasticity,
}

// Set the Celo options.
cfg.Celo = &params.CeloConfig{
EIP1559BaseFeeFloor: config.EIP1559BaseFeeFloor,
}

// Set Optimism hardforks
cfg.BedrockBlock = cel2Block.Number()
cfg.RegolithTime = &cel2Header.Time
Expand Down
2 changes: 2 additions & 0 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ type EIP1559DeployConfig struct {
EIP1559Denominator uint64 `json:"eip1559Denominator"`
// EIP1559DenominatorCanyon is the denominator of EIP1559 base fee market when Canyon is active.
EIP1559DenominatorCanyon uint64 `json:"eip1559DenominatorCanyon"`
// EIP1559BaseFeeFloor is the fixed floor for the EIP1559 base fee market.
EIP1559BaseFeeFloor uint64 `json:"eip1559BaseFeeFloor,omitempty"`
}

var _ ConfigChecker = (*EIP1559DeployConfig)(nil)
Expand Down
3 changes: 3 additions & 0 deletions op-chain-ops/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func NewL2Genesis(config *DeployConfig, l1StartHeader *types.Header) (*core.Gene
EIP1559Elasticity: eip1559Elasticity,
EIP1559DenominatorCanyon: &eip1559DenomCanyon,
},
Celo: &params.CeloConfig{
EIP1559BaseFeeFloor: config.EIP1559BaseFeeFloor,
},
}

gasLimit := config.L2GenesisBlockGasLimit
Expand Down
3 changes: 2 additions & 1 deletion op-chain-ops/genesis/testdata/test-deploy-config-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,6 @@
"daChallengeWindow": 0,
"daResolveWindow": 0,
"daResolverRefundPercentage": 0,
"deployCeloContracts": false
"deployCeloContracts": false,
"eip1559BaseFeeFloor": 5000000000
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ cat << EOL > tmp_config.json
"eip1559Denominator": 50,
"eip1559DenominatorCanyon": 250,
"eip1559Elasticity": 6,
"eip1559BaseFeeFloor": 5000000000,
EOL

# Append conditional environment variables with their corresponding default values
Expand Down

0 comments on commit d493374

Please sign in to comment.