Skip to content

Commit a333717

Browse files
committed
chain config: move 'optimism' to 'genesis.fee_params'
1 parent 1139c0c commit a333717

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

ops/internal/config/chain.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type Chain struct {
7575
MaxSequencerDrift uint64 `toml:"max_sequencer_drift"`
7676
GasPayingToken *ChecksummedAddress `toml:"gas_paying_token,omitempty"`
7777
Hardforks Hardforks `toml:"hardforks"`
78-
Optimism Optimism `toml:"optimism"`
78+
Optimism *FeeParams `toml:"optimism"`
7979
AltDA *AltDA `toml:"alt_da"`
8080
Genesis Genesis `toml:"genesis"`
8181
Roles Roles `toml:"roles"`
@@ -116,6 +116,7 @@ type Genesis struct {
116116
L1 GenesisRef `toml:"l1"`
117117
L2 GenesisRef `toml:"l2"`
118118
SystemConfig SystemConfig `toml:"system_config"`
119+
FeeParams *FeeParams `toml:"fee_params,omitempty"`
119120
}
120121

121122
type GenesisRef struct {
@@ -124,12 +125,13 @@ type GenesisRef struct {
124125
}
125126

126127
type SystemConfig struct {
127-
BatcherAddr ChecksummedAddress `json:"batcherAddr" toml:"batcherAddress"`
128-
Overhead common.Hash `json:"overhead" toml:"overhead"`
129-
Scalar common.Hash `json:"scalar" toml:"scalar"`
130-
GasLimit uint64 `json:"gasLimit" toml:"gasLimit"`
131-
BaseFeeScalar *uint64 `json:"baseFeeScalar,omitempty" toml:"baseFeeScalar,omitempty"`
132-
BlobBaseFeeScalar *uint64 `json:"blobBaseFeeScalar,omitempty" toml:"blobBaseFeeScalar,omitempty"`
128+
BatcherAddr ChecksummedAddress `json:"batcherAddr" toml:"batcherAddress"`
129+
BatchInboxAddr *ChecksummedAddress `json:"batchInboxAddr" toml:"batch_inbox_addr"`
130+
Overhead common.Hash `json:"overhead" toml:"overhead"`
131+
Scalar common.Hash `json:"scalar" toml:"scalar"`
132+
GasLimit uint64 `json:"gasLimit" toml:"gasLimit"`
133+
BaseFeeScalar *uint64 `json:"baseFeeScalar,omitempty" toml:"baseFeeScalar,omitempty"`
134+
BlobBaseFeeScalar *uint64 `json:"blobBaseFeeScalar,omitempty" toml:"blobBaseFeeScalar,omitempty"`
133135
}
134136

135137
type AltDA struct {
@@ -139,7 +141,7 @@ type AltDA struct {
139141
DaCommitmentType string `toml:"da_commitment_type"`
140142
}
141143

142-
type Optimism struct {
144+
type FeeParams struct {
143145
EIP1559Elasticity uint64 `toml:"eip1559_elasticity"`
144146
EIP1559Denominator uint64 `toml:"eip1559_denominator"`
145147
EIP1559DenominatorCanyon uint64 `toml:"eip1559_denominator_canyon"`

ops/internal/config/testdata/all.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ governed_by_optimism = true
77
superchain_time = 0
88
data_availability_type = "eth-da"
99
chain_id = 10
10-
batch_inbox_addr = "0xFF00000000000000000000000000000000000010"
1110
block_time = 2
1211
seq_window_size = 3600
1312
max_sequencer_drift = 600
@@ -21,11 +20,6 @@ max_sequencer_drift = 600
2120
holocene_time = 1720627203 # Wed 10 Jul 2024 16:00:03 UTC
2221
isthmus_time = 1720627204 # Wed 10 Jul 2024 16:00:04 UTC
2322

24-
[optimism]
25-
eip1559_elasticity = 6
26-
eip1559_denominator = 50
27-
eip1559_denominator_canyon = 250
28-
2923
[genesis]
3024
l2_time = 1686068903
3125
[genesis.l1]
@@ -36,11 +30,16 @@ max_sequencer_drift = 600
3630
number = 105235063
3731
[genesis.system_config]
3832
batcherAddress = "0x6887246668a3b87F54DeB3b94Ba47a6f63F32985"
33+
batch_inbox_addr = "0xFF00000000000000000000000000000000000010"
3934
overhead = "0x00000000000000000000000000000000000000000000000000000000000000bc"
4035
scalar = "0x00000000000000000000000000000000000000000000000000000000000a6fe0"
4136
gasLimit = 30000000
4237
baseFeeScalar = 123
4338
blobBaseFeeScalar = 456
39+
[genesis.fee_params]
40+
eip1559_elasticity = 6
41+
eip1559_denominator = 50
42+
eip1559_denominator_canyon = 250
4443

4544
[roles]
4645
SystemConfigOwner = "0x847B5c174615B1B7fDF770882256e2D3E95b9D92"

ops/internal/manage/staging.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func InflateChainConfig(st *state.State) (*config.StagedChain, error) {
3434

3535
cfg := new(config.StagedChain)
3636
cfg.ChainID = chainID.Big().Uint64()
37-
cfg.BatchInboxAddr = config.NewChecksummedAddress(dc.BatchInboxAddress)
3837
cfg.BlockTime = dc.L2BlockTime
3938
cfg.SeqWindowSize = dc.SequencerWindowSize
4039
cfg.MaxSequencerDrift = dc.MaxSequencerDrift
@@ -54,12 +53,6 @@ func InflateChainConfig(st *state.State) (*config.StagedChain, error) {
5453
return nil, fmt.Errorf("failed to copy deploy config hardfork times: %w", err)
5554
}
5655

57-
cfg.Optimism = config.Optimism{
58-
EIP1559Elasticity: dc.EIP1559Elasticity,
59-
EIP1559Denominator: dc.EIP1559Denominator,
60-
EIP1559DenominatorCanyon: dc.EIP1559DenominatorCanyon,
61-
}
62-
6356
if dc.UseAltDA {
6457
cfg.AltDA = &config.AltDA{
6558
DaChallengeContractAddress: config.ChecksummedAddress(dc.DAChallengeProxy),
@@ -83,10 +76,16 @@ func InflateChainConfig(st *state.State) (*config.StagedChain, error) {
8376
Number: rollup.Genesis.L2.Number,
8477
},
8578
SystemConfig: config.SystemConfig{
86-
BatcherAddr: *config.NewChecksummedAddress(rollup.Genesis.SystemConfig.BatcherAddr),
87-
Overhead: common.Hash(rollup.Genesis.SystemConfig.Overhead),
88-
Scalar: common.Hash(rollup.Genesis.SystemConfig.Scalar),
89-
GasLimit: rollup.Genesis.SystemConfig.GasLimit,
79+
BatcherAddr: *config.NewChecksummedAddress(rollup.Genesis.SystemConfig.BatcherAddr),
80+
BatchInboxAddr: config.NewChecksummedAddress(dc.BatchInboxAddress),
81+
Overhead: common.Hash(rollup.Genesis.SystemConfig.Overhead),
82+
Scalar: common.Hash(rollup.Genesis.SystemConfig.Scalar),
83+
GasLimit: rollup.Genesis.SystemConfig.GasLimit,
84+
},
85+
FeeParams: &config.FeeParams{
86+
EIP1559Elasticity: dc.EIP1559Elasticity,
87+
EIP1559Denominator: dc.EIP1559Denominator,
88+
EIP1559DenominatorCanyon: dc.EIP1559DenominatorCanyon,
9089
},
9190
}
9291

0 commit comments

Comments
 (0)