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

Update dispute game contracts for oplabs-devnet-0 and op-sepolia #789

Open
wants to merge 5 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
12 changes: 8 additions & 4 deletions superchain/configs/configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2285,15 +2285,17 @@
"Challenger": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"DelayedWETHProxy": "0xcdFdC692a53B4aE9F81E0aEBd26107Da4a71dB84",
"DisputeGameFactoryProxy": "0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1",
"FaultDisputeGame": "0xD9d616E4a03a8e7cC962396C9f8D4e3d306097D3",
"FaultDisputeGame": "0x924D3d3B3b16E74bAb577e50d23b2a38990dD52C",
"Guardian": "0x7a50f00e8D05b95F98fE38d8BeE366a7324dCf7E",
"L1CrossDomainMessengerProxy": "0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef",
"L1ERC721BridgeProxy": "0xd83e03D576d23C9AEab8cC44Fa98d058D2176D1f",
"L1StandardBridgeProxy": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"MIPS": "0x47B0E34C1054009e696BaBAAd56165e1e994144d",
"MIPS64": "0xa1e470B6bD25e8EEA9FFCdA6a1518BE5eb8eE7bb",
"OptimismMintableERC20FactoryProxy": "0x868D59fF9710159C2B330Cc0fBDF57144dD7A13b",
"OptimismPortalProxy": "0x16Fc5058F25648194471939df75CF27A2fdC48BC",
"PermissionedDisputeGame": "0x98E3F752c7224F8322Afa935a4CaEC3832bB25c9",
"PermissionedDelayedWETHProxy": "0x67A2907A05E1F3A5a8fB49cD2dfA8537459Ce078",
"PermissionedDisputeGame": "0x879e899523bA9a4Ab212a2d70cF1af73B906CbE5",
"PreimageOracle": "0x92240135b46fc1142dA181f550aE8f595B858854",
"Proposer": "0x49277EE36A024120Ee218127354c4a3591dc90A9",
"ProxyAdmin": "0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc",
Expand Down Expand Up @@ -2503,15 +2505,17 @@
"Challenger": "0x8c20c40180751d93E939DDDee3517AE0d1EBeAd2",
"DelayedWETHProxy": "0xE99696a028171e31a72828A196C27c2Dd670E1aa",
"DisputeGameFactoryProxy": "0x2419423C72998eb1c6c15A235de2f112f8E38efF",
"FaultDisputeGame": "0x54416A2E28E8cbC761fbce0C7f107307991282e5",
"FaultDisputeGame": "0x030aca4aea0CF48BD53dca03b34e35D05B9635C7",
"Guardian": "0x8c20c40180751d93E939DDDee3517AE0d1EBeAd2",
"L1CrossDomainMessengerProxy": "0x18e72C15FEE4e995454b919EfaA61D8f116F82dd",
"L1ERC721BridgeProxy": "0x1bb726658E039E8a9A4ac21A41fE5a0704760461",
"L1StandardBridgeProxy": "0x6D8bC564EF04AaF355a10c3eb9b00e349dd077ea",
"MIPS": "0xceDE5949A189aC60F41F1385a86DBce7Bd3B1943",
"MIPS64": "0x2B82752b3809A6B7f1662536aF72c519000610e3",
"OptimismMintableERC20FactoryProxy": "0xA16b8db3b5Cdbaf75158F34034B0537e528E17e2",
"OptimismPortalProxy": "0x76114bd29dFcC7a9892240D317E6c7C2A281Ffc6",
"PermissionedDisputeGame": "0x50573970b291726B881b204eD9F3c1D507e504cD",
"PermissionedDelayedWETHProxy": "0x81B05Ce22EC8E79078d58df7DE44957bD3C93125",
"PermissionedDisputeGame": "0x4001542871a610A551b11DCAaeA52dC5CA6FDB6a",
"PreimageOracle": "0xB73342DdD69620e5Ab2Cc604Dad46434C2338025",
"Proposer": "0x95014c45078354Ff839f14192228108Eac82E00A",
"ProxyAdmin": "0x18d890A46A3556e7F36f28C79F6157BC7a59f867",
Expand Down
6 changes: 4 additions & 2 deletions superchain/configs/sepolia-dev-0/oplabs-devnet-0.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ data_availability_type = "eth-da"
ProxyAdmin = "0x18d890A46A3556e7F36f28C79F6157BC7a59f867"
AnchorStateRegistryProxy = "0x03b82AE60989863BCEb0BbD442A70568e5AefB85"
DelayedWETHProxy = "0xE99696a028171e31a72828A196C27c2Dd670E1aa"
PermissionedDelayedWETHProxy = "0x81B05Ce22EC8E79078d58df7DE44957bD3C93125"
DisputeGameFactoryProxy = "0x2419423C72998eb1c6c15A235de2f112f8E38efF"
FaultDisputeGame = "0x54416A2E28E8cbC761fbce0C7f107307991282e5"
FaultDisputeGame = "0x030aca4aea0CF48BD53dca03b34e35D05B9635C7"
MIPS = "0xceDE5949A189aC60F41F1385a86DBce7Bd3B1943"
PermissionedDisputeGame = "0x50573970b291726B881b204eD9F3c1D507e504cD"
MIPS64 = "0x2B82752b3809A6B7f1662536aF72c519000610e3"
PermissionedDisputeGame = "0x4001542871a610A551b11DCAaeA52dC5CA6FDB6a"
PreimageOracle = "0xB73342DdD69620e5Ab2Cc604Dad46434C2338025"
6 changes: 4 additions & 2 deletions superchain/configs/sepolia/op.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ data_availability_type = "eth-da"
ProxyAdmin = "0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc"
AnchorStateRegistryProxy = "0x218CD9489199F321E1177b56385d333c5B598629"
DelayedWETHProxy = "0xcdFdC692a53B4aE9F81E0aEBd26107Da4a71dB84"
PermissionedDelayedWETHProxy = "0x67A2907A05E1F3A5a8fB49cD2dfA8537459Ce078"
DisputeGameFactoryProxy = "0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1"
FaultDisputeGame = "0xD9d616E4a03a8e7cC962396C9f8D4e3d306097D3"
FaultDisputeGame = "0x924D3d3B3b16E74bAb577e50d23b2a38990dD52C"
MIPS = "0x47B0E34C1054009e696BaBAAd56165e1e994144d"
PermissionedDisputeGame = "0x98E3F752c7224F8322Afa935a4CaEC3832bB25c9"
MIPS64 = "0xa1e470B6bD25e8EEA9FFCdA6a1518BE5eb8eE7bb"
PermissionedDisputeGame = "0x879e899523bA9a4Ab212a2d70cF1af73B906CbE5"
PreimageOracle = "0x92240135b46fc1142dA181f550aE8f595B858854"
12 changes: 8 additions & 4 deletions superchain/extra/addresses/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@
"Challenger": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"DelayedWETHProxy": "0xcdFdC692a53B4aE9F81E0aEBd26107Da4a71dB84",
"DisputeGameFactoryProxy": "0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1",
"FaultDisputeGame": "0xD9d616E4a03a8e7cC962396C9f8D4e3d306097D3",
"FaultDisputeGame": "0x924D3d3B3b16E74bAb577e50d23b2a38990dD52C",
"Guardian": "0x7a50f00e8D05b95F98fE38d8BeE366a7324dCf7E",
"L1CrossDomainMessengerProxy": "0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef",
"L1ERC721BridgeProxy": "0xd83e03D576d23C9AEab8cC44Fa98d058D2176D1f",
"L1StandardBridgeProxy": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"MIPS": "0x47B0E34C1054009e696BaBAAd56165e1e994144d",
"MIPS64": "0xa1e470B6bD25e8EEA9FFCdA6a1518BE5eb8eE7bb",
"OptimismMintableERC20FactoryProxy": "0x868D59fF9710159C2B330Cc0fBDF57144dD7A13b",
"OptimismPortalProxy": "0x16Fc5058F25648194471939df75CF27A2fdC48BC",
"PermissionedDisputeGame": "0x98E3F752c7224F8322Afa935a4CaEC3832bB25c9",
"PermissionedDelayedWETHProxy": "0x67A2907A05E1F3A5a8fB49cD2dfA8537459Ce078",
"PermissionedDisputeGame": "0x879e899523bA9a4Ab212a2d70cF1af73B906CbE5",
"PreimageOracle": "0x92240135b46fc1142dA181f550aE8f595B858854",
"Proposer": "0x49277EE36A024120Ee218127354c4a3591dc90A9",
"ProxyAdmin": "0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc",
Expand All @@ -78,15 +80,17 @@
"Challenger": "0x8c20c40180751d93E939DDDee3517AE0d1EBeAd2",
"DelayedWETHProxy": "0xE99696a028171e31a72828A196C27c2Dd670E1aa",
"DisputeGameFactoryProxy": "0x2419423C72998eb1c6c15A235de2f112f8E38efF",
"FaultDisputeGame": "0x54416A2E28E8cbC761fbce0C7f107307991282e5",
"FaultDisputeGame": "0x030aca4aea0CF48BD53dca03b34e35D05B9635C7",
"Guardian": "0x8c20c40180751d93E939DDDee3517AE0d1EBeAd2",
"L1CrossDomainMessengerProxy": "0x18e72C15FEE4e995454b919EfaA61D8f116F82dd",
"L1ERC721BridgeProxy": "0x1bb726658E039E8a9A4ac21A41fE5a0704760461",
"L1StandardBridgeProxy": "0x6D8bC564EF04AaF355a10c3eb9b00e349dd077ea",
"MIPS": "0xceDE5949A189aC60F41F1385a86DBce7Bd3B1943",
"MIPS64": "0x2B82752b3809A6B7f1662536aF72c519000610e3",
"OptimismMintableERC20FactoryProxy": "0xA16b8db3b5Cdbaf75158F34034B0537e528E17e2",
"OptimismPortalProxy": "0x76114bd29dFcC7a9892240D317E6c7C2A281Ffc6",
"PermissionedDisputeGame": "0x50573970b291726B881b204eD9F3c1D507e504cD",
"PermissionedDelayedWETHProxy": "0x81B05Ce22EC8E79078d58df7DE44957bD3C93125",
"PermissionedDisputeGame": "0x4001542871a610A551b11DCAaeA52dC5CA6FDB6a",
"PreimageOracle": "0xB73342DdD69620e5Ab2Cc604Dad46434C2338025",
"Proposer": "0x95014c45078354Ff839f14192228108Eac82E00A",
"ProxyAdmin": "0x18d890A46A3556e7F36f28C79F6157BC7a59f867",
Expand Down
18 changes: 11 additions & 7 deletions superchain/superchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,15 @@ type AddressList struct {
SuperchainConfig Address `json:"SuperchainConfig,omitempty" toml:"SuperchainConfig,omitempty"`

// Fault Proof contracts:
AnchorStateRegistryProxy Address `json:"AnchorStateRegistryProxy,omitempty" toml:"AnchorStateRegistryProxy,omitempty"`
DelayedWETHProxy Address `json:"DelayedWETHProxy,omitempty" toml:"DelayedWETHProxy,omitempty"`
DisputeGameFactoryProxy Address `json:"DisputeGameFactoryProxy,omitempty" toml:"DisputeGameFactoryProxy,omitempty"`
FaultDisputeGame Address `json:"FaultDisputeGame,omitempty" toml:"FaultDisputeGame,omitempty"`
MIPS Address `json:"MIPS,omitempty" toml:"MIPS,omitempty"`
PermissionedDisputeGame Address `json:"PermissionedDisputeGame,omitempty" toml:"PermissionedDisputeGame,omitempty"`
PreimageOracle Address `json:"PreimageOracle,omitempty" toml:"PreimageOracle,omitempty"`
AnchorStateRegistryProxy Address `json:"AnchorStateRegistryProxy,omitempty" toml:"AnchorStateRegistryProxy,omitempty"`
DelayedWETHProxy Address `json:"DelayedWETHProxy,omitempty" toml:"DelayedWETHProxy,omitempty"`
PermissionedDelayedWETHProxy Address `json:"PermissionedDelayedWETHProxy,omitempty" toml:"PermissionedDelayedWETHProxy,omitempty"`
DisputeGameFactoryProxy Address `json:"DisputeGameFactoryProxy,omitempty" toml:"DisputeGameFactoryProxy,omitempty"`
FaultDisputeGame Address `json:"FaultDisputeGame,omitempty" toml:"FaultDisputeGame,omitempty"`
MIPS Address `json:"MIPS,omitempty" toml:"MIPS,omitempty"`
MIPS64 Address `json:"MIPS64,omitempty" toml:"MIPS64,omitempty"`
PermissionedDisputeGame Address `json:"PermissionedDisputeGame,omitempty" toml:"PermissionedDisputeGame,omitempty"`
PreimageOracle Address `json:"PreimageOracle,omitempty" toml:"PreimageOracle,omitempty"`

// AltDA contracts:
DAChallengeAddress Address `json:"DAChallengeAddress,omitempty" toml:"DAChallengeAddress,omitempty"`
Expand Down Expand Up @@ -354,9 +356,11 @@ type MappedContractProperties[T string | VersionedContract] struct {
// Fault Proof contracts:
AnchorStateRegistry T `toml:"anchor_state_registry,omitempty"`
DelayedWETH T `toml:"delayed_weth,omitempty"`
PermissionedDelayedWETH T `toml:"permissioned_delayed_weth,omitempty"`
DisputeGameFactory T `toml:"dispute_game_factory,omitempty"`
FaultDisputeGame T `toml:"fault_dispute_game,omitempty"`
MIPS T `toml:"mips,omitempty"`
MIPS64 T `toml:"mips64,omitempty"`
PermissionedDisputeGame T `toml:"permissioned_dispute_game,omitempty"`
PreimageOracle T `toml:"preimage_oracle,omitempty"`
CannonFaultDisputeGame T `toml:"cannon_fault_dispute_game,omitempty"`
Expand Down
24 changes: 22 additions & 2 deletions validation/fault_game_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ func testFaultGameParams(t *testing.T, chain *ChainConfig) {
delayedWethAddr, err := Addresses[chain.ChainID].AddressFor("DelayedWETHProxy")
require.NoError(t, err)

permissionedDelayedWethAddr, err := Addresses[chain.ChainID].AddressFor("PermissionedDelayedWETHProxy")
require.NoError(t, err)

optimismPortalAddr, err := Addresses[chain.ChainID].AddressFor("OptimismPortalProxy")
require.NoError(t, err)

Expand Down Expand Up @@ -66,9 +69,21 @@ func testFaultGameParams(t *testing.T, chain *ChainConfig) {
require.NoError(t, err)
require.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000002a30", clockExtension[0], "PermissionedDisputeGame: game clock extension") // 10800 sec = 3 hours

absolutePrestate, err := CastCall(permissionedDisputeGameAddr, "absolutePrestate()", nil, rpcEndpoint)
vm, err := CastCall(permissionedDisputeGameAddr, "vm()(address)", nil, rpcEndpoint)
require.NoError(t, err)
isMainnet := chain.Superchain == "mainnet"
mips64Address, err := Addresses[chain.ChainID].AddressFor("MIPS64")
require.NoError(t, err)
require.Truef(t, findOpProgramRelease(t, absolutePrestate[0], chain.Superchain), "onchain op-program prestate hash is not from a standard version: %v", absolutePrestate[0])
vmAddress := MustHexToAddress(vm[0])
isMips64 := vmAddress == mips64Address
// TODO: This is a temporary workaround to avoid checking the absolute prestate on testnets
// The prestates registry cannot disambiguate between MIPS and MIPS64 prestates for the same op-program release.
// This limitation is temporary as once the superchain is upgraded to MIPS64, all op-program prestate releases will implicitly be MIPS64 prestates.
if isMainnet || !isMips64 {
absolutePrestate, err := CastCall(permissionedDisputeGameAddr, "absolutePrestate()", nil, rpcEndpoint)
require.NoError(t, err)
require.Truef(t, findOpProgramRelease(t, absolutePrestate[0], chain.Superchain), "onchain op-program prestate hash is not from a standard version: %v", absolutePrestate[0])
}

// PreimageOracle
challengePeriod, err := CastCall(preimageOracleAddr, "challengePeriod()", nil, rpcEndpoint)
Expand All @@ -83,6 +98,11 @@ func testFaultGameParams(t *testing.T, chain *ChainConfig) {
wethDelay, err := CastCall(delayedWethAddr, "delay()", nil, rpcEndpoint)
require.NoError(t, err)
require.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000093a80", wethDelay[0], "DelayedWETH: bond withdrawal delay") // 604800 sec = 7 days

// PermissionedDelayedWETH
pwethDelay, err := CastCall(permissionedDelayedWethAddr, "delay()", nil, rpcEndpoint)
require.NoError(t, err)
require.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000093a80", pwethDelay[0], "PermissionedDelayedWETH: bond withdrawal delay") // 604800 sec = 7 days
}

func findOpProgramRelease(t *testing.T, hash string, superchain string) bool {
Expand Down