From 1c1085f0f5365e1b079c1f6aa19c1a92d44843aa Mon Sep 17 00:00:00 2001 From: geoknee Date: Thu, 11 Jul 2024 17:39:30 +0100 Subject: [PATCH 01/16] remove MCP as supported contract version for standard chains exclude legacy standard candidate chains --- validation/exclusions_test.go | 17 +++++++++++++++-- validation/standard/standard-versions.toml | 11 ----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/validation/exclusions_test.go b/validation/exclusions_test.go index 2d36fb80c..f51ce4a7a 100644 --- a/validation/exclusions_test.go +++ b/validation/exclusions_test.go @@ -56,8 +56,21 @@ var exclusions = map[string]map[uint64]bool{ 11763072: true, // sepolia-dev-0/base-devnet-0 No Public RPC declared }, "Standard_Contract_Versions": { - 11155421: true, // sepolia-dev-0/oplabs-devnet-0 - 11763072: true, // sepolia-dev-0/base-devnet-0 + 10: true, // mainnet/op MCP (at time of writing) + 8453: true, // mainnet/base MCP (at time of writing) + 957: true, // mainnet/lyra MCP (at time of writing) + 1750: true, // mainnet/metal MCP (at time of writing) + 34443: true, // mainnet/mode MCP (at time of writing) + 291: true, // mainnet/orderly MCP (at time of writing) + 424: true, // mainnet/pgn MCP (at time of writing) + 7777777: true, // mainnet/zora MCP (at time of writing) + 11155420: true, // sepolia/op MCP (at time of writing) + 84532: true, // sepolia/base MCP (at time of writing) + 919: true, // sepolia/mode MCP (at time of writing) + 58008: true, // sepolia/pgn MCP (at time of writing) + 999999999: true, // sepolia/zora MCP (at time of writing) + 11155421: true, // sepolia-dev0/oplabs-devnet-0" + 11763072: true, // sepolia-dev0/base-devnet-0" }, "Uniqueness_Check": { 11155421: true, // oplabs devnet 0, not in upstream repo diff --git a/validation/standard/standard-versions.toml b/validation/standard/standard-versions.toml index e9d949cc6..17d178890 100644 --- a/validation/standard/standard-versions.toml +++ b/validation/standard/standard-versions.toml @@ -12,14 +12,3 @@ delayed_weth = "1.0.0" dispute_game_factory = "1.0.0" fault_dispute_game = "1.2.0" permissioned_dispute_game = "1.2.0" - -["op-contracts/v1.3.0"] # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 -address_manager = "" -l1_cross_domain_messenger = "2.3.0" -l1_erc721_bridge = "2.1.0" -l1_standard_bridge = "2.1.0" -optimism_mintable_erc20_factory = "1.9.0" -optimism_portal = "2.5.0" -system_config = "1.12.0" -protocol_versions = "1.0.0" -l2_output_oracle = "1.8.0" From 7a6e7e363897342b81003d2025f6b99d4035315f Mon Sep 17 00:00:00 2001 From: geoknee Date: Thu, 11 Jul 2024 18:19:59 +0100 Subject: [PATCH 02/16] remove "contract_versions_tag" and l2OO tests we now require fault proof contracts, the l2OO is deprecated on FP chains --- add-chain/config/config.go | 10 -- .../configs/sepolia/expected_faultproofs.yaml | 2 - .../configs/sepolia/expected_plasma.yaml | 2 - .../sepolia/expected_standard-candidate.yaml | 2 - .../configs/sepolia/expected_zorasep.yaml | 2 - superchain/configs/mainnet/base.yaml | 2 +- superchain/configs/mainnet/metal.yaml | 2 - superchain/configs/mainnet/mode.yaml | 1 - superchain/configs/mainnet/op.yaml | 1 - superchain/configs/mainnet/zora.yaml | 1 - superchain/configs/sepolia/base.yaml | 1 - superchain/configs/sepolia/mode.yaml | 1 - superchain/configs/sepolia/op.yaml | 1 - superchain/configs/sepolia/zora.yaml | 1 - superchain/superchain.go | 17 +-- validation/l2oo_test.go | 116 ------------------ validation/standard/params.go | 7 -- .../standard-config-params-mainnet.toml | 5 - .../standard-config-params-sepolia-dev-0.toml | 5 - .../standard-config-params-sepolia.toml | 5 - validation/superchain-version_test.go | 7 +- validation/validation_test.go | 1 - 22 files changed, 4 insertions(+), 188 deletions(-) delete mode 100644 validation/l2oo_test.go diff --git a/add-chain/config/config.go b/add-chain/config/config.go index 8568790de..8f9b7a375 100644 --- a/add-chain/config/config.go +++ b/add-chain/config/config.go @@ -82,16 +82,6 @@ func ConstructChainConfig( }, } - if superchainLevel == superchain.Standard || standardChainCandidate { - var contractsVersionTag string - if isFaultProofs { - contractsVersionTag = "op-contracts/v1.4.0" - } else { - contractsVersionTag = "op-contracts/v1.3.0" - } - chainConfig.ContractsVersionTag = &contractsVersionTag - } - fmt.Printf("Rollup config successfully constructed\n") return chainConfig, nil } diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml index 938b4f605..4210161a9 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml @@ -7,8 +7,6 @@ explorer: https://awesomescan.org superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: null # Missing hardfork times are NOT yet inherited from superchain.yaml -contracts_version_tag: op-contracts/v1.4.0 # Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.4.0 - batch_inbox_addr: "0xFf00000000000000000000000000000011155421" genesis: diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml index f0137df82..a84af85aa 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml @@ -7,8 +7,6 @@ explorer: https://awesomescan.org superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: null # Missing hardfork times are NOT yet inherited from superchain.yaml -contracts_version_tag: op-contracts/v1.3.0 # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 - batch_inbox_addr: "0xFf00000000000000000000000000000000042069" genesis: diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml index e98105b3b..252f023e7 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml @@ -7,8 +7,6 @@ explorer: https://awesomescan.org superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: null # Missing hardfork times are NOT yet inherited from superchain.yaml -contracts_version_tag: op-contracts/v1.3.0 # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 - batch_inbox_addr: "0xFf00000000000000000000000000000000042069" genesis: diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml index edd4caebc..f8f36e264 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml @@ -7,8 +7,6 @@ explorer: https://awesomescan.org superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: null # Missing hardfork times are NOT yet inherited from superchain.yaml -contracts_version_tag: op-contracts/v1.3.0 # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 - batch_inbox_addr: "0xCd734290E4bd0200dAC631c7D4b9E8a33234e91f" genesis: diff --git a/superchain/configs/mainnet/base.yaml b/superchain/configs/mainnet/base.yaml index 6fdc63bc7..c44379706 100644 --- a/superchain/configs/mainnet/base.yaml +++ b/superchain/configs/mainnet/base.yaml @@ -7,7 +7,7 @@ explorer: https://explorer.base.org superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml -contracts_version_tag: op-contracts/v1.3.0 # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 + system_config_addr: "0x73a79Fab69143498Ed3712e519A88a918e1f4072" diff --git a/superchain/configs/mainnet/metal.yaml b/superchain/configs/mainnet/metal.yaml index 4b1d52a3c..37839748f 100644 --- a/superchain/configs/mainnet/metal.yaml +++ b/superchain/configs/mainnet/metal.yaml @@ -6,9 +6,7 @@ explorer: https://explorer.metall2.com superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain - superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml -contracts_version_tag: "op-contracts/v1.3.0" # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 batch_inbox_addr: "0xc83f7D9F2D4A76E81145849381ABA02602373723" diff --git a/superchain/configs/mainnet/mode.yaml b/superchain/configs/mainnet/mode.yaml index 7c2a5dd55..56b9e876d 100644 --- a/superchain/configs/mainnet/mode.yaml +++ b/superchain/configs/mainnet/mode.yaml @@ -8,7 +8,6 @@ superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml -contracts_version_tag: "op-contracts/v1.3.0" # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 system_config_addr: "0x5e6432F18Bc5d497B1Ab2288a025Fbf9D69E2221" batch_inbox_addr: "0x24E59d9d3Bd73ccC28Dc54062AF7EF7bFF58Bd67" diff --git a/superchain/configs/mainnet/op.yaml b/superchain/configs/mainnet/op.yaml index 41fe7f613..fbdcce921 100644 --- a/superchain/configs/mainnet/op.yaml +++ b/superchain/configs/mainnet/op.yaml @@ -6,7 +6,6 @@ explorer: https://explorer.optimism.io superchain_level: 2 superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml -contracts_version_tag: "op-contracts/v1.4.0" # Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.4.0 system_config_addr: "0x229047fed2591dbec1eF1118d64F7aF3dB9EB290" batch_inbox_addr: "0xFF00000000000000000000000000000000000010" diff --git a/superchain/configs/mainnet/zora.yaml b/superchain/configs/mainnet/zora.yaml index 2b54e09cd..8fbedd58a 100644 --- a/superchain/configs/mainnet/zora.yaml +++ b/superchain/configs/mainnet/zora.yaml @@ -8,7 +8,6 @@ superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml -contracts_version_tag: "op-contracts/v1.3.0" # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 system_config_addr: "0xA3cAB0126d5F504B071b81a3e8A2BBBF17930d86" batch_inbox_addr: "0x6F54Ca6F6EdE96662024Ffd61BFd18f3f4e34DFf" diff --git a/superchain/configs/sepolia/base.yaml b/superchain/configs/sepolia/base.yaml index 08aac019a..e1428417e 100644 --- a/superchain/configs/sepolia/base.yaml +++ b/superchain/configs/sepolia/base.yaml @@ -8,7 +8,6 @@ superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml -contracts_version_tag: "op-contracts/v1.3.0" # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 system_config_addr: "0xf272670eb55e895584501d564AfEB048bEd26194" batch_inbox_addr: "0xfF00000000000000000000000000000000084532" diff --git a/superchain/configs/sepolia/mode.yaml b/superchain/configs/sepolia/mode.yaml index 66e6b568c..a718d9224 100644 --- a/superchain/configs/sepolia/mode.yaml +++ b/superchain/configs/sepolia/mode.yaml @@ -8,7 +8,6 @@ superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC -contracts_version_tag: "op-contracts/v1.3.0" # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 batch_inbox_addr: "0xcDDaE6148dA1E003C230E4527f9baEdc8a204e7E" diff --git a/superchain/configs/sepolia/op.yaml b/superchain/configs/sepolia/op.yaml index fd9dc1907..e53ecb614 100644 --- a/superchain/configs/sepolia/op.yaml +++ b/superchain/configs/sepolia/op.yaml @@ -6,7 +6,6 @@ explorer: "https://sepolia-optimistic.etherscan.io" superchain_level: 2 superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml -contracts_version_tag: "op-contracts/v1.4.0" # Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.4.0 system_config_addr: "0x034edD2A225f7f429A63E0f1D2084B9E0A93b538" batch_inbox_addr: "0xff00000000000000000000000000000011155420" diff --git a/superchain/configs/sepolia/zora.yaml b/superchain/configs/sepolia/zora.yaml index 6b157a398..3ad7db4a5 100644 --- a/superchain/configs/sepolia/zora.yaml +++ b/superchain/configs/sepolia/zora.yaml @@ -8,7 +8,6 @@ superchain_level: 1 standard_chain_candidate: true # This is a temporary field which causes most of the standard validation checks to run on this chain superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml -contracts_version_tag: "op-contracts/v1.3.0" # Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 system_config_addr: "0xB54c7BFC223058773CF9b739cC5bd4095184Fb08" batch_inbox_addr: "0xCd734290E4bd0200dAC631c7D4b9E8a33234e91f" diff --git a/superchain/superchain.go b/superchain/superchain.go index 964fe96d2..28d86a166 100644 --- a/superchain/superchain.go +++ b/superchain/superchain.go @@ -92,11 +92,6 @@ type ChainConfig struct { // will be inherited from the superchain-wide config. SuperchainTime *uint64 `yaml:"superchain_time"` - // An op-contracts tag from github.com/ethereum-optimism/optimism - // from which contracts were deployed. Example: "op-contracts/v1.4.0". - // May be nil for frontier chains. - ContractsVersionTag *string `yaml:"contracts_version_tag,omitempty"` - BatchInboxAddr Address `yaml:"batch_inbox_addr"` Genesis ChainGenesis `yaml:"genesis"` @@ -196,20 +191,10 @@ func (c *ChainConfig) EnhanceYAML(ctx context.Context, node *yaml.Node) error { } // Add blank line AFTER these keys - if lastKey == "explorer" || lastKey == "contracts_version_tag" || lastKey == "genesis" { + if lastKey == "explorer" || lastKey == "genesis" { keyNode.HeadComment = "\n" } - if keyNode.Value == "contracts_version_tag" { - switch valNode.Value { - case "op-contracts/v1.3.0": - keyNode.LineComment = "Multi-Chain Prep (MCP) https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0" - case "op-contracts/v1.4.0": - keyNode.LineComment = "Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.4.0" - - } - } - // Add blank line BEFORE these keys if keyNode.Value == "genesis" || keyNode.Value == "plasma" { keyNode.HeadComment = "\n" diff --git a/validation/l2oo_test.go b/validation/l2oo_test.go deleted file mode 100644 index b8b1d1551..000000000 --- a/validation/l2oo_test.go +++ /dev/null @@ -1,116 +0,0 @@ -package validation - -import ( - "context" - "fmt" - "math/big" - "testing" - - . "github.com/ethereum-optimism/superchain-registry/superchain" - "github.com/ethereum-optimism/superchain-registry/validation/internal/bindings" - legacy "github.com/ethereum-optimism/superchain-registry/validation/internal/legacy" - "github.com/ethereum-optimism/superchain-registry/validation/standard" - "github.com/stretchr/testify/require" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient" -) - -type L2OOParams struct { - SubmissionInterval *big.Int - L2BlockTime *big.Int - FinalizationPeriodSeconds *big.Int -} - -func testL2OOParams(t *testing.T, chain *ChainConfig) { - skipIfExcluded(t, chain.ChainID) - - if *chain.ContractsVersionTag == "op-contracts/v1.4.0" { - t.Skip("Chain is on fault proofs, so there is no L2OutputOracle to track") - } - - rpcEndpoint := Superchains[chain.Superchain].Config.L1.PublicRPC - - require.NotEmpty(t, rpcEndpoint) - - client, err := ethclient.Dial(rpcEndpoint) - require.NoErrorf(t, err, "could not dial rpc endpoint %s", rpcEndpoint) - - contractAddress, err := Addresses[chain.ChainID].AddressFor("L2OutputOracleProxy") - require.NoError(t, err) - - desiredParams := standard.Config.Params[chain.Superchain].L2OOParams - - version, err := getVersion(context.Background(), common.Address(contractAddress), client) - require.NoError(t, err) - - var actualParams L2OOParams - if version == "1.3.0" || version == "1.3.1" { - actualParams, err = getl2OOParamsWithRetriesLegacy(context.Background(), common.Address(contractAddress), client) - } else { - actualParams, err = getl2OOParamsWithRetries(context.Background(), common.Address(contractAddress), client) - } - require.NoErrorf(t, err, "RPC endpoint %s", rpcEndpoint) - - assertBigIntInBounds(t, "submissionInterval", actualParams.SubmissionInterval, desiredParams.SubmissionInterval) - assertBigIntInBounds(t, "l2BlockTime", actualParams.L2BlockTime, desiredParams.L2BlockTime) - assertBigIntInBounds(t, "challengePeriodSeconds", actualParams.FinalizationPeriodSeconds, desiredParams.ChallengePeriodSeconds) -} - -// getl2OOParamsWithRetries gets each of the parameters from the L2OutputOracle at l2OOAddr, -// retrying up to 10 times with exponential backoff. -func getl2OOParamsWithRetries(ctx context.Context, l2OOAddr common.Address, client *ethclient.Client) (L2OOParams, error) { - callOpts := &bind.CallOpts{Context: ctx} - l2OO, err := bindings.NewL2OutputOracle(l2OOAddr, client) - if err != nil { - return L2OOParams{}, err - } - - params := L2OOParams{} - - params.SubmissionInterval, err = Retry(l2OO.SubmissionInterval)(callOpts) - if err != nil { - return L2OOParams{}, fmt.Errorf("could not get submissionInterval: %w", err) - } - - params.L2BlockTime, err = Retry(l2OO.L2BlockTime)(callOpts) - if err != nil { - return L2OOParams{}, fmt.Errorf("could not get l2Blocktime: %w", err) - } - - params.FinalizationPeriodSeconds, err = Retry(l2OO.FinalizationPeriodSeconds)(callOpts) - if err != nil { - return L2OOParams{}, fmt.Errorf("could not get finalizationPeriodSeconds: %w", err) - } - - return params, nil -} - -// getl2OOParamsWithRetriesLegacy gets each of the parameters from the L2OutputOracle at l2OOAddr, -func getl2OOParamsWithRetriesLegacy(ctx context.Context, l2OOAddr common.Address, client *ethclient.Client) (L2OOParams, error) { - callOpts := &bind.CallOpts{Context: ctx} - l2OO, err := legacy.NewL2OutputOracleCaller(l2OOAddr, client) - if err != nil { - return L2OOParams{}, err - } - - params := L2OOParams{} - - params.SubmissionInterval, err = Retry(l2OO.SUBMISSIONINTERVAL)(callOpts) - if err != nil { - return L2OOParams{}, fmt.Errorf("could not get submissionInterval: %w", err) - } - - params.L2BlockTime, err = Retry(l2OO.L2BLOCKTIME)(callOpts) - if err != nil { - return L2OOParams{}, fmt.Errorf("could not get l2Blocktime: %w", err) - } - - params.FinalizationPeriodSeconds, err = Retry(l2OO.FINALIZATIONPERIODSECONDS)(callOpts) - if err != nil { - return L2OOParams{}, fmt.Errorf("could not get finalizationPeriodSeconds: %w", err) - } - - return params, nil -} diff --git a/validation/standard/params.go b/validation/standard/params.go index 0e879cce4..9a6bba29d 100644 --- a/validation/standard/params.go +++ b/validation/standard/params.go @@ -11,12 +11,6 @@ type ResourceConfig struct { MaximumBaseFee *big.Int `toml:"maximum_base_fee"` } -type L2OOParamsBounds struct { - SubmissionInterval BigIntBounds `toml:"submission_interval"` // Interval in blocks at which checkpoints must be submitted. - L2BlockTime BigIntBounds `toml:"l2_block_time"` // The time per L2 block, in seconds. - ChallengePeriodSeconds BigIntBounds `toml:"challenge_period_seconds"` // Length of time for which an output root can be removed, and for which it is not considered finalized. -} - type GasPriceOracleBounds struct { PreEcotone PreEcotoneGasPriceOracleBounds `toml:"pre-ecotone"` Ecotone EcotoneGasPriceOracleBounds `toml:"ecotone"` @@ -44,7 +38,6 @@ type EcotoneGasPriceOracleBounds struct { } type Params struct { ResourceConfig ResourceConfig `toml:"resource_config"` - L2OOParams L2OOParamsBounds `toml:"l2_output_oracle"` GPOParams GasPriceOracleBounds `toml:"gas_price_oracle"` SystemConfig SystemConfig `toml:"system_config"` } diff --git a/validation/standard/standard-config-params-mainnet.toml b/validation/standard/standard-config-params-mainnet.toml index 64c38c0c2..b58ecda86 100644 --- a/validation/standard/standard-config-params-mainnet.toml +++ b/validation/standard/standard-config-params-mainnet.toml @@ -11,11 +11,6 @@ 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" -[l2_output_oracle] -submission_interval = [1, 86400] -l2_block_time = [2, 2] -challenge_period_seconds = [604800, 604800] # i.e. finalization period - [gas_price_oracle.pre-ecotone] decimals = [6, 6] overhead = [188, 188] diff --git a/validation/standard/standard-config-params-sepolia-dev-0.toml b/validation/standard/standard-config-params-sepolia-dev-0.toml index 352a02af2..2c32d1c37 100644 --- a/validation/standard/standard-config-params-sepolia-dev-0.toml +++ b/validation/standard/standard-config-params-sepolia-dev-0.toml @@ -7,11 +7,6 @@ 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" -[l2_output_oracle] -submission_interval = [1, 86400] -l2_block_time = [2, 2] -challenge_period_seconds = [12, 12] # i.e. finalization period - [gas_price_oracle.pre-ecotone] decimals = [6, 6] overhead = [188, 2_100] diff --git a/validation/standard/standard-config-params-sepolia.toml b/validation/standard/standard-config-params-sepolia.toml index 0f2991f70..2c32d1c37 100644 --- a/validation/standard/standard-config-params-sepolia.toml +++ b/validation/standard/standard-config-params-sepolia.toml @@ -7,11 +7,6 @@ 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" -[l2_output_oracle] -submission_interval = [1, 86400] -l2_block_time = [2, 2] -challenge_period_seconds = [12, 604800] # i.e. finalization period - [gas_price_oracle.pre-ecotone] decimals = [6, 6] overhead = [188, 2_100] diff --git a/validation/superchain-version_test.go b/validation/superchain-version_test.go index f117268cd..8fc40c8b6 100644 --- a/validation/superchain-version_test.go +++ b/validation/superchain-version_test.go @@ -27,16 +27,13 @@ func testContractsMatchATag(t *testing.T, chain *ChainConfig) { client, err := ethclient.Dial(rpcEndpoint) require.NoErrorf(t, err, "could not dial rpc endpoint %s", rpcEndpoint) - require.NotNil(t, chain.ContractsVersionTag, "Chain does not declare a contracts_version_tag") - isFaultProofs := *chain.ContractsVersionTag == "op-contracts/v1.4.0" + isFaultProofs := true versions, err := getContractVersionsFromChain(*Addresses[chain.ChainID], client, isFaultProofs) require.NoError(t, err) - matches, err := findOPContractTag(versions) + _, err = findOPContractTag(versions) require.NoError(t, err) - - require.Containsf(t, matches, standard.Tag(*chain.ContractsVersionTag), "Chain config does not declare the correct contracts_version_tag") } // getContractVersionsFromChain pulls the appropriate contract versions (depending on the isFaultProofs argument) from chain diff --git a/validation/validation_test.go b/validation/validation_test.go index 78d565d1b..052dc3067 100644 --- a/validation/validation_test.go +++ b/validation/validation_test.go @@ -56,7 +56,6 @@ func testStandardCandidate(t *testing.T, chain *ChainConfig) { // Standard Config Params t.Run("Data Availability", func(t *testing.T) { testDataAvailability(t, chain) }) t.Run("Resource Config", func(t *testing.T) { testResourceConfig(t, chain) }) - t.Run("L2OO Params", func(t *testing.T) { testL2OOParams(t, chain) }) t.Run("Gas Limit", func(t *testing.T) { testGasLimit(t, chain) }) t.Run("GPO Params", func(t *testing.T) { testGasPriceOracleParams(t, chain) }) t.Run("Superchain Config", func(t *testing.T) { testSuperchainConfig(t, chain) }) From a60e205e5cbd22981d891590659d70a41f0ea449 Mon Sep 17 00:00:00 2001 From: geoknee Date: Thu, 11 Jul 2024 18:20:35 +0100 Subject: [PATCH 03/16] remove unused helper --- validation/utils_test.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/validation/utils_test.go b/validation/utils_test.go index 0ae135a78..33765c866 100644 --- a/validation/utils_test.go +++ b/validation/utils_test.go @@ -31,13 +31,6 @@ func isIntWithinBounds[T uint32 | uint64](actual T, bounds [2]T) bool { return (actual >= bounds[0] && actual <= bounds[1]) } -// assertBigIntInBounds fails the test (but not immediately) if the passed param is outside of the passed bounds. -var assertBigIntInBounds = func(t *testing.T, name string, got *big.Int, want [2]*big.Int) { - assert.True(t, - isBigIntWithinBounds(got, want), - fmt.Sprintf("Incorrect %s, %d is not within bounds %d", name, got, want)) -} - // assertInBounds fails the test (but not immediately) if the passed param is outside of the passed bounds. func assertIntInBounds[T uint32 | uint64](t *testing.T, name string, got T, want [2]T) { assert.True(t, From 3cf36fb71d3c8c477c013c2ca71cf1c6833738f8 Mon Sep 17 00:00:00 2001 From: geoknee Date: Sat, 13 Jul 2024 21:09:53 +0100 Subject: [PATCH 04/16] remove l2oo.submission_interval and l2oo.challenge_period_seconds See https://github.com/ethereum-optimism/specs/pull/253 Move l2_block_time to rollup_config section --- validation/standard/standard-config-params-mainnet.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/validation/standard/standard-config-params-mainnet.toml b/validation/standard/standard-config-params-mainnet.toml index b58ecda86..d29dd869f 100644 --- a/validation/standard/standard-config-params-mainnet.toml +++ b/validation/standard/standard-config-params-mainnet.toml @@ -1,7 +1,8 @@ # Standard Chain Config Parameters -[config] +[rollup_config] # plasma_config must be nil seq_window_size = 3600 +l2_block_time = [2, 2] [resource_config] max_resource_limit = 20000000 From 765b6afb241dae4da1c349b81c5b776c8f71f19e Mon Sep 17 00:00:00 2001 From: geoknee Date: Sat, 13 Jul 2024 21:11:49 +0100 Subject: [PATCH 05/16] replace data availability test with more general rollup config test --- validation/{data-availability_test.go => rollup-config_test.go} | 2 +- validation/validation_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename validation/{data-availability_test.go => rollup-config_test.go} (81%) diff --git a/validation/data-availability_test.go b/validation/rollup-config_test.go similarity index 81% rename from validation/data-availability_test.go rename to validation/rollup-config_test.go index 9cbb00f1d..cedc3b859 100644 --- a/validation/data-availability_test.go +++ b/validation/rollup-config_test.go @@ -7,6 +7,6 @@ import ( "github.com/stretchr/testify/require" ) -func testDataAvailability(t *testing.T, chain *ChainConfig) { +func testRollupConfig(t *testing.T, chain *ChainConfig) { require.Nil(t, chain.Plasma, "Standard chains use Ethereum L1 calldata or blobs for data availability (plasma not permitted)") } diff --git a/validation/validation_test.go b/validation/validation_test.go index 052dc3067..c8f0b1ba3 100644 --- a/validation/validation_test.go +++ b/validation/validation_test.go @@ -54,7 +54,7 @@ func testUniversal(t *testing.T, chain *ChainConfig) { // testStandardCandidate applies to Standard and Standard Candidate Chains. func testStandardCandidate(t *testing.T, chain *ChainConfig) { // Standard Config Params - t.Run("Data Availability", func(t *testing.T) { testDataAvailability(t, chain) }) + t.Run("Rollup Config", func(t *testing.T) { testRollupConfig(t, chain) }) t.Run("Resource Config", func(t *testing.T) { testResourceConfig(t, chain) }) t.Run("Gas Limit", func(t *testing.T) { testGasLimit(t, chain) }) t.Run("GPO Params", func(t *testing.T) { testGasPriceOracleParams(t, chain) }) From f865c18d6e1723d1011994ad81130e118be6385f Mon Sep 17 00:00:00 2001 From: geoknee Date: Sat, 13 Jul 2024 21:35:38 +0100 Subject: [PATCH 06/16] track and validate l2_block_time https://github.com/ethereum-optimism/specs/issues/276 --- add-chain/config/config.go | 2 ++ superchain/superchain.go | 6 ++++-- validation/rollup-config_test.go | 4 +++- validation/standard/params.go | 13 ++++++++++++- .../standard/standard-config-params-mainnet.toml | 6 +++--- .../standard/standard-config-params-sepolia.toml | 5 +++++ 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/add-chain/config/config.go b/add-chain/config/config.go index 8f9b7a375..88a3e8d2a 100644 --- a/add-chain/config/config.go +++ b/add-chain/config/config.go @@ -16,6 +16,7 @@ type JSONChainConfig struct { ChainID uint64 `json:"l2_chain_id"` BatchInboxAddr superchain.Address `json:"batch_inbox_address"` Genesis superchain.ChainGenesis `json:"genesis"` + BlockTime uint64 `json:"block_time"` PlasmaConfig *superchain.PlasmaConfig `json:"plasma_config,omitempty"` superchain.HardForkConfiguration `json:",inline"` } @@ -80,6 +81,7 @@ func ConstructChainConfig( EcotoneTime: jsonConfig.EcotoneTime, FjordTime: jsonConfig.FjordTime, }, + BlockTime: jsonConfig.BlockTime, } fmt.Printf("Rollup config successfully constructed\n") diff --git a/superchain/superchain.go b/superchain/superchain.go index 28d86a166..91e268396 100644 --- a/superchain/superchain.go +++ b/superchain/superchain.go @@ -106,6 +106,8 @@ type ChainConfig struct { // Hardfork Configuration Overrides HardForkConfiguration `yaml:",inline"` + BlockTime uint64 `yaml:"block_time"` + // Optional feature Plasma *PlasmaConfig `yaml:"plasma,omitempty"` } @@ -196,7 +198,7 @@ func (c *ChainConfig) EnhanceYAML(ctx context.Context, node *yaml.Node) error { } // Add blank line BEFORE these keys - if keyNode.Value == "genesis" || keyNode.Value == "plasma" { + if keyNode.Value == "genesis" || keyNode.Value == "plasma" || keyNode.Value == "block_time" { keyNode.HeadComment = "\n" } @@ -218,7 +220,7 @@ func (c *ChainConfig) EnhanceYAML(ctx context.Context, node *yaml.Node) error { } // Add human readable timestamp in comment - if strings.HasSuffix(keyNode.Value, "_time") && valNode.Value != "" && valNode.Value != "null" { + if strings.HasSuffix(keyNode.Value, "_time") && valNode.Value != "" && valNode.Value != "null" && keyNode.Value != "block_time" { t, err := strconv.ParseInt(valNode.Value, 10, 64) if err != nil { return fmt.Errorf("failed to convert yaml string timestamp to int: %w", err) diff --git a/validation/rollup-config_test.go b/validation/rollup-config_test.go index cedc3b859..2a2e4ef29 100644 --- a/validation/rollup-config_test.go +++ b/validation/rollup-config_test.go @@ -4,9 +4,11 @@ import ( "testing" . "github.com/ethereum-optimism/superchain-registry/superchain" + "github.com/ethereum-optimism/superchain-registry/validation/standard" "github.com/stretchr/testify/require" ) func testRollupConfig(t *testing.T, chain *ChainConfig) { - require.Nil(t, chain.Plasma, "Standard chains use Ethereum L1 calldata or blobs for data availability (plasma not permitted)") + require.Equal(t, chain.Plasma, standard.Config.Params[chain.Superchain].RollupConfig.Plasma, "Standard chains use Ethereum L1 calldata or blobs for data availability (plasma not permitted)") + assertIntInBounds(t, "Block Time", chain.BlockTime, standard.Config.Params[chain.Superchain].RollupConfig.BlockTime) } diff --git a/validation/standard/params.go b/validation/standard/params.go index 9a6bba29d..d4758250f 100644 --- a/validation/standard/params.go +++ b/validation/standard/params.go @@ -1,6 +1,10 @@ package standard -import "math/big" +import ( + "math/big" + + "github.com/ethereum-optimism/superchain-registry/superchain" +) type ResourceConfig struct { MaxResourceLimit uint32 `toml:"max_resource_limit"` @@ -36,7 +40,14 @@ type EcotoneGasPriceOracleBounds struct { BlobBaseFeeScalar Uint32Bounds `toml:"blob_base_fee_scalar"` BaseFeeScalar Uint32Bounds `toml:"base_fee_scalar"` } + +type RollupConfigBounds struct { + Plasma *superchain.PlasmaConfig `toml:"plasma"` + BlockTime [2]uint64 `toml:"block_time"` + SequencingWindowSize [2]uint64 `toml:"seq_window_size"` +} type Params struct { + RollupConfig RollupConfigBounds `toml:"rollup_config"` ResourceConfig ResourceConfig `toml:"resource_config"` GPOParams GasPriceOracleBounds `toml:"gas_price_oracle"` SystemConfig SystemConfig `toml:"system_config"` diff --git a/validation/standard/standard-config-params-mainnet.toml b/validation/standard/standard-config-params-mainnet.toml index d29dd869f..4bc9d9ca5 100644 --- a/validation/standard/standard-config-params-mainnet.toml +++ b/validation/standard/standard-config-params-mainnet.toml @@ -1,8 +1,8 @@ # Standard Chain Config Parameters [rollup_config] -# plasma_config must be nil -seq_window_size = 3600 -l2_block_time = [2, 2] +# plasma must be nil +seq_window_size = [3600, 3600] +block_time = [2, 2] [resource_config] max_resource_limit = 20000000 diff --git a/validation/standard/standard-config-params-sepolia.toml b/validation/standard/standard-config-params-sepolia.toml index 2c32d1c37..abf4a9f99 100644 --- a/validation/standard/standard-config-params-sepolia.toml +++ b/validation/standard/standard-config-params-sepolia.toml @@ -1,4 +1,9 @@ # Standard Chain Config Parameters +[rollup_config] +# plasma must be nil +seq_window_size = [3600, 3600] +block_time = [2, 2] + [resource_config] max_resource_limit = 20000000 elasticity_multiplier = 10 From 06135ae08ef36212e97e0a753991119bf0133fa9 Mon Sep 17 00:00:00 2001 From: geoknee Date: Sat, 13 Jul 2024 21:36:19 +0100 Subject: [PATCH 07/16] update existing chain configs to store block_time = 2 this is actually not properly configurable, yet since op-node will just ignore / overwrite this value --- .../testdata/superchain/configs/sepolia/expected_baseline.yaml | 2 ++ .../superchain/configs/sepolia/expected_faultproofs.yaml | 2 ++ .../testdata/superchain/configs/sepolia/expected_plasma.yaml | 2 ++ .../superchain/configs/sepolia/expected_standard-candidate.yaml | 2 ++ .../testdata/superchain/configs/sepolia/expected_zorasep.yaml | 2 ++ superchain/configs/mainnet/base.yaml | 2 ++ superchain/configs/mainnet/lyra.yaml | 2 ++ superchain/configs/mainnet/metal.yaml | 2 ++ superchain/configs/mainnet/mode.yaml | 2 ++ superchain/configs/mainnet/op.yaml | 2 ++ superchain/configs/mainnet/orderly.yaml | 2 ++ superchain/configs/mainnet/pgn.yaml | 2 ++ superchain/configs/mainnet/zora.yaml | 2 ++ superchain/configs/sepolia-dev-0/base-devnet-0.yaml | 2 ++ superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml | 2 ++ superchain/configs/sepolia-dev-0/superchain.yaml | 2 ++ superchain/configs/sepolia/base.yaml | 2 ++ superchain/configs/sepolia/mode.yaml | 2 ++ superchain/configs/sepolia/op.yaml | 2 ++ superchain/configs/sepolia/pgn.yaml | 2 ++ superchain/configs/sepolia/zora.yaml | 2 ++ 21 files changed, 42 insertions(+) diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_baseline.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_baseline.yaml index 3feeff316..dda116c62 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_baseline.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_baseline.yaml @@ -19,3 +19,5 @@ genesis: canyon_time: 0 # Thu 1 Jan 1970 00:00:00 UTC delta_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC + +block_time: 2 diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml index 4210161a9..e29fe96fd 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml @@ -20,3 +20,5 @@ genesis: canyon_time: 0 # Thu 1 Jan 1970 00:00:00 UTC delta_time: 0 # Thu 1 Jan 1970 00:00:00 UTC + +block_time: 2 diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml index a84af85aa..95f43ed72 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml @@ -21,6 +21,8 @@ genesis: canyon_time: 0 # Thu 1 Jan 1970 00:00:00 UTC delta_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC +block_time: 2 + plasma: da_challenge_contract_address: "0x3333333333333333333300000000000000000000" da_challenge_window: 5555555 diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml index 252f023e7..bf023209f 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml @@ -20,3 +20,5 @@ genesis: canyon_time: 0 # Thu 1 Jan 1970 00:00:00 UTC delta_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC + +block_time: 2 diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml index f8f36e264..e8ccb8de8 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml @@ -17,3 +17,5 @@ genesis: hash: "0x8b17d2d52564a5a90079d9c860e1386272579e87b17ea27a3868513f53facd74" number: 0 l2_time: 1698080004 # Mon 23 Oct 2023 16:53:24 UTC + +block_time: 2 diff --git a/superchain/configs/mainnet/base.yaml b/superchain/configs/mainnet/base.yaml index c44379706..af5eef635 100644 --- a/superchain/configs/mainnet/base.yaml +++ b/superchain/configs/mainnet/base.yaml @@ -21,3 +21,5 @@ genesis: hash: "0xf712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd" number: 0 l2_time: 1686789347 # Thu 15 Jun 2023 00:35:47 UTC + +block_time: 2 diff --git a/superchain/configs/mainnet/lyra.yaml b/superchain/configs/mainnet/lyra.yaml index 0c746a295..8181af58d 100644 --- a/superchain/configs/mainnet/lyra.yaml +++ b/superchain/configs/mainnet/lyra.yaml @@ -18,3 +18,5 @@ genesis: hash: "0x047f535b3da7ad4f96d353b5a439740b7591413daee0e2f27dd3aabb24581af2" number: 0 l2_time: 1700021615 # Wed 15 Nov 2023 04:13:35 UTC + +block_time: 2 diff --git a/superchain/configs/mainnet/metal.yaml b/superchain/configs/mainnet/metal.yaml index 37839748f..0f6d55692 100644 --- a/superchain/configs/mainnet/metal.yaml +++ b/superchain/configs/mainnet/metal.yaml @@ -18,3 +18,5 @@ genesis: hash: "0xd31c12ffff2d563897ad9a041c0d26790d635911bdbbfa589347fa955f75281e" number: 0 l2_time: 1711563515 + +block_time: 2 diff --git a/superchain/configs/mainnet/mode.yaml b/superchain/configs/mainnet/mode.yaml index 56b9e876d..06e27bcf0 100644 --- a/superchain/configs/mainnet/mode.yaml +++ b/superchain/configs/mainnet/mode.yaml @@ -20,3 +20,5 @@ genesis: hash: "0xb0f682e12fc555fd5ce8fce51a59a67d66a5b46be28611a168260a549dac8a9b" number: 0 l2_time: 1700167583 # Thu 16 Nov 2023 20:46:23 UTC + +block_time: 2 diff --git a/superchain/configs/mainnet/op.yaml b/superchain/configs/mainnet/op.yaml index fbdcce921..d84740436 100644 --- a/superchain/configs/mainnet/op.yaml +++ b/superchain/configs/mainnet/op.yaml @@ -18,3 +18,5 @@ genesis: hash: "0xdbf6a80fef073de06add9b0d14026d6e5a86c85f6d102c36d3d8e9cf89c2afd3" number: 105235063 l2_time: 1686068903 # Tue 6 Jun 2023 16:28:23 UTC + +block_time: 2 diff --git a/superchain/configs/mainnet/orderly.yaml b/superchain/configs/mainnet/orderly.yaml index c1fa8651c..1679e498d 100644 --- a/superchain/configs/mainnet/orderly.yaml +++ b/superchain/configs/mainnet/orderly.yaml @@ -18,3 +18,5 @@ genesis: hash: "0xe53c94ddd42714239429bd132ba2fa080c7e5cc7dca816ec6e482ec0418e6d7f" number: 0 l2_time: 1696608227 # Fri 6 Oct 2023 16:03:47 UTC + +block_time: 2 diff --git a/superchain/configs/mainnet/pgn.yaml b/superchain/configs/mainnet/pgn.yaml index 0e9b090ee..ca4d5eb4b 100644 --- a/superchain/configs/mainnet/pgn.yaml +++ b/superchain/configs/mainnet/pgn.yaml @@ -18,3 +18,5 @@ genesis: hash: "0x39c02e153c193000f2d2907de42cc49f48329163f71d7f9c3fd0e15f41b529db" number: 0 l2_time: 1689106727 # Tue 11 Jul 2023 20:18:47 UTC + +block_time: 2 diff --git a/superchain/configs/mainnet/zora.yaml b/superchain/configs/mainnet/zora.yaml index 8fbedd58a..69c8eca5e 100644 --- a/superchain/configs/mainnet/zora.yaml +++ b/superchain/configs/mainnet/zora.yaml @@ -20,3 +20,5 @@ genesis: hash: "0x47555a45a1af8d4728ca337a1e48375a83919b1ea16591e070a07388b7364e29" number: 0 l2_time: 1686693839 # Tue 13 Jun 2023 22:03:59 UTC + +block_time: 2 diff --git a/superchain/configs/sepolia-dev-0/base-devnet-0.yaml b/superchain/configs/sepolia-dev-0/base-devnet-0.yaml index dc2ec2e94..6a40c6812 100644 --- a/superchain/configs/sepolia-dev-0/base-devnet-0.yaml +++ b/superchain/configs/sepolia-dev-0/base-devnet-0.yaml @@ -23,3 +23,5 @@ genesis: canyon_time: 1698436800 # Fri 27 Oct 2023 20:00:00 UTC delta_time: 1706555000 # Mon 29 Jan 2024 19:03:20 UTC + +block_time: 2 diff --git a/superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml b/superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml index 78c559a51..288cbd3c8 100644 --- a/superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml +++ b/superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml @@ -18,3 +18,5 @@ genesis: hash: "0x027ae1f4f9a441f9c8a01828f3b6d05803a0f524c07e09263264a38b755f804b" number: 0 l2_time: 1706484048 # Sun 28 Jan 2024 23:20:48 UTC + +block_time: 2 diff --git a/superchain/configs/sepolia-dev-0/superchain.yaml b/superchain/configs/sepolia-dev-0/superchain.yaml index 48f9e7b4f..439351cb6 100644 --- a/superchain/configs/sepolia-dev-0/superchain.yaml +++ b/superchain/configs/sepolia-dev-0/superchain.yaml @@ -11,3 +11,5 @@ canyon_time: 0 delta_time: 0 ecotone_time: 1706634000 # Tue 30 Jan 2024 17:00:00 UTC fjord_time: 1715961600 # Fri May 17 16:00:00 UTC 2024 + +block_time: 2 diff --git a/superchain/configs/sepolia/base.yaml b/superchain/configs/sepolia/base.yaml index e1428417e..dccf68a4d 100644 --- a/superchain/configs/sepolia/base.yaml +++ b/superchain/configs/sepolia/base.yaml @@ -20,3 +20,5 @@ genesis: hash: "0x0dcc9e089e30b90ddfc55be9a37dd15bc551aeee999d2e2b51414c54eaf934e4" number: 0 l2_time: 1695768288 # Tue 26 Sep 2023 22:44:48 UTC + +block_time: 2 diff --git a/superchain/configs/sepolia/mode.yaml b/superchain/configs/sepolia/mode.yaml index a718d9224..5e6a28e01 100644 --- a/superchain/configs/sepolia/mode.yaml +++ b/superchain/configs/sepolia/mode.yaml @@ -21,3 +21,5 @@ genesis: l2_time: 1687867932 canyon_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC + +block_time: 2 diff --git a/superchain/configs/sepolia/op.yaml b/superchain/configs/sepolia/op.yaml index e53ecb614..6bc1ee68f 100644 --- a/superchain/configs/sepolia/op.yaml +++ b/superchain/configs/sepolia/op.yaml @@ -18,3 +18,5 @@ genesis: hash: "0x102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d" number: 0 l2_time: 1691802540 # Sat 12 Aug 2023 01:09:00 UTC + +block_time: 2 diff --git a/superchain/configs/sepolia/pgn.yaml b/superchain/configs/sepolia/pgn.yaml index 685969b48..eb40b9c8c 100644 --- a/superchain/configs/sepolia/pgn.yaml +++ b/superchain/configs/sepolia/pgn.yaml @@ -18,3 +18,5 @@ genesis: hash: "0x1d2ad9a8139d33161b1915698d2ae94019fd0817f2113198b6cb568110fa16ad" number: 0 l2_time: 1685727972 # Fri 2 Jun 2023 17:46:12 UTC + +block_time: 2 diff --git a/superchain/configs/sepolia/zora.yaml b/superchain/configs/sepolia/zora.yaml index 3ad7db4a5..8f22f2e2d 100644 --- a/superchain/configs/sepolia/zora.yaml +++ b/superchain/configs/sepolia/zora.yaml @@ -20,3 +20,5 @@ genesis: hash: "0x8b17d2d52564a5a90079d9c860e1386272579e87b17ea27a3868513f53facd74" number: 0 l2_time: 1698080004 # Mon 23 Oct 2023 16:53:24 UTC + +block_time: 2 From 41aae2c272587ee66edf40c364dac583d31a35f3 Mon Sep 17 00:00:00 2001 From: geoknee Date: Sat, 13 Jul 2024 21:48:29 +0100 Subject: [PATCH 08/16] track and validate sequencing window Closes https://github.com/ethereum-optimism/superchain-registry/issues/374 --- add-chain/config/config.go | 4 +++- .../superchain/configs/sepolia/expected_baseline.yaml | 1 + .../superchain/configs/sepolia/expected_faultproofs.yaml | 1 + .../superchain/configs/sepolia/expected_plasma.yaml | 1 + .../configs/sepolia/expected_standard-candidate.yaml | 1 + .../superchain/configs/sepolia/expected_zorasep.yaml | 1 + superchain/configs/mainnet/base.yaml | 1 + superchain/configs/mainnet/lyra.yaml | 1 + superchain/configs/mainnet/metal.yaml | 1 + superchain/configs/mainnet/mode.yaml | 1 + superchain/configs/mainnet/op.yaml | 1 + superchain/configs/mainnet/orderly.yaml | 1 + superchain/configs/mainnet/pgn.yaml | 1 + superchain/configs/mainnet/zora.yaml | 1 + superchain/configs/sepolia-dev-0/base-devnet-0.yaml | 1 + superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml | 1 + superchain/configs/sepolia-dev-0/superchain.yaml | 1 + superchain/configs/sepolia/base.yaml | 1 + superchain/configs/sepolia/mode.yaml | 1 + superchain/configs/sepolia/op.yaml | 1 + superchain/configs/sepolia/pgn.yaml | 1 + superchain/configs/sepolia/zora.yaml | 1 + superchain/superchain.go | 3 ++- validation/rollup-config_test.go | 8 +++++--- validation/standard/params.go | 6 +++--- 25 files changed, 34 insertions(+), 8 deletions(-) diff --git a/add-chain/config/config.go b/add-chain/config/config.go index 88a3e8d2a..808ae75d6 100644 --- a/add-chain/config/config.go +++ b/add-chain/config/config.go @@ -17,6 +17,7 @@ type JSONChainConfig struct { BatchInboxAddr superchain.Address `json:"batch_inbox_address"` Genesis superchain.ChainGenesis `json:"genesis"` BlockTime uint64 `json:"block_time"` + SequencerWindowSize uint64 `json:"seq_window_size"` PlasmaConfig *superchain.PlasmaConfig `json:"plasma_config,omitempty"` superchain.HardForkConfiguration `json:",inline"` } @@ -81,7 +82,8 @@ func ConstructChainConfig( EcotoneTime: jsonConfig.EcotoneTime, FjordTime: jsonConfig.FjordTime, }, - BlockTime: jsonConfig.BlockTime, + BlockTime: jsonConfig.BlockTime, + SequencerWindowSize: jsonConfig.SequencerWindowSize, } fmt.Printf("Rollup config successfully constructed\n") diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_baseline.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_baseline.yaml index dda116c62..cec98ddb9 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_baseline.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_baseline.yaml @@ -21,3 +21,4 @@ canyon_time: 0 # Thu 1 Jan 1970 00:00:00 UTC delta_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC block_time: 2 +seq_window_size: 3600 diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml index e29fe96fd..6f9b2a8ff 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_faultproofs.yaml @@ -22,3 +22,4 @@ canyon_time: 0 # Thu 1 Jan 1970 00:00:00 UTC delta_time: 0 # Thu 1 Jan 1970 00:00:00 UTC block_time: 2 +seq_window_size: 3600 diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml index 95f43ed72..6e60f23ea 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_plasma.yaml @@ -22,6 +22,7 @@ canyon_time: 0 # Thu 1 Jan 1970 00:00:00 UTC delta_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC block_time: 2 +seq_window_size: 3600 plasma: da_challenge_contract_address: "0x3333333333333333333300000000000000000000" diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml index bf023209f..336525b66 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_standard-candidate.yaml @@ -22,3 +22,4 @@ canyon_time: 0 # Thu 1 Jan 1970 00:00:00 UTC delta_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC block_time: 2 +seq_window_size: 3600 diff --git a/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml b/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml index e8ccb8de8..e84c8e945 100644 --- a/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml +++ b/add-chain/testdata/superchain/configs/sepolia/expected_zorasep.yaml @@ -19,3 +19,4 @@ genesis: l2_time: 1698080004 # Mon 23 Oct 2023 16:53:24 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/mainnet/base.yaml b/superchain/configs/mainnet/base.yaml index af5eef635..420929a2e 100644 --- a/superchain/configs/mainnet/base.yaml +++ b/superchain/configs/mainnet/base.yaml @@ -23,3 +23,4 @@ genesis: l2_time: 1686789347 # Thu 15 Jun 2023 00:35:47 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/mainnet/lyra.yaml b/superchain/configs/mainnet/lyra.yaml index 8181af58d..61f11bd7e 100644 --- a/superchain/configs/mainnet/lyra.yaml +++ b/superchain/configs/mainnet/lyra.yaml @@ -20,3 +20,4 @@ genesis: l2_time: 1700021615 # Wed 15 Nov 2023 04:13:35 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/mainnet/metal.yaml b/superchain/configs/mainnet/metal.yaml index 0f6d55692..a2252b00c 100644 --- a/superchain/configs/mainnet/metal.yaml +++ b/superchain/configs/mainnet/metal.yaml @@ -20,3 +20,4 @@ genesis: l2_time: 1711563515 block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/mainnet/mode.yaml b/superchain/configs/mainnet/mode.yaml index 06e27bcf0..2c5416377 100644 --- a/superchain/configs/mainnet/mode.yaml +++ b/superchain/configs/mainnet/mode.yaml @@ -22,3 +22,4 @@ genesis: l2_time: 1700167583 # Thu 16 Nov 2023 20:46:23 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/mainnet/op.yaml b/superchain/configs/mainnet/op.yaml index d84740436..c39ccbe42 100644 --- a/superchain/configs/mainnet/op.yaml +++ b/superchain/configs/mainnet/op.yaml @@ -20,3 +20,4 @@ genesis: l2_time: 1686068903 # Tue 6 Jun 2023 16:28:23 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/mainnet/orderly.yaml b/superchain/configs/mainnet/orderly.yaml index 1679e498d..03322474f 100644 --- a/superchain/configs/mainnet/orderly.yaml +++ b/superchain/configs/mainnet/orderly.yaml @@ -20,3 +20,4 @@ genesis: l2_time: 1696608227 # Fri 6 Oct 2023 16:03:47 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/mainnet/pgn.yaml b/superchain/configs/mainnet/pgn.yaml index ca4d5eb4b..d8dd814a3 100644 --- a/superchain/configs/mainnet/pgn.yaml +++ b/superchain/configs/mainnet/pgn.yaml @@ -20,3 +20,4 @@ genesis: l2_time: 1689106727 # Tue 11 Jul 2023 20:18:47 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/mainnet/zora.yaml b/superchain/configs/mainnet/zora.yaml index 69c8eca5e..13ee6df81 100644 --- a/superchain/configs/mainnet/zora.yaml +++ b/superchain/configs/mainnet/zora.yaml @@ -22,3 +22,4 @@ genesis: l2_time: 1686693839 # Tue 13 Jun 2023 22:03:59 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/sepolia-dev-0/base-devnet-0.yaml b/superchain/configs/sepolia-dev-0/base-devnet-0.yaml index 6a40c6812..8f8806540 100644 --- a/superchain/configs/sepolia-dev-0/base-devnet-0.yaml +++ b/superchain/configs/sepolia-dev-0/base-devnet-0.yaml @@ -25,3 +25,4 @@ canyon_time: 1698436800 # Fri 27 Oct 2023 20:00:00 UTC delta_time: 1706555000 # Mon 29 Jan 2024 19:03:20 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml b/superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml index 288cbd3c8..47a8ca40d 100644 --- a/superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml +++ b/superchain/configs/sepolia-dev-0/oplabs-devnet-0.yaml @@ -20,3 +20,4 @@ genesis: l2_time: 1706484048 # Sun 28 Jan 2024 23:20:48 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/sepolia-dev-0/superchain.yaml b/superchain/configs/sepolia-dev-0/superchain.yaml index 439351cb6..b563132af 100644 --- a/superchain/configs/sepolia-dev-0/superchain.yaml +++ b/superchain/configs/sepolia-dev-0/superchain.yaml @@ -13,3 +13,4 @@ ecotone_time: 1706634000 # Tue 30 Jan 2024 17:00:00 UTC fjord_time: 1715961600 # Fri May 17 16:00:00 UTC 2024 block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/sepolia/base.yaml b/superchain/configs/sepolia/base.yaml index dccf68a4d..b5c6ec766 100644 --- a/superchain/configs/sepolia/base.yaml +++ b/superchain/configs/sepolia/base.yaml @@ -22,3 +22,4 @@ genesis: l2_time: 1695768288 # Tue 26 Sep 2023 22:44:48 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/sepolia/mode.yaml b/superchain/configs/sepolia/mode.yaml index 5e6a28e01..bdf182643 100644 --- a/superchain/configs/sepolia/mode.yaml +++ b/superchain/configs/sepolia/mode.yaml @@ -23,3 +23,4 @@ genesis: canyon_time: 1703203200 # Fri 22 Dec 2023 00:00:00 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/sepolia/op.yaml b/superchain/configs/sepolia/op.yaml index 6bc1ee68f..3965bde30 100644 --- a/superchain/configs/sepolia/op.yaml +++ b/superchain/configs/sepolia/op.yaml @@ -20,3 +20,4 @@ genesis: l2_time: 1691802540 # Sat 12 Aug 2023 01:09:00 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/sepolia/pgn.yaml b/superchain/configs/sepolia/pgn.yaml index eb40b9c8c..ae8346b71 100644 --- a/superchain/configs/sepolia/pgn.yaml +++ b/superchain/configs/sepolia/pgn.yaml @@ -20,3 +20,4 @@ genesis: l2_time: 1685727972 # Fri 2 Jun 2023 17:46:12 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/configs/sepolia/zora.yaml b/superchain/configs/sepolia/zora.yaml index 8f22f2e2d..ca53870e9 100644 --- a/superchain/configs/sepolia/zora.yaml +++ b/superchain/configs/sepolia/zora.yaml @@ -22,3 +22,4 @@ genesis: l2_time: 1698080004 # Mon 23 Oct 2023 16:53:24 UTC block_time: 2 +seq_window_size: 3600 diff --git a/superchain/superchain.go b/superchain/superchain.go index 91e268396..6a6dc6848 100644 --- a/superchain/superchain.go +++ b/superchain/superchain.go @@ -106,7 +106,8 @@ type ChainConfig struct { // Hardfork Configuration Overrides HardForkConfiguration `yaml:",inline"` - BlockTime uint64 `yaml:"block_time"` + BlockTime uint64 `yaml:"block_time"` + SequencerWindowSize uint64 `yaml:"seq_window_size"` // Optional feature Plasma *PlasmaConfig `yaml:"plasma,omitempty"` diff --git a/validation/rollup-config_test.go b/validation/rollup-config_test.go index 2a2e4ef29..65fb1211d 100644 --- a/validation/rollup-config_test.go +++ b/validation/rollup-config_test.go @@ -4,11 +4,13 @@ import ( "testing" . "github.com/ethereum-optimism/superchain-registry/superchain" - "github.com/ethereum-optimism/superchain-registry/validation/standard" + std "github.com/ethereum-optimism/superchain-registry/validation/standard" "github.com/stretchr/testify/require" ) func testRollupConfig(t *testing.T, chain *ChainConfig) { - require.Equal(t, chain.Plasma, standard.Config.Params[chain.Superchain].RollupConfig.Plasma, "Standard chains use Ethereum L1 calldata or blobs for data availability (plasma not permitted)") - assertIntInBounds(t, "Block Time", chain.BlockTime, standard.Config.Params[chain.Superchain].RollupConfig.BlockTime) + standard := std.Config.Params[chain.Superchain].RollupConfig + require.Equal(t, chain.Plasma, standard.Plasma, "Standard chains use Ethereum L1 calldata or blobs for data availability (plasma not permitted)") + assertIntInBounds(t, "Block Time", chain.BlockTime, standard.BlockTime) + assertIntInBounds(t, "Sequencer Window Size", chain.SequencerWindowSize, standard.SequencerWindowSize) } diff --git a/validation/standard/params.go b/validation/standard/params.go index d4758250f..0192941c9 100644 --- a/validation/standard/params.go +++ b/validation/standard/params.go @@ -42,9 +42,9 @@ type EcotoneGasPriceOracleBounds struct { } type RollupConfigBounds struct { - Plasma *superchain.PlasmaConfig `toml:"plasma"` - BlockTime [2]uint64 `toml:"block_time"` - SequencingWindowSize [2]uint64 `toml:"seq_window_size"` + Plasma *superchain.PlasmaConfig `toml:"plasma"` + BlockTime [2]uint64 `toml:"block_time"` + SequencerWindowSize [2]uint64 `toml:"seq_window_size"` } type Params struct { RollupConfig RollupConfigBounds `toml:"rollup_config"` From 39d5aa6a5ef19a0f58098488ba59ee307a561c61 Mon Sep 17 00:00:00 2001 From: geoknee Date: Sat, 13 Jul 2024 22:20:55 +0100 Subject: [PATCH 09/16] add OptimismPortal2 stamdard params and validation check --- validation/optimism-portal-2-params_test.go | 45 +++++++++++++++++++ validation/standard/params.go | 16 +++++-- .../standard-config-params-mainnet.toml | 5 +++ .../standard-config-params-sepolia.toml | 5 +++ validation/validation_test.go | 1 + 5 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 validation/optimism-portal-2-params_test.go diff --git a/validation/optimism-portal-2-params_test.go b/validation/optimism-portal-2-params_test.go new file mode 100644 index 000000000..ae81f4663 --- /dev/null +++ b/validation/optimism-portal-2-params_test.go @@ -0,0 +1,45 @@ +package validation + +import ( + "context" + "testing" + + bindings "github.com/ethereum-optimism/optimism/op-node/bindings/preview" + . "github.com/ethereum-optimism/superchain-registry/superchain" + "github.com/ethereum-optimism/superchain-registry/validation/standard" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func testOptimismPortal2Params(t *testing.T, chain *ChainConfig) { + opAddr, err := Addresses[chain.ChainID].AddressFor("OptimismPortalProxy") + require.NoError(t, err) + t.Log(opAddr) + + rpcEndpoint := chain.PublicRPC + require.NotEmpty(t, rpcEndpoint, "no public endpoint for chain") + client, err := ethclient.Dial(rpcEndpoint) + require.NoErrorf(t, err, "could not dial rpc endpoint %s", rpcEndpoint) + + op, err := bindings.NewOptimismPortal2(common.Address(opAddr), client) + require.NoError(t, err) + + callOpts := &bind.CallOpts{Context: context.Background()} + + std := standard.Config.Params[chain.Superchain].OptimismPortal2Config + + pmds, err := op.ProofMaturityDelaySeconds(callOpts) + require.NoError(t, err) + assertIntInBounds(t, "Proof Maturity Delay", pmds.Uint64(), std.ProofMaturityDelaySeconds) + + dgfds, err := op.DisputeGameFinalityDelaySeconds(callOpts) + require.NoError(t, err) + assertIntInBounds(t, "Proof Maturity Delay", dgfds.Uint64(), std.DisputeGameFinalityDelaySeconds) + + rgt, err := op.RespectedGameType(callOpts) + require.NoError(t, err) + assert.Equal(t, rgt, std.RespectedGameType) +} diff --git a/validation/standard/params.go b/validation/standard/params.go index 0192941c9..7315819a7 100644 --- a/validation/standard/params.go +++ b/validation/standard/params.go @@ -46,9 +46,17 @@ type RollupConfigBounds struct { BlockTime [2]uint64 `toml:"block_time"` SequencerWindowSize [2]uint64 `toml:"seq_window_size"` } + +type OptimismPortal2Bounds struct { + ProofMaturityDelaySeconds [2]uint64 `toml:"proof_maturity_delay_seconds"` + DisputeGameFinalityDelaySeconds [2]uint64 `toml:"dispute_game_finality_delay_seconds"` + RespectedGameType uint `toml:"respected_game_type"` +} + type Params struct { - RollupConfig RollupConfigBounds `toml:"rollup_config"` - ResourceConfig ResourceConfig `toml:"resource_config"` - GPOParams GasPriceOracleBounds `toml:"gas_price_oracle"` - SystemConfig SystemConfig `toml:"system_config"` + RollupConfig RollupConfigBounds `toml:"rollup_config"` + OptimismPortal2Config OptimismPortal2Bounds `toml:"optimism_portal_2"` + ResourceConfig ResourceConfig `toml:"resource_config"` + GPOParams GasPriceOracleBounds `toml:"gas_price_oracle"` + SystemConfig SystemConfig `toml:"system_config"` } diff --git a/validation/standard/standard-config-params-mainnet.toml b/validation/standard/standard-config-params-mainnet.toml index 4bc9d9ca5..0d1954ba4 100644 --- a/validation/standard/standard-config-params-mainnet.toml +++ b/validation/standard/standard-config-params-mainnet.toml @@ -4,6 +4,11 @@ seq_window_size = [3600, 3600] block_time = [2, 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 diff --git a/validation/standard/standard-config-params-sepolia.toml b/validation/standard/standard-config-params-sepolia.toml index abf4a9f99..80884eb5c 100644 --- a/validation/standard/standard-config-params-sepolia.toml +++ b/validation/standard/standard-config-params-sepolia.toml @@ -4,6 +4,11 @@ seq_window_size = [3600, 3600] block_time = [2, 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 diff --git a/validation/validation_test.go b/validation/validation_test.go index c8f0b1ba3..4eb12f016 100644 --- a/validation/validation_test.go +++ b/validation/validation_test.go @@ -55,6 +55,7 @@ func testUniversal(t *testing.T, chain *ChainConfig) { func testStandardCandidate(t *testing.T, chain *ChainConfig) { // Standard Config Params t.Run("Rollup Config", func(t *testing.T) { testRollupConfig(t, chain) }) + t.Run("Optimism Portal 2 Params", func(t *testing.T) { testOptimismPortal2Params(t, chain) }) t.Run("Resource Config", func(t *testing.T) { testResourceConfig(t, chain) }) t.Run("Gas Limit", func(t *testing.T) { testGasLimit(t, chain) }) t.Run("GPO Params", func(t *testing.T) { testGasPriceOracleParams(t, chain) }) From 149bcad59f132f83af1e2801c2daea57ad0fb2ab Mon Sep 17 00:00:00 2001 From: geoknee Date: Sat, 13 Jul 2024 22:23:21 +0100 Subject: [PATCH 10/16] fix bugs --- validation/optimism-portal-2-params_test.go | 5 +++-- validation/standard/params.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/validation/optimism-portal-2-params_test.go b/validation/optimism-portal-2-params_test.go index ae81f4663..7dc180e96 100644 --- a/validation/optimism-portal-2-params_test.go +++ b/validation/optimism-portal-2-params_test.go @@ -19,7 +19,8 @@ func testOptimismPortal2Params(t *testing.T, chain *ChainConfig) { require.NoError(t, err) t.Log(opAddr) - rpcEndpoint := chain.PublicRPC + rpcEndpoint := Superchains[chain.Superchain].Config.L1.PublicRPC + require.NotEmpty(t, rpcEndpoint, "no public endpoint for chain") client, err := ethclient.Dial(rpcEndpoint) require.NoErrorf(t, err, "could not dial rpc endpoint %s", rpcEndpoint) @@ -37,7 +38,7 @@ func testOptimismPortal2Params(t *testing.T, chain *ChainConfig) { dgfds, err := op.DisputeGameFinalityDelaySeconds(callOpts) require.NoError(t, err) - assertIntInBounds(t, "Proof Maturity Delay", dgfds.Uint64(), std.DisputeGameFinalityDelaySeconds) + assertIntInBounds(t, "Dispute Game Finality Delay Seconds", dgfds.Uint64(), std.DisputeGameFinalityDelaySeconds) rgt, err := op.RespectedGameType(callOpts) require.NoError(t, err) diff --git a/validation/standard/params.go b/validation/standard/params.go index 7315819a7..8717f95a2 100644 --- a/validation/standard/params.go +++ b/validation/standard/params.go @@ -50,7 +50,7 @@ type RollupConfigBounds struct { type OptimismPortal2Bounds struct { ProofMaturityDelaySeconds [2]uint64 `toml:"proof_maturity_delay_seconds"` DisputeGameFinalityDelaySeconds [2]uint64 `toml:"dispute_game_finality_delay_seconds"` - RespectedGameType uint `toml:"respected_game_type"` + RespectedGameType uint32 `toml:"respected_game_type"` } type Params struct { From 0a8b6b7a283456ec3a8a1411da17e6fa11deea06 Mon Sep 17 00:00:00 2001 From: geoknee Date: Sat, 13 Jul 2024 23:20:37 +0100 Subject: [PATCH 11/16] fix exclusions and devnet params for optimismportal2 params --- validation/exclusions_test.go | 16 ++++++++++++++++ validation/optimism-portal-2-params_test.go | 2 +- .../standard-config-params-sepolia-dev-0.toml | 10 ++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/validation/exclusions_test.go b/validation/exclusions_test.go index f51ce4a7a..ad3d412f2 100644 --- a/validation/exclusions_test.go +++ b/validation/exclusions_test.go @@ -72,6 +72,22 @@ var exclusions = map[string]map[uint64]bool{ 11155421: true, // sepolia-dev0/oplabs-devnet-0" 11763072: true, // sepolia-dev0/base-devnet-0" }, + "Optimism_Portal_2_Params": { + 10: true, // mainnet/op MCP (at time of writing) + 8453: true, // mainnet/base MCP (at time of writing) + 957: true, // mainnet/lyra MCP (at time of writing) + 1750: true, // mainnet/metal MCP (at time of writing) + 34443: true, // mainnet/mode MCP (at time of writing) + 291: true, // mainnet/orderly MCP (at time of writing) + 424: true, // mainnet/pgn MCP (at time of writing) + 7777777: true, // mainnet/zora MCP (at time of writing) + 11155420: true, // sepolia/op MCP (at time of writing) + 84532: true, // sepolia/base MCP (at time of writing) + 919: true, // sepolia/mode MCP (at time of writing) + 58008: true, // sepolia/pgn MCP (at time of writing) + 999999999: true, // sepolia/zora MCP (at time of writing) + 11763072: true, // sepolia-dev0/base-devnet-0" + }, "Uniqueness_Check": { 11155421: true, // oplabs devnet 0, not in upstream repo 11763072: true, // base devnet 0, not in upstream repo} diff --git a/validation/optimism-portal-2-params_test.go b/validation/optimism-portal-2-params_test.go index 7dc180e96..89dc2a1ac 100644 --- a/validation/optimism-portal-2-params_test.go +++ b/validation/optimism-portal-2-params_test.go @@ -15,9 +15,9 @@ import ( ) func testOptimismPortal2Params(t *testing.T, chain *ChainConfig) { + skipIfExcluded(t, chain.ChainID) opAddr, err := Addresses[chain.ChainID].AddressFor("OptimismPortalProxy") require.NoError(t, err) - t.Log(opAddr) rpcEndpoint := Superchains[chain.Superchain].Config.L1.PublicRPC diff --git a/validation/standard/standard-config-params-sepolia-dev-0.toml b/validation/standard/standard-config-params-sepolia-dev-0.toml index 2c32d1c37..5f70b94d4 100644 --- a/validation/standard/standard-config-params-sepolia-dev-0.toml +++ b/validation/standard/standard-config-params-sepolia-dev-0.toml @@ -1,4 +1,14 @@ # Standard Chain Config Parameters +[rollup_config] +# plasma must be nil +seq_window_size = [3600, 3600] +block_time = [2, 2] + +[optimism_portal_2] +proof_maturity_delay_seconds = [1200, 604800] # 7 days +dispute_game_finality_delay_seconds = [600, 302400] # 2.5 days +respected_game_type = 0 + [resource_config] max_resource_limit = 20000000 elasticity_multiplier = 10 From 9223f5433452c6be5d184093810ba954d75a14ab Mon Sep 17 00:00:00 2001 From: geoknee Date: Mon, 15 Jul 2024 22:06:15 +0100 Subject: [PATCH 12/16] remove some exclusions --- validation/exclusions_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/validation/exclusions_test.go b/validation/exclusions_test.go index ad3d412f2..feb727f4e 100644 --- a/validation/exclusions_test.go +++ b/validation/exclusions_test.go @@ -56,7 +56,6 @@ var exclusions = map[string]map[uint64]bool{ 11763072: true, // sepolia-dev-0/base-devnet-0 No Public RPC declared }, "Standard_Contract_Versions": { - 10: true, // mainnet/op MCP (at time of writing) 8453: true, // mainnet/base MCP (at time of writing) 957: true, // mainnet/lyra MCP (at time of writing) 1750: true, // mainnet/metal MCP (at time of writing) @@ -64,7 +63,6 @@ var exclusions = map[string]map[uint64]bool{ 291: true, // mainnet/orderly MCP (at time of writing) 424: true, // mainnet/pgn MCP (at time of writing) 7777777: true, // mainnet/zora MCP (at time of writing) - 11155420: true, // sepolia/op MCP (at time of writing) 84532: true, // sepolia/base MCP (at time of writing) 919: true, // sepolia/mode MCP (at time of writing) 58008: true, // sepolia/pgn MCP (at time of writing) @@ -73,7 +71,6 @@ var exclusions = map[string]map[uint64]bool{ 11763072: true, // sepolia-dev0/base-devnet-0" }, "Optimism_Portal_2_Params": { - 10: true, // mainnet/op MCP (at time of writing) 8453: true, // mainnet/base MCP (at time of writing) 957: true, // mainnet/lyra MCP (at time of writing) 1750: true, // mainnet/metal MCP (at time of writing) @@ -81,7 +78,6 @@ var exclusions = map[string]map[uint64]bool{ 291: true, // mainnet/orderly MCP (at time of writing) 424: true, // mainnet/pgn MCP (at time of writing) 7777777: true, // mainnet/zora MCP (at time of writing) - 11155420: true, // sepolia/op MCP (at time of writing) 84532: true, // sepolia/base MCP (at time of writing) 919: true, // sepolia/mode MCP (at time of writing) 58008: true, // sepolia/pgn MCP (at time of writing) From 8422aca2afeed0197fdc0fca104b80e707a4fa2b Mon Sep 17 00:00:00 2001 From: geoknee Date: Mon, 15 Jul 2024 22:18:49 +0100 Subject: [PATCH 13/16] remove cruft --- validation/exclusions_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/validation/exclusions_test.go b/validation/exclusions_test.go index feb727f4e..136b25d5e 100644 --- a/validation/exclusions_test.go +++ b/validation/exclusions_test.go @@ -67,8 +67,8 @@ var exclusions = map[string]map[uint64]bool{ 919: true, // sepolia/mode MCP (at time of writing) 58008: true, // sepolia/pgn MCP (at time of writing) 999999999: true, // sepolia/zora MCP (at time of writing) - 11155421: true, // sepolia-dev0/oplabs-devnet-0" - 11763072: true, // sepolia-dev0/base-devnet-0" + 11155421: true, // sepolia-dev0/oplabs-devnet-0 + 11763072: true, // sepolia-dev0/base-devnet-0 }, "Optimism_Portal_2_Params": { 8453: true, // mainnet/base MCP (at time of writing) @@ -82,10 +82,10 @@ var exclusions = map[string]map[uint64]bool{ 919: true, // sepolia/mode MCP (at time of writing) 58008: true, // sepolia/pgn MCP (at time of writing) 999999999: true, // sepolia/zora MCP (at time of writing) - 11763072: true, // sepolia-dev0/base-devnet-0" + 11763072: true, // sepolia-dev0/base-devnet-0 }, "Uniqueness_Check": { 11155421: true, // oplabs devnet 0, not in upstream repo - 11763072: true, // base devnet 0, not in upstream repo} + 11763072: true, // base devnet 0, not in upstream repo }, } From 42ecdc416c3c45e7a03f9e843427e8fad7ae9722 Mon Sep 17 00:00:00 2001 From: geoknee Date: Mon, 15 Jul 2024 22:30:38 +0100 Subject: [PATCH 14/16] add 5s timeout to RPC calls --- validation/optimism-portal-2-params_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/validation/optimism-portal-2-params_test.go b/validation/optimism-portal-2-params_test.go index 89dc2a1ac..5a412beb1 100644 --- a/validation/optimism-portal-2-params_test.go +++ b/validation/optimism-portal-2-params_test.go @@ -3,6 +3,7 @@ package validation import ( "context" "testing" + "time" bindings "github.com/ethereum-optimism/optimism/op-node/bindings/preview" . "github.com/ethereum-optimism/superchain-registry/superchain" @@ -28,7 +29,8 @@ func testOptimismPortal2Params(t *testing.T, chain *ChainConfig) { op, err := bindings.NewOptimismPortal2(common.Address(opAddr), client) require.NoError(t, err) - callOpts := &bind.CallOpts{Context: context.Background()} + ctx, _ := context.WithTimeout(context.Background(), 5*time.Second) + callOpts := &bind.CallOpts{Context: ctx} std := standard.Config.Params[chain.Superchain].OptimismPortal2Config From 45bb82d1cfdef7e1f187f163c7fefb97f8ef9df5 Mon Sep 17 00:00:00 2001 From: geoknee Date: Mon, 15 Jul 2024 22:35:22 +0100 Subject: [PATCH 15/16] lint --- validation/exclusions_test.go | 2 +- validation/optimism-portal-2-params_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/validation/exclusions_test.go b/validation/exclusions_test.go index 5f6453322..a16a90d22 100644 --- a/validation/exclusions_test.go +++ b/validation/exclusions_test.go @@ -77,7 +77,7 @@ var exclusions = map[string]map[uint64]bool{ 58008: true, // sepolia/pgn MCP (at time of writing) 999999999: true, // sepolia/zora MCP (at time of writing) 11763072: true, // sepolia-dev0/base-devnet-0 - } + }, } func TestExclusions(t *testing.T) { diff --git a/validation/optimism-portal-2-params_test.go b/validation/optimism-portal-2-params_test.go index 5a412beb1..86eef2686 100644 --- a/validation/optimism-portal-2-params_test.go +++ b/validation/optimism-portal-2-params_test.go @@ -29,7 +29,8 @@ func testOptimismPortal2Params(t *testing.T, chain *ChainConfig) { op, err := bindings.NewOptimismPortal2(common.Address(opAddr), client) require.NoError(t, err) - ctx, _ := context.WithTimeout(context.Background(), 5*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() callOpts := &bind.CallOpts{Context: ctx} std := standard.Config.Params[chain.Superchain].OptimismPortal2Config From 41567d6e5c30b58c8b13f6e35e4bb5d763aad826 Mon Sep 17 00:00:00 2001 From: geoknee Date: Mon, 15 Jul 2024 22:37:15 +0100 Subject: [PATCH 16/16] remove unecessary isFaultProofs bool --- validation/superchain-version_test.go | 29 +++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/validation/superchain-version_test.go b/validation/superchain-version_test.go index 8fc40c8b6..8b3820e32 100644 --- a/validation/superchain-version_test.go +++ b/validation/superchain-version_test.go @@ -28,17 +28,15 @@ func testContractsMatchATag(t *testing.T, chain *ChainConfig) { client, err := ethclient.Dial(rpcEndpoint) require.NoErrorf(t, err, "could not dial rpc endpoint %s", rpcEndpoint) - isFaultProofs := true - - versions, err := getContractVersionsFromChain(*Addresses[chain.ChainID], client, isFaultProofs) + versions, err := getContractVersionsFromChain(*Addresses[chain.ChainID], client) require.NoError(t, err) _, err = findOPContractTag(versions) require.NoError(t, err) } -// getContractVersionsFromChain pulls the appropriate contract versions (depending on the isFaultProofs argument) from chain +// getContractVersionsFromChain pulls the appropriate contract versions from chain // using the supplied client (calling the version() method for each contract). It does this concurrently. -func getContractVersionsFromChain(list AddressList, client *ethclient.Client, isFaultProofs bool) (ContractVersions, error) { +func getContractVersionsFromChain(list AddressList, client *ethclient.Client) (ContractVersions, error) { // build up list of contracts to check contractsToCheck := []string{ "L1CrossDomainMessengerProxy", @@ -47,20 +45,13 @@ func getContractVersionsFromChain(list AddressList, client *ethclient.Client, is "OptimismMintableERC20FactoryProxy", "OptimismPortalProxy", "SystemConfigProxy", - } - - if !isFaultProofs { - contractsToCheck = append(contractsToCheck, "L2OutputOracleProxy") - } else { - contractsToCheck = append(contractsToCheck, - "AnchorStateRegistryProxy", - "DelayedWETHProxy", - "DisputeGameFactoryProxy", - "FaultDisputeGame", - "MIPS", - "PermissionedDisputeGame", - "PreimageOracle", - ) + "AnchorStateRegistryProxy", + "DelayedWETHProxy", + "DisputeGameFactoryProxy", + "FaultDisputeGame", + "MIPS", + "PermissionedDisputeGame", + "PreimageOracle", } // Prepare a concurrency-safe object to store version information in, and