Skip to content
Draft
Show file tree
Hide file tree
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
18 changes: 9 additions & 9 deletions ops/internal/config/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ type Chain struct {
SuperchainTime *uint64 `toml:"superchain_time"`
DataAvailabilityType string `toml:"data_availability_type"`
ChainID uint64 `toml:"chain_id"`
BatchInboxAddr *ChecksummedAddress `toml:"batch_inbox_addr"`
BlockTime uint64 `toml:"block_time"`
SeqWindowSize uint64 `toml:"seq_window_size"`
MaxSequencerDrift uint64 `toml:"max_sequencer_drift"`
GasPayingToken *ChecksummedAddress `toml:"gas_paying_token,omitempty"`
Hardforks Hardforks `toml:"hardforks"`
Optimism Optimism `toml:"optimism"`
AltDA *AltDA `toml:"alt_da"`
Genesis Genesis `toml:"genesis"`
Roles Roles `toml:"roles"`
Expand Down Expand Up @@ -116,6 +114,7 @@ type Genesis struct {
L1 GenesisRef `toml:"l1"`
L2 GenesisRef `toml:"l2"`
SystemConfig SystemConfig `toml:"system_config"`
FeeParams *FeeParams `toml:"fee_params,omitempty"`
}

type GenesisRef struct {
Expand All @@ -124,12 +123,13 @@ type GenesisRef struct {
}

type SystemConfig struct {
BatcherAddr ChecksummedAddress `json:"batcherAddr" toml:"batcherAddress"`
Overhead common.Hash `json:"overhead" toml:"overhead"`
Scalar common.Hash `json:"scalar" toml:"scalar"`
GasLimit uint64 `json:"gasLimit" toml:"gasLimit"`
BaseFeeScalar *uint64 `json:"baseFeeScalar,omitempty" toml:"baseFeeScalar,omitempty"`
BlobBaseFeeScalar *uint64 `json:"blobBaseFeeScalar,omitempty" toml:"blobBaseFeeScalar,omitempty"`
BatcherAddr ChecksummedAddress `json:"batcherAddr" toml:"batcherAddress"`
BatchInboxAddr *ChecksummedAddress `json:"batchInboxAddr" toml:"batch_inbox_addr"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting one. The batch inbox address isn't actually in the system config that gets derived, just the contract.

The genesis system config vars, in my head, are things that can change (that the protocol supports changing in normal operation) - imo, it's fine to lift into genesis, but not genesis.system_config.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh ok got it. Will lift it one level to genesis then. And will update the op-geth and monorepo prs accordingly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the inconsistency is that we would put this address that can be read from the system config (and that cannot be changed) into genesis.SystemConfig, but would still leave others in the addresses section. So @clabby @bitwiseguy wdyt about putting the batch inbox address into the addresses section instead?

Overhead common.Hash `json:"overhead" toml:"overhead"`
Scalar common.Hash `json:"scalar" toml:"scalar"`
GasLimit uint64 `json:"gasLimit" toml:"gasLimit"`
BaseFeeScalar *uint64 `json:"baseFeeScalar,omitempty" toml:"baseFeeScalar,omitempty"`
BlobBaseFeeScalar *uint64 `json:"blobBaseFeeScalar,omitempty" toml:"blobBaseFeeScalar,omitempty"`
}

type AltDA struct {
Expand All @@ -139,7 +139,7 @@ type AltDA struct {
DaCommitmentType string `toml:"da_commitment_type"`
}

type Optimism struct {
type FeeParams struct {
EIP1559Elasticity uint64 `toml:"eip1559_elasticity"`
EIP1559Denominator uint64 `toml:"eip1559_denominator"`
EIP1559DenominatorCanyon uint64 `toml:"eip1559_denominator_canyon"`
Expand Down
11 changes: 5 additions & 6 deletions ops/internal/config/testdata/all.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ governed_by_optimism = true
superchain_time = 0
data_availability_type = "eth-da"
chain_id = 10
batch_inbox_addr = "0xFF00000000000000000000000000000000000010"
block_time = 2
seq_window_size = 3600
max_sequencer_drift = 600
Expand All @@ -21,11 +20,6 @@ max_sequencer_drift = 600
holocene_time = 1720627203 # Wed 10 Jul 2024 16:00:03 UTC
isthmus_time = 1720627204 # Wed 10 Jul 2024 16:00:04 UTC

[optimism]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[genesis]
l2_time = 1686068903
[genesis.l1]
Expand All @@ -36,11 +30,16 @@ max_sequencer_drift = 600
number = 105235063
[genesis.system_config]
batcherAddress = "0x6887246668a3b87F54DeB3b94Ba47a6f63F32985"
batch_inbox_addr = "0xFF00000000000000000000000000000000000010"
overhead = "0x00000000000000000000000000000000000000000000000000000000000000bc"
scalar = "0x00000000000000000000000000000000000000000000000000000000000a6fe0"
gasLimit = 30000000
baseFeeScalar = 123
blobBaseFeeScalar = 456
[genesis.fee_params]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[roles]
SystemConfigOwner = "0x847B5c174615B1B7fDF770882256e2D3E95b9D92"
Expand Down
21 changes: 10 additions & 11 deletions ops/internal/manage/staging.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func InflateChainConfig(st *state.State) (*config.StagedChain, error) {

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

cfg.Optimism = config.Optimism{
EIP1559Elasticity: dc.EIP1559Elasticity,
EIP1559Denominator: dc.EIP1559Denominator,
EIP1559DenominatorCanyon: dc.EIP1559DenominatorCanyon,
}

if dc.UseAltDA {
cfg.AltDA = &config.AltDA{
DaChallengeContractAddress: config.ChecksummedAddress(dc.DAChallengeProxy),
Expand All @@ -83,10 +76,16 @@ func InflateChainConfig(st *state.State) (*config.StagedChain, error) {
Number: rollup.Genesis.L2.Number,
},
SystemConfig: config.SystemConfig{
BatcherAddr: *config.NewChecksummedAddress(rollup.Genesis.SystemConfig.BatcherAddr),
Overhead: common.Hash(rollup.Genesis.SystemConfig.Overhead),
Scalar: common.Hash(rollup.Genesis.SystemConfig.Scalar),
GasLimit: rollup.Genesis.SystemConfig.GasLimit,
BatcherAddr: *config.NewChecksummedAddress(rollup.Genesis.SystemConfig.BatcherAddr),
BatchInboxAddr: config.NewChecksummedAddress(dc.BatchInboxAddress),
Overhead: common.Hash(rollup.Genesis.SystemConfig.Overhead),
Scalar: common.Hash(rollup.Genesis.SystemConfig.Scalar),
GasLimit: rollup.Genesis.SystemConfig.GasLimit,
},
FeeParams: &config.FeeParams{
EIP1559Elasticity: dc.EIP1559Elasticity,
EIP1559Denominator: dc.EIP1559Denominator,
EIP1559DenominatorCanyon: dc.EIP1559DenominatorCanyon,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ explorer = "https://sepolia-optimistic.etherscan.io"
superchain_level = 1
governed_by_optimism = true
superchain_time = 0
batch_inbox_addr = "0xff00000000000000000000000000000011155420"
block_time = 2
seq_window_size = 3600
max_sequencer_drift = 600
Expand All @@ -20,11 +19,6 @@ data_availability_type = "eth-da"
granite_time = 1723478400 # Mon 12 Aug 2024 16:00:00 UTC
holocene_time = 1732633200 # Tue 26 Nov 2024 15:00:00 UTC

[optimism]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[genesis]
l2_time = 1691802540
[genesis.l1]
Expand All @@ -35,9 +29,14 @@ data_availability_type = "eth-da"
number = 0
[genesis.system_config]
batcherAddress = "0x8F23BB38F531600e5d8FDDaAEC41F13FaB46E98c"
batch_inbox_addr = "0xff00000000000000000000000000000011155420"
overhead = "0x00000000000000000000000000000000000000000000000000000000000000bc"
scalar = "0x00000000000000000000000000000000000000000000000000000000000a6fe0"
gasLimit = 30000000
[genesis.fee_params]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[roles]
SystemConfigOwner = "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ superchain_time = 0
data_availability_type = "eth-da"
deployment_tx_hash = "0x0193884dc77ba74ca9ae23079edf91b81d49b0243c486fab5bbecd415d2dad68"
chain_id = 1952805748
batch_inbox_addr = "0x00BAA763833a726F122be49cd713dafbE7254e04"
block_time = 2
seq_window_size = 3600
max_sequencer_drift = 600
Expand All @@ -20,11 +19,6 @@ max_sequencer_drift = 600
fjord_time = 0 # Thu 1 Jan 1970 00:00:00 UTC
granite_time = 0 # Thu 1 Jan 1970 00:00:00 UTC

[optimism]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[genesis]
l2_time = 1735008096
[genesis.l1]
Expand All @@ -35,9 +29,15 @@ max_sequencer_drift = 600
number = 0
[genesis.system_config]
batcherAddress = "0x0000000000000000000000000000000000000000"
batch_inbox_addr = "0x00BAA763833a726F122be49cd713dafbE7254e04"
overhead = "0x0000000000000000000000000000000000000000000000000000000000000000"
scalar = "0x0000000000000000000000000000000000000000000000000000000000000000"
gasLimit = 0
[genesis.fee_params]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250


[roles]
SystemConfigOwner = "0x0000000000000000000000000000000000000001"
Expand Down
8 changes: 4 additions & 4 deletions ops/internal/manage/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ func ValidateGenesisIntegrity(cfg *config.Chain, genesis *core.Genesis) error {
}

out.Optimism = &params.OptimismConfig{
EIP1559Elasticity: cfg.Optimism.EIP1559Elasticity,
EIP1559Denominator: cfg.Optimism.EIP1559Denominator,
EIP1559Elasticity: cfg.Genesis.FeeParams.EIP1559Elasticity,
EIP1559Denominator: cfg.Genesis.FeeParams.EIP1559Denominator,
}

if cfg.Optimism.EIP1559DenominatorCanyon != 0 {
out.Optimism.EIP1559DenominatorCanyon = &cfg.Optimism.EIP1559DenominatorCanyon
if cfg.Genesis.FeeParams.EIP1559DenominatorCanyon != 0 {
out.Optimism.EIP1559DenominatorCanyon = &cfg.Genesis.FeeParams.EIP1559DenominatorCanyon
}

genCopy := &core.Genesis{
Expand Down
6 changes: 3 additions & 3 deletions ops/internal/report/l2.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ func DiffL2Genesis(
BaseFeeVaultRecipient: common.Address(chainCfg.BaseFeeVaultRecipient),
L1FeeVaultRecipient: common.Address(chainCfg.L1FeeVaultRecipient),
SequencerFeeVaultRecipient: common.Address(chainCfg.SequencerFeeVaultRecipient),
Eip1559DenominatorCanyon: chainCfg.Optimism.EIP1559DenominatorCanyon,
Eip1559Denominator: chainCfg.Optimism.EIP1559Denominator,
Eip1559Elasticity: chainCfg.Optimism.EIP1559Elasticity,
Eip1559DenominatorCanyon: chainCfg.Genesis.FeeParams.EIP1559DenominatorCanyon,
Eip1559Denominator: chainCfg.Genesis.FeeParams.EIP1559Denominator,
Eip1559Elasticity: chainCfg.Genesis.FeeParams.EIP1559Elasticity,
Roles: state.ChainRoles{
L1ProxyAdminOwner: common.Address(standardRoles.L1ProxyAdminOwner),
L2ProxyAdminOwner: common.Address(standardRoles.L2ProxyAdminOwner),
Expand Down
12 changes: 6 additions & 6 deletions ops/internal/report/testdata/chain-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ deployment_tx_hash = "0x0193884dc77ba74ca9ae23079edf91b81d49b0243c486fab5bbecd41
deployment_l1_contracts_version = "tag://op-contracts/v1.6.0"
deployment_l2_contracts_version = "tag://op-contracts/v1.7.0-beta.1+l2-contracts"
chain_id = 1952805748
batch_inbox_addr = "0x00BAA763833a726F122be49cd713dafbE7254e04"
block_time = 2
seq_window_size = 3600
max_sequencer_drift = 600
Expand All @@ -27,11 +26,6 @@ sequencer_fee_vault_recipient = "0x0000000000000000000000000000000000000001"
fjord_time = 0 # Thu 1 Jan 1970 00:00:00 UTC
granite_time = 0 # Thu 1 Jan 1970 00:00:00 UTC

[optimism]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[genesis]
l2_time = 1735008096
[genesis.l1]
Expand All @@ -42,9 +36,15 @@ sequencer_fee_vault_recipient = "0x0000000000000000000000000000000000000001"
number = 0
[genesis.system_config]
batcherAddress = "0x0000000000000000000000000000000000000000"
batch_inbox_addr = "0x00BAA763833a726F122be49cd713dafbE7254e04"
overhead = "0x0000000000000000000000000000000000000000000000000000000000000000"
scalar = "0x0000000000000000000000000000000000000000000000000000000000000000"
gasLimit = 0
[genesis.fee_params]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250


[roles]
SystemConfigOwner = "0x0000000000000000000000000000000000000001"
Expand Down
11 changes: 5 additions & 6 deletions superchain/configs/mainnet/arena-z.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ governed_by_optimism = true
superchain_time = 1736445601
data_availability_type = "eth-da"
chain_id = 7897
batch_inbox_addr = "0x00f9BCEe08DCe4F0e7906c1f6cFb10c77802EEd0"
block_time = 2
seq_window_size = 3600
max_sequencer_drift = 600
Expand All @@ -21,11 +20,6 @@ max_sequencer_drift = 600
holocene_time = 1736445601 # Thu 9 Jan 2025 18:00:01 UTC
isthmus_time = 1746806401 # Fri 9 May 2025 16:00:01 UTC

[optimism]
eip1559_elasticity = 20
eip1559_denominator = 2000
eip1559_denominator_canyon = 2000

[genesis]
l2_time = 1731366083
[genesis.l1]
Expand All @@ -36,9 +30,14 @@ max_sequencer_drift = 600
number = 0
[genesis.system_config]
batcherAddress = "0x2b8733E8c60A928b19BB7db1D79b918e8E09AC8c"
batch_inbox_addr = "0x00f9BCEe08DCe4F0e7906c1f6cFb10c77802EEd0"
overhead = "0x0000000000000000000000000000000000000000000000000000000000000000"
scalar = "0x010000000000000000000000000000000000000000000000000c3a30000060a4"
gasLimit = 30000000
[genesis.fee_params]
eip1559_elasticity = 20
eip1559_denominator = 2000
eip1559_denominator_canyon = 2000

[roles]
SystemConfigOwner = "0xBeA2Bc852a160B8547273660E22F4F08C2fa9Bbb"
Expand Down
11 changes: 5 additions & 6 deletions superchain/configs/mainnet/automata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ superchain_level = 0
governed_by_optimism = false
data_availability_type = "alt-da"
chain_id = 65536
batch_inbox_addr = "0xff00000000000000000000000000000001111111"
block_time = 2
seq_window_size = 7200
max_sequencer_drift = 1800
Expand All @@ -18,11 +17,6 @@ gas_paying_token = "0xA2120b9e674d3fC3875f415A7DF52e382F141225"
ecotone_time = 0 # Thu 1 Jan 1970 00:00:00 UTC
fjord_time = 0 # Thu 1 Jan 1970 00:00:00 UTC

[optimism]
eip1559_elasticity = 10
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[alt_da]
da_challenge_contract_address = "0x08c5DCDD5e46d31CC1591ee15b084663507597f3"
da_challenge_window = 3600
Expand All @@ -39,9 +33,14 @@ gas_paying_token = "0xA2120b9e674d3fC3875f415A7DF52e382F141225"
number = 0
[genesis.system_config]
batcherAddress = "0x5BEF09f138921eF7985d83AAB97da1dB6E4dd190"
batch_inbox_addr = "0xff00000000000000000000000000000001111111"
overhead = "0x0000000000000000000000000000000000000000000000000000000000000000"
scalar = "0x0100000000000000000000000000000000000000000000000000000000013880"
gasLimit = 30000000
[genesis.fee_params]
eip1559_elasticity = 10
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[roles]
SystemConfigOwner = "0x49eC5Bd8C9cC35Ce26b87E534d2E36980621dDD2"
Expand Down
11 changes: 5 additions & 6 deletions superchain/configs/mainnet/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ governed_by_optimism = false
superchain_time = 0
data_availability_type = "eth-da"
chain_id = 8453
batch_inbox_addr = "0xFf00000000000000000000000000000000008453"
block_time = 2
seq_window_size = 3600
max_sequencer_drift = 600
Expand All @@ -21,11 +20,6 @@ max_sequencer_drift = 600
holocene_time = 1736445601 # Thu 9 Jan 2025 18:00:01 UTC
isthmus_time = 1746806401 # Fri 9 May 2025 16:00:01 UTC

[optimism]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[genesis]
l2_time = 1686789347
[genesis.l1]
Expand All @@ -36,9 +30,14 @@ max_sequencer_drift = 600
number = 0
[genesis.system_config]
batcherAddress = "0x5050F69a9786F081509234F1a7F4684b5E5b76C9"
batch_inbox_addr = "0xFf00000000000000000000000000000000008453"
overhead = "0x00000000000000000000000000000000000000000000000000000000000000bc"
scalar = "0x00000000000000000000000000000000000000000000000000000000000a6fe0"
gasLimit = 30000000
[genesis.fee_params]
eip1559_elasticity = 6
eip1559_denominator = 50
eip1559_denominator_canyon = 250

[roles]
SystemConfigOwner = "0x14536667Cd30e52C0b458BaACcB9faDA7046E056"
Expand Down
Loading