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

refactor(validation/standard): restructure config files #761

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[l1.nonFaultProofs]
OptimismPortalProxy."guardian()" = "0x8c20c40180751d93E939DDDee3517AE0d1EBeAd2"
L2OutputOracleProxy."challenger()" = "0x8c20c40180751d93E939DDDee3517AE0d1EBeAd2"

[l1.FaultProofs]
OptimismPortalProxy."guardian()" = "0x8c20c40180751d93E939DDDee3517AE0d1EBeAd2"
PermissionedDisputeGame."challenger()" = "0x8c20c40180751d93E939DDDee3517AE0d1EBeAd2"

[key-handover.l1.universal]
# This is a 2/2 Safe between the Optimism Foundation and the Security Council
ProxyAdmin."owner()" = "0x4377BB0F0103992b31eC12b4d796a8687B8dC8E9"

[key-handover.l2]
# This is the ALIASED address of the L1 2/2 Safe between the Optimism Foundation and the Security Council.
# To compute the aliased address, add 0x1111000000000000000000000000000000001111
0x4200000000000000000000000000000000000018."owner()" = "0x2FC3ffc903729a0f03966b917003800B145F67F3"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Standard Chain Config Parameters
[rollup_config]
# alt_da must be nil
seq_window_size = [3600, 3600]
block_time = [1, 2]

[optimism_portal_2]
proof_maturity_delay_seconds = [604800, 604800] # 7 days
dispute_game_finality_delay_seconds = [302400, 302400] # 2.5 days
respected_game_type = 0

[resource_config]
max_resource_limit = 20000000
elasticity_multiplier = 10
base_fee_max_change_denominator = 8
minimum_base_fee = 1000000000
system_tx_max_gas = 1000000
maximum_base_fee = "340_282_366_920_938_463_463_374_607_431_768_211_455"

[gas_price_oracle.pre-ecotone]
decimals = [6, 6]
overhead = [188, 2_100]
scalar = [684_000, 1_000_000]

[gas_price_oracle.ecotone]
decimals = [6, 6]
blob_base_fee_scalar = [0, 10_000_000]
base_fee_scalar = [0, 10_000_000]

[system_config]
gas_limit = [1000, 60_000_000]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[releases]

# Contracts which are
# * unproxied singletons: specify a standard "address"
# * proxied : specify a standard "implementation_address"
# * neither : specify neither a standard "address" nor "implementation_address"

# Holocene https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.8.0-rc.3
[releases."op-contracts/v1.8.0-rc.3"]
# Updated in this release
system_config = { version = "2.3.0", implementation_address = "0x33b83E4C305c908B2Fc181dDa36e230213058d7d" } # UPDATED IN THIS RELEASE
fault_dispute_game = { version = "1.3.1" } # UPDATED IN THIS RELEASE
permissioned_dispute_game = { version = "1.3.1" } # UPDATED IN THIS RELEASE
mips = { version = "1.2.1", address = "0x69470D6970Cd2A006b84B1d4d70179c892cFCE01" } # UPDATED IN THIS RELEASE
# Unchanged in this release
optimism_portal = { version = "3.10.0", implementation_address = "0x35028bae87d71cbc192d545d38f960ba30b4b233" }
anchor_state_registry = { version = "2.0.0" }
delayed_weth = { version = "1.1.0", implementation_address = "0x07f69b19532476c6cd03056d6bc3f1b110ab7538" }
dispute_game_factory = { version = "1.0.0", implementation_address = "0xa51bea7e4d34206c0bcb04a776292f2f19f0beec" }
preimage_oracle = { version = "1.1.2", address = "0x92240135b46fc1142dA181f550aE8f595B858854" }
l1_cross_domain_messenger = { version = "2.3.0", implementation_address = "0xD3494713A5cfaD3F5359379DfA074E2Ac8C6Fd65" }
l1_erc721_bridge = { version = "2.1.0", implementation_address = "0xae2af01232a6c4a4d3012c5ec5b1b35059caf10d" }
l1_standard_bridge = { version = "2.1.0", implementation_address = "0x64b5a5ed26dcb17370ff4d33a8d503f0fbd06cff" }
# l2_output_oracle -- This contract not used in fault proofs
optimism_mintable_erc20_factory = { version = "1.9.0", implementation_address = "0xe01efbeb1089d1d1db9c6c8b135c934c0734c846" }

# Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.6.0
[releases."op-contracts/v1.6.0"]
optimism_portal = { version = "3.10.0", implementation_address = "0x35028bae87d71cbc192d545d38f960ba30b4b233" }
system_config = { version = "2.2.0", implementation_address = "0xCcdd86d581e40fb5a1C77582247BC493b6c8B169" }
anchor_state_registry = { version = "2.0.0" }
delayed_weth = { version = "1.1.0", implementation_address = "0x07f69b19532476c6cd03056d6bc3f1b110ab7538" }
dispute_game_factory = { version = "1.0.0", implementation_address = "0xa51bea7e4d34206c0bcb04a776292f2f19f0beec" }
fault_dispute_game = { version = "1.3.0" }
permissioned_dispute_game = { version = "1.3.0" }
mips = { version = "1.1.0", address = "0x47B0E34C1054009e696BaBAAd56165e1e994144d" }
preimage_oracle = { version = "1.1.2", address = "0x92240135b46fc1142dA181f550aE8f595B858854" }
l1_cross_domain_messenger = { version = "2.3.0", implementation_address = "0xD3494713A5cfaD3F5359379DfA074E2Ac8C6Fd65" }
l1_erc721_bridge = { version = "2.1.0", implementation_address = "0xae2af01232a6c4a4d3012c5ec5b1b35059caf10d" }
l1_standard_bridge = { version = "2.1.0", implementation_address = "0x64b5a5ed26dcb17370ff4d33a8d503f0fbd06cff" }
# l2_output_oracle -- This contract not used in fault proofs
optimism_mintable_erc20_factory = { version = "1.9.0", implementation_address = "0xe01efbeb1089d1d1db9c6c8b135c934c0734c846" }
29 changes: 21 additions & 8 deletions validation/standard/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package standard

import (
"embed"
"fmt"
"io/fs"

"github.com/BurntSushi/toml"
"github.com/ethereum-optimism/superchain-registry/superchain"
)

//go:embed *.toml
var standardConfigFile embed.FS
//go:embed config
var standardConfigFS embed.FS

func init() {
Config = ConfigType{
Expand All @@ -20,19 +21,31 @@ func init() {

decodeTOMLFileIntoConfig("standard-config-roles-universal.toml", Config.Roles)

networks := []string{"mainnet", "sepolia"}
for _, network := range networks {
networkDirName := "networks"
networks, err := standardConfigFS.ReadDir("config/" + networkDirName)
if err != nil {
panic(fmt.Errorf("failed to read dir: %w", err))
}

// iterate over network entries
for _, networkDir := range networks {
if !networkDir.IsDir() {
continue // ignore files, e.g. a readme
}

network := networkDir.Name()

Config.MultisigRoles[network] = new(MultisigRoles)
decodeTOMLFileIntoConfig("standard-config-roles-"+network+".toml", Config.MultisigRoles[network])
decodeTOMLFileIntoConfig(networkDirName+"/"+network+"/standard-config-roles-"+network+".toml", Config.MultisigRoles[network])

Config.Params[network] = new(Params)
decodeTOMLFileIntoConfig("standard-config-params-"+network+".toml", Config.Params[network])
decodeTOMLFileIntoConfig(networkDirName+"/"+network+"/standard-config-params-"+network+".toml", Config.Params[network])

var versions VersionTags = VersionTags{
Releases: make(map[Tag]superchain.ContractVersions, 0),
}

decodeTOMLFileIntoConfig("standard-versions-"+network+".toml", &versions)
decodeTOMLFileIntoConfig(networkDirName+"/"+network+"/standard-versions-"+network+".toml", &versions)
NetworkVersions[network] = versions
}

Expand All @@ -53,7 +66,7 @@ func init() {

func decodeTOMLFileIntoConfig[
T any](filename string, config *T) {
data, err := fs.ReadFile(standardConfigFile, filename)
data, err := fs.ReadFile(standardConfigFS, "config/"+filename)
if err != nil {
panic(err)
}
Expand Down