Skip to content

Commit b37a1ae

Browse files
feat: interop portal fast follow 1 (#14785)
* feat: interop portal fast follow 1 First set of fast-follow changes to the interop portal. * fix: PR review feedback
1 parent ff32710 commit b37a1ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+558
-434
lines changed

Diff for: op-chain-ops/interopgen/configs.go

+9-10
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,15 @@ type L2Config struct {
7474
Challenger common.Address
7575
SystemConfigOwner common.Address
7676
genesis.L2InitializationConfig
77-
Prefund map[common.Address]*big.Int
78-
SaltMixer string
79-
GasLimit uint64
80-
DisputeGameUsesSuperRoots bool
81-
DisputeGameType uint32
82-
DisputeAbsolutePrestate common.Hash
83-
DisputeMaxGameDepth uint64
84-
DisputeSplitDepth uint64
85-
DisputeClockExtension uint64
86-
DisputeMaxClockDuration uint64
77+
Prefund map[common.Address]*big.Int
78+
SaltMixer string
79+
GasLimit uint64
80+
DisputeGameType uint32
81+
DisputeAbsolutePrestate common.Hash
82+
DisputeMaxGameDepth uint64
83+
DisputeSplitDepth uint64
84+
DisputeClockExtension uint64
85+
DisputeMaxClockDuration uint64
8786
}
8887

8988
func (c *L2Config) Check(log log.Logger) error {

Diff for: op-chain-ops/interopgen/deploy.go

+18-19
Original file line numberDiff line numberDiff line change
@@ -198,25 +198,24 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
198198
l1Host.SetTxOrigin(cfg.Deployer)
199199

200200
output, err := opcm.DeployOPChain(l1Host, opcm.DeployOPChainInput{
201-
OpChainProxyAdminOwner: cfg.ProxyAdminOwner,
202-
SystemConfigOwner: cfg.SystemConfigOwner,
203-
Batcher: cfg.BatchSenderAddress,
204-
UnsafeBlockSigner: cfg.P2PSequencerAddress,
205-
Proposer: cfg.Proposer,
206-
Challenger: cfg.Challenger,
207-
BasefeeScalar: cfg.GasPriceOracleBaseFeeScalar,
208-
BlobBaseFeeScalar: cfg.GasPriceOracleBlobBaseFeeScalar,
209-
L2ChainId: new(big.Int).SetUint64(cfg.L2ChainID),
210-
Opcm: superDeployment.Opcm,
211-
SaltMixer: cfg.SaltMixer,
212-
GasLimit: cfg.GasLimit,
213-
DisputeGameUsesSuperRoots: cfg.DisputeGameUsesSuperRoots,
214-
DisputeGameType: cfg.DisputeGameType,
215-
DisputeAbsolutePrestate: cfg.DisputeAbsolutePrestate,
216-
DisputeMaxGameDepth: cfg.DisputeMaxGameDepth,
217-
DisputeSplitDepth: cfg.DisputeSplitDepth,
218-
DisputeClockExtension: cfg.DisputeClockExtension,
219-
DisputeMaxClockDuration: cfg.DisputeMaxClockDuration,
201+
OpChainProxyAdminOwner: cfg.ProxyAdminOwner,
202+
SystemConfigOwner: cfg.SystemConfigOwner,
203+
Batcher: cfg.BatchSenderAddress,
204+
UnsafeBlockSigner: cfg.P2PSequencerAddress,
205+
Proposer: cfg.Proposer,
206+
Challenger: cfg.Challenger,
207+
BasefeeScalar: cfg.GasPriceOracleBaseFeeScalar,
208+
BlobBaseFeeScalar: cfg.GasPriceOracleBlobBaseFeeScalar,
209+
L2ChainId: new(big.Int).SetUint64(cfg.L2ChainID),
210+
Opcm: superDeployment.Opcm,
211+
SaltMixer: cfg.SaltMixer,
212+
GasLimit: cfg.GasLimit,
213+
DisputeGameType: cfg.DisputeGameType,
214+
DisputeAbsolutePrestate: cfg.DisputeAbsolutePrestate,
215+
DisputeMaxGameDepth: cfg.DisputeMaxGameDepth,
216+
DisputeSplitDepth: cfg.DisputeSplitDepth,
217+
DisputeClockExtension: cfg.DisputeClockExtension,
218+
DisputeMaxClockDuration: cfg.DisputeMaxClockDuration,
220219
})
221220
if err != nil {
222221
return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err)

Diff for: op-chain-ops/interopgen/recipe.go

+9-10
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,15 @@ func (r *InteropDevL2Recipe) build(l1ChainID uint64, addrs devkeys.Addresses) (*
275275
UseAltDA: false,
276276
},
277277
},
278-
Prefund: make(map[common.Address]*big.Int),
279-
SaltMixer: "",
280-
GasLimit: 60_000_000,
281-
DisputeGameUsesSuperRoots: true,
282-
DisputeGameType: 1, // PERMISSIONED_CANNON Game Type
283-
DisputeAbsolutePrestate: common.HexToHash("0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"),
284-
DisputeMaxGameDepth: 73,
285-
DisputeSplitDepth: 30,
286-
DisputeClockExtension: 10800, // 3 hours (input in seconds)
287-
DisputeMaxClockDuration: 302400, // 3.5 days (input in seconds)
278+
Prefund: make(map[common.Address]*big.Int),
279+
SaltMixer: "",
280+
GasLimit: 60_000_000,
281+
DisputeGameType: 1, // PERMISSIONED_CANNON Game Type
282+
DisputeAbsolutePrestate: common.HexToHash("0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"),
283+
DisputeMaxGameDepth: 73,
284+
DisputeSplitDepth: 30,
285+
DisputeClockExtension: 10800, // 3 hours (input in seconds)
286+
DisputeMaxClockDuration: 302400, // 3.5 days (input in seconds)
288287
}
289288

290289
l2Users := devkeys.ChainUserKeys(new(big.Int).SetUint64(r.ChainID))

Diff for: op-deployer/pkg/deployer/integration_test/apply_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ func TestAdditionalDisputeGames(t *testing.T) {
529529
intent.Chains[0].AdditionalDisputeGames = []state.AdditionalDisputeGame{
530530
{
531531
ChainProofParams: state.ChainProofParams{
532-
DisputeGameUsesSuperRoots: false,
533532
DisputeGameType: 255,
534533
DisputeAbsolutePrestate: standard.DisputeAbsolutePrestate,
535534
DisputeMaxGameDepth: 50,

Diff for: op-deployer/pkg/deployer/opcm/opchain.go

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ type DeployOPChainInput struct {
3333
SaltMixer string
3434
GasLimit uint64
3535

36-
DisputeGameUsesSuperRoots bool
3736
DisputeGameType uint32
3837
DisputeAbsolutePrestate common.Hash
3938
DisputeMaxGameDepth uint64

Diff for: op-deployer/pkg/deployer/pipeline/opchain.go

+6-8
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ func DeployOPChain(env *Env, intent *state.Intent, st *state.State, chainID comm
7474
func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common.Hash, st *state.State) (opcm.DeployOPChainInput, error) {
7575
proofParams, err := jsonutil.MergeJSON(
7676
state.ChainProofParams{
77-
DisputeGameUsesSuperRoots: standard.DisputeGameUsesSuperRoots,
78-
DisputeGameType: standard.DisputeGameType,
79-
DisputeAbsolutePrestate: standard.DisputeAbsolutePrestate,
80-
DisputeMaxGameDepth: standard.DisputeMaxGameDepth,
81-
DisputeSplitDepth: standard.DisputeSplitDepth,
82-
DisputeClockExtension: standard.DisputeClockExtension,
83-
DisputeMaxClockDuration: standard.DisputeMaxClockDuration,
77+
DisputeGameType: standard.DisputeGameType,
78+
DisputeAbsolutePrestate: standard.DisputeAbsolutePrestate,
79+
DisputeMaxGameDepth: standard.DisputeMaxGameDepth,
80+
DisputeSplitDepth: standard.DisputeSplitDepth,
81+
DisputeClockExtension: standard.DisputeClockExtension,
82+
DisputeMaxClockDuration: standard.DisputeMaxClockDuration,
8483
},
8584
intent.GlobalDeployOverrides,
8685
thisIntent.DeployOverrides,
@@ -102,7 +101,6 @@ func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common
102101
Opcm: st.ImplementationsDeployment.OpcmAddress,
103102
SaltMixer: st.Create2Salt.String(), // passing through salt generated at state initialization
104103
GasLimit: standard.GasLimit,
105-
DisputeGameUsesSuperRoots: proofParams.DisputeGameUsesSuperRoots,
106104
DisputeGameType: proofParams.DisputeGameType,
107105
DisputeAbsolutePrestate: proofParams.DisputeAbsolutePrestate,
108106
DisputeMaxGameDepth: proofParams.DisputeMaxGameDepth,

Diff for: op-deployer/pkg/deployer/standard/standard.go

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const (
2626
ProofMaturityDelaySeconds uint64 = 604800
2727
DisputeGameFinalityDelaySeconds uint64 = 302400
2828
MIPSVersion uint64 = 1
29-
DisputeGameUsesSuperRoots bool = false
3029
DisputeGameType uint32 = 1 // PERMISSIONED game type
3130
DisputeMaxGameDepth uint64 = 73
3231
DisputeSplitDepth uint64 = 30

Diff for: op-deployer/pkg/deployer/state/chain_intent.go

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const (
1717
)
1818

1919
type ChainProofParams struct {
20-
DisputeGameUsesSuperRoots bool `json:"disputeGameUsesSuperRoots" toml:"disputeGameUsesSuperRoots"`
2120
DisputeGameType uint32 `json:"respectedGameType" toml:"respectedGameType"`
2221
DisputeAbsolutePrestate common.Hash `json:"faultGameAbsolutePrestate" toml:"faultGameAbsolutePrestate"`
2322
DisputeMaxGameDepth uint64 `json:"faultGameMaxDepth" toml:"faultGameMaxDepth"`

Diff for: op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
)
2222

2323
func TestUpgradeOPChainInput_OpChainConfigs(t *testing.T) {
24-
t.Skip("skipping for upgrade 15")
2524
input := &UpgradeOPChainInput{
2625
Prank: common.Address{0xaa},
2726
Opcm: common.Address{0xbb},
@@ -55,7 +54,6 @@ func TestUpgradeOPChainInput_OpChainConfigs(t *testing.T) {
5554
}
5655

5756
func TestUpgrader_Upgrade(t *testing.T) {
58-
t.Skip("skipping for upgrade 15")
5957
lgr := testlog.Logger(t, slog.LevelDebug)
6058

6159
forkedL1, stopL1, err := devnet.NewForkedSepolia(lgr)

Diff for: op-e2e/config/init.go

+18-21
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,12 @@ func defaultIntent(root string, loc *artifacts.Locator, deployer common.Address,
436436
{
437437
ChainProofParams: state.ChainProofParams{
438438
// Fast game
439-
DisputeGameUsesSuperRoots: false,
440-
DisputeGameType: 254,
441-
DisputeAbsolutePrestate: defaultPrestate,
442-
DisputeMaxGameDepth: 14 + 3 + 1,
443-
DisputeSplitDepth: 14,
444-
DisputeClockExtension: 0,
445-
DisputeMaxClockDuration: 0,
439+
DisputeGameType: 254,
440+
DisputeAbsolutePrestate: defaultPrestate,
441+
DisputeMaxGameDepth: 14 + 3 + 1,
442+
DisputeSplitDepth: 14,
443+
DisputeClockExtension: 0,
444+
DisputeMaxClockDuration: 0,
446445
},
447446
VMType: state.VMTypeAlphabet,
448447
UseCustomOracle: true,
@@ -453,25 +452,23 @@ func defaultIntent(root string, loc *artifacts.Locator, deployer common.Address,
453452
{
454453
ChainProofParams: state.ChainProofParams{
455454
// Alphabet game
456-
DisputeGameUsesSuperRoots: false,
457-
DisputeGameType: 255,
458-
DisputeAbsolutePrestate: defaultPrestate,
459-
DisputeMaxGameDepth: 14 + 3 + 1,
460-
DisputeSplitDepth: 14,
461-
DisputeClockExtension: 0,
462-
DisputeMaxClockDuration: 1200,
455+
DisputeGameType: 255,
456+
DisputeAbsolutePrestate: defaultPrestate,
457+
DisputeMaxGameDepth: 14 + 3 + 1,
458+
DisputeSplitDepth: 14,
459+
DisputeClockExtension: 0,
460+
DisputeMaxClockDuration: 1200,
463461
},
464462
VMType: state.VMTypeAlphabet,
465463
},
466464
{
467465
ChainProofParams: state.ChainProofParams{
468-
DisputeGameUsesSuperRoots: false,
469-
DisputeGameType: 0,
470-
DisputeAbsolutePrestate: cannonPrestate(root, allocType),
471-
DisputeMaxGameDepth: 50,
472-
DisputeSplitDepth: 14,
473-
DisputeClockExtension: 0,
474-
DisputeMaxClockDuration: 1200,
466+
DisputeGameType: 0,
467+
DisputeAbsolutePrestate: cannonPrestate(root, allocType),
468+
DisputeMaxGameDepth: 50,
469+
DisputeSplitDepth: 14,
470+
DisputeClockExtension: 0,
471+
DisputeMaxClockDuration: 1200,
475472
},
476473
VMType: cannonVMType(allocType),
477474
},

Diff for: packages/contracts-bedrock/interfaces/L1/IETHLockbox.sol

+9-8
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ interface IETHLockbox is IProxyAdminOwnedBase, ISemver {
1212
error ETHLockbox_InsufficientBalance();
1313
error ETHLockbox_NoWithdrawalTransactions();
1414
error ETHLockbox_DifferentProxyAdminOwner();
15+
error ETHLockbox_DifferentSuperchainConfig();
1516

1617
event Initialized(uint8 version);
17-
event ETHLocked(address indexed portal, uint256 amount);
18-
event ETHUnlocked(address indexed portal, uint256 amount);
19-
event PortalAuthorized(address indexed portal);
20-
event LockboxAuthorized(address indexed lockbox);
21-
event LiquidityMigrated(address indexed lockbox, uint256 amount);
22-
event LiquidityReceived(address indexed lockbox, uint256 amount);
18+
event ETHLocked(IOptimismPortal2 indexed portal, uint256 amount);
19+
event ETHUnlocked(IOptimismPortal2 indexed portal, uint256 amount);
20+
event PortalAuthorized(IOptimismPortal2 indexed portal);
21+
event LockboxAuthorized(IETHLockbox indexed lockbox);
22+
event LiquidityMigrated(IETHLockbox indexed lockbox, uint256 amount);
23+
event LiquidityReceived(IETHLockbox indexed lockbox, uint256 amount);
2324

2425
function initialize(ISuperchainConfig _superchainConfig, IOptimismPortal2[] calldata _portals) external;
2526
function superchainConfig() external view returns (ISuperchainConfig);
2627
function paused() external view returns (bool);
27-
function authorizedPortals(address) external view returns (bool);
28-
function authorizedLockboxes(address) external view returns (bool);
28+
function authorizedPortals(IOptimismPortal2) external view returns (bool);
29+
function authorizedLockboxes(IETHLockbox) external view returns (bool);
2930
function receiveLiquidity() external payable;
3031
function lockETH() external payable;
3132
function unlockETH(uint256 _value) external;

Diff for: packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol

-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ interface IOPContractsManager {
108108
string saltMixer;
109109
uint64 gasLimit;
110110
// Configurable dispute game parameters.
111-
bool disputeGameUsesSuperRoots;
112111
GameType disputeGameType;
113112
Claim disputeAbsolutePrestate;
114113
uint256 disputeMaxGameDepth;
@@ -176,7 +175,6 @@ interface IOPContractsManager {
176175
ISystemConfig systemConfigProxy;
177176
IProxyAdmin proxyAdmin;
178177
Claim absolutePrestate;
179-
bool disputeGameUsesSuperRoots;
180178
}
181179

182180
struct AddGameInput {

Diff for: packages/contracts-bedrock/interfaces/L1/IOPContractsManagerLegacyUpgrade.sol

-21
This file was deleted.

Diff for: packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol

+5-6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
3737
error OptimismPortal_InvalidSuperRootProof();
3838
error OptimismPortal_InvalidOutputRootChainId();
3939
error OptimismPortal_WrongProofMethod();
40+
error OptimismPortal_MigratingToSameRegistry();
4041
error Encoding_EmptySuperRoot();
4142
error Encoding_InvalidSuperRootVersion();
4243
error OutOfGas();
@@ -49,7 +50,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
4950
event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to);
5051
event WithdrawalProvenExtension1(bytes32 indexed withdrawalHash, address indexed proofSubmitter);
5152
event ETHMigrated(address indexed lockbox, uint256 ethBalance);
52-
event LockboxUpdated(address oldLockbox, address newLockbox);
53+
event PortalMigrated(IETHLockbox oldLockbox, IETHLockbox newLockbox, IAnchorStateRegistry oldAnchorStateRegistry, IAnchorStateRegistry newAnchorStateRegistry);
5354

5455
receive() external payable;
5556

@@ -68,7 +69,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
6869
function disputeGameFactory() external view returns (IDisputeGameFactory);
6970
function disputeGameFinalityDelaySeconds() external view returns (uint256);
7071
function donateETH() external payable;
71-
function updateLockbox(IETHLockbox _newLockbox) external;
72+
function migrateToSuperRoots(IETHLockbox _newLockbox, IAnchorStateRegistry _newAnchorStateRegistry) external;
7273
function finalizeWithdrawalTransaction(Types.WithdrawalTransaction memory _tx) external;
7374
function finalizeWithdrawalTransactionExternalProof(
7475
Types.WithdrawalTransaction memory _tx,
@@ -81,8 +82,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
8182
ISystemConfig _systemConfig,
8283
ISuperchainConfig _superchainConfig,
8384
IAnchorStateRegistry _anchorStateRegistry,
84-
IETHLockbox _ethLockbox,
85-
bool _superRootsActive
85+
IETHLockbox _ethLockbox
8686
)
8787
external;
8888
function initVersion() external view returns (uint8);
@@ -123,8 +123,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
123123
function systemConfig() external view returns (ISystemConfig);
124124
function upgrade(
125125
IAnchorStateRegistry _anchorStateRegistry,
126-
IETHLockbox _ethLockbox,
127-
bool _superRootsActive
126+
IETHLockbox _ethLockbox
128127
)
129128
external;
130129
function version() external pure returns (string memory);

Diff for: packages/contracts-bedrock/interfaces/L1/IOptimismPortalInterop.sol

+5-6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ interface IOptimismPortalInterop is IProxyAdminOwnedBase {
3838
error OptimismPortal_InvalidSuperRootProof();
3939
error OptimismPortal_InvalidOutputRootChainId();
4040
error OptimismPortal_WrongProofMethod();
41+
error OptimismPortal_MigratingToSameRegistry();
4142
error Encoding_EmptySuperRoot();
4243
error Encoding_InvalidSuperRootVersion();
4344
error OutOfGas();
@@ -50,7 +51,7 @@ interface IOptimismPortalInterop is IProxyAdminOwnedBase {
5051
event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to);
5152
event WithdrawalProvenExtension1(bytes32 indexed withdrawalHash, address indexed proofSubmitter);
5253
event ETHMigrated(address indexed lockbox, uint256 ethBalance);
53-
event LockboxUpdated(address oldLockbox, address newLockbox);
54+
event PortalMigrated(IETHLockbox oldLockbox, IETHLockbox newLockbox, IAnchorStateRegistry oldAnchorStateRegistry, IAnchorStateRegistry newAnchorStateRegistry);
5455

5556
receive() external payable;
5657

@@ -69,7 +70,7 @@ interface IOptimismPortalInterop is IProxyAdminOwnedBase {
6970
function disputeGameFactory() external view returns (IDisputeGameFactory);
7071
function disputeGameFinalityDelaySeconds() external view returns (uint256);
7172
function donateETH() external payable;
72-
function updateLockbox(IETHLockbox _newLockbox) external;
73+
function migrateToSuperRoots(IETHLockbox _newLockbox, IAnchorStateRegistry _newAnchorStateRegistry) external;
7374
function finalizeWithdrawalTransaction(Types.WithdrawalTransaction memory _tx) external;
7475
function finalizeWithdrawalTransactionExternalProof(
7576
Types.WithdrawalTransaction memory _tx,
@@ -83,8 +84,7 @@ interface IOptimismPortalInterop is IProxyAdminOwnedBase {
8384
ISystemConfig _systemConfig,
8485
ISuperchainConfig _superchainConfig,
8586
IAnchorStateRegistry _anchorStateRegistry,
86-
IETHLockbox _ethLockbox,
87-
bool _superRootsActive
87+
IETHLockbox _ethLockbox
8888
)
8989
external;
9090
function initVersion() external view returns (uint8);
@@ -126,8 +126,7 @@ interface IOptimismPortalInterop is IProxyAdminOwnedBase {
126126
function systemConfig() external view returns (ISystemConfig);
127127
function upgrade(
128128
IAnchorStateRegistry _anchorStateRegistry,
129-
IETHLockbox _ethLockbox,
130-
bool _superRootsActive
129+
IETHLockbox _ethLockbox
131130
)
132131
external;
133132
function version() external pure returns (string memory);

0 commit comments

Comments
 (0)