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 Sep 24, 2024
1 parent 492990e commit 82d18d0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101408.1-0.20240917081657-bbf17c79dfc1
replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101408.1-0.20240923132759-84a6afde2ea0

// replace github.com/ethereum/go-ethereum => ../op-geth

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
github.com/celo-org/op-geth v1.101408.1-0.20240917081657-bbf17c79dfc1 h1:Zwhv6paw0yB3VlsAVfBVRKCJgChr6+6TDp2vlEJeUy8=
github.com/celo-org/op-geth v1.101408.1-0.20240917081657-bbf17c79dfc1/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac=
github.com/celo-org/op-geth v1.101408.1-0.20240923132759-84a6afde2ea0 h1:Hrt/8ScXO/EDYb7lwzX9/QnNySyzGMJSNswaIDW+usk=
github.com/celo-org/op-geth v1.101408.1-0.20240923132759-84a6afde2ea0/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac=
github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk=
github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
Expand Down
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 @@ -252,6 +252,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
4 changes: 3 additions & 1 deletion op-chain-ops/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
if eip1559Elasticity == 0 {
eip1559Elasticity = 10
}

optimismChainConfig := params.ChainConfig{
ChainID: new(big.Int).SetUint64(config.L2ChainID),
HomesteadBlock: big.NewInt(0),
Expand Down Expand Up @@ -75,6 +74,9 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
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 @@ -93,5 +93,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 82d18d0

Please sign in to comment.