Skip to content

Commit f3b9f0c

Browse files
Remove L2OutputOracle and legacy OptimismPortal (#13489)
* attempt... * fixes * fix checks * fix kontrol build * update DeploymentSummaryFaultProofs kontrol hash * fixes * undo unnecessary change * feat: Reduce diff and usage of OptimismPortal2 * semver * fix: init test --------- Co-authored-by: Maurelian <[email protected]>
1 parent d356d92 commit f3b9f0c

Some content is hidden

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

43 files changed

+167
-5917
lines changed

packages/contracts-bedrock/interfaces/L1/IL1CrossDomainMessenger.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.0;
33

44
import { ICrossDomainMessenger } from "interfaces/universal/ICrossDomainMessenger.sol";
55
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
6-
import { IOptimismPortal } from "interfaces/L1/IOptimismPortal.sol";
6+
import { IOptimismPortal2 as IOptimismPortal } from "interfaces/L1/IOptimismPortal2.sol";
77
import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
88

99
interface IL1CrossDomainMessenger is ICrossDomainMessenger {

packages/contracts-bedrock/interfaces/L1/IL2OutputOracle.sol

Lines changed: 0 additions & 55 deletions
This file was deleted.

packages/contracts-bedrock/interfaces/L1/IOptimismPortal.sol

Lines changed: 0 additions & 87 deletions
This file was deleted.

packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol

Lines changed: 3 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ import { OPContractsManager } from "src/L1/OPContractsManager.sol";
2323
// Interfaces
2424
import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol";
2525
import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
26-
import { IL2OutputOracle } from "interfaces/L1/IL2OutputOracle.sol";
2726
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
2827
import { IL1CrossDomainMessenger } from "interfaces/L1/IL1CrossDomainMessenger.sol";
29-
import { IOptimismPortal } from "interfaces/L1/IOptimismPortal.sol";
3028
import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol";
3129
import { IL1ERC721Bridge } from "interfaces/L1/IL1ERC721Bridge.sol";
3230
import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol";
@@ -42,15 +40,7 @@ library ChainAssertions {
4240

4341
/// @notice Asserts the correctness of an L1 deployment. This function expects that all contracts
4442
/// within the `prox` ContractSet are proxies that have been setup and initialized.
45-
function postDeployAssertions(
46-
Types.ContractSet memory _prox,
47-
DeployConfig _cfg,
48-
uint256 _l2OutputOracleStartingTimestamp,
49-
Vm _vm
50-
)
51-
internal
52-
view
53-
{
43+
function postDeployAssertions(Types.ContractSet memory _prox, DeployConfig _cfg, Vm _vm) internal view {
5444
console.log("Running post-deploy assertions");
5545
IResourceMetering.ResourceConfig memory rcfg = ISystemConfig(_prox.SystemConfig).resourceConfig();
5646
IResourceMetering.ResourceConfig memory dflt = Constants.DEFAULT_RESOURCE_CONFIG();
@@ -59,15 +49,8 @@ library ChainAssertions {
5949
checkSystemConfig({ _contracts: _prox, _cfg: _cfg, _isProxy: true });
6050
checkL1CrossDomainMessenger({ _contracts: _prox, _vm: _vm, _isProxy: true });
6151
checkL1StandardBridge({ _contracts: _prox, _isProxy: true });
62-
checkL2OutputOracle({
63-
_contracts: _prox,
64-
_cfg: _cfg,
65-
_l2OutputOracleStartingTimestamp: _l2OutputOracleStartingTimestamp,
66-
_isProxy: true
67-
});
6852
checkOptimismMintableERC20Factory({ _contracts: _prox, _isProxy: true });
6953
checkL1ERC721Bridge({ _contracts: _prox, _isProxy: true });
70-
checkOptimismPortal({ _contracts: _prox, _cfg: _cfg, _isProxy: true });
7154
checkOptimismPortal2({ _contracts: _prox, _cfg: _cfg, _isProxy: true });
7255
checkProtocolVersions({ _contracts: _prox, _cfg: _cfg, _isProxy: true });
7356
}
@@ -326,56 +309,6 @@ library ChainAssertions {
326309
}
327310
}
328311

329-
/// @notice Asserts that the L2OutputOracle is setup correctly
330-
function checkL2OutputOracle(
331-
Types.ContractSet memory _contracts,
332-
DeployConfig _cfg,
333-
uint256 _l2OutputOracleStartingTimestamp,
334-
bool _isProxy
335-
)
336-
internal
337-
view
338-
{
339-
IL2OutputOracle oracle = IL2OutputOracle(_contracts.L2OutputOracle);
340-
console.log(
341-
"Running chain assertions on the L2OutputOracle %s at %s",
342-
_isProxy ? "proxy" : "implementation",
343-
address(oracle)
344-
);
345-
require(address(oracle) != address(0), "CHECK-L2OO-10");
346-
347-
// Check that the contract is initialized
348-
DeployUtils.assertInitialized({ _contractAddress: address(oracle), _isProxy: _isProxy, _slot: 0, _offset: 0 });
349-
350-
if (_isProxy) {
351-
require(oracle.SUBMISSION_INTERVAL() == _cfg.l2OutputOracleSubmissionInterval(), "CHECK-L2OO-20");
352-
require(oracle.submissionInterval() == _cfg.l2OutputOracleSubmissionInterval(), "CHECK-L2OO-30");
353-
require(oracle.L2_BLOCK_TIME() == _cfg.l2BlockTime(), "CHECK-L2OO-40");
354-
require(oracle.l2BlockTime() == _cfg.l2BlockTime(), "CHECK-L2OO-50");
355-
require(oracle.PROPOSER() == _cfg.l2OutputOracleProposer(), "CHECK-L2OO-60");
356-
require(oracle.proposer() == _cfg.l2OutputOracleProposer(), "CHECK-L2OO-70");
357-
require(oracle.CHALLENGER() == _cfg.l2OutputOracleChallenger(), "CHECK-L2OO-80");
358-
require(oracle.challenger() == _cfg.l2OutputOracleChallenger(), "CHECK-L2OO-90");
359-
require(oracle.FINALIZATION_PERIOD_SECONDS() == _cfg.finalizationPeriodSeconds(), "CHECK-L2OO-100");
360-
require(oracle.finalizationPeriodSeconds() == _cfg.finalizationPeriodSeconds(), "CHECK-L2OO-110");
361-
require(oracle.startingBlockNumber() == _cfg.l2OutputOracleStartingBlockNumber(), "CHECK-L2OO-120");
362-
require(oracle.startingTimestamp() == _l2OutputOracleStartingTimestamp, "CHECK-L2OO-130");
363-
} else {
364-
require(oracle.SUBMISSION_INTERVAL() == 0, "CHECK-L2OO-140");
365-
require(oracle.submissionInterval() == 0, "CHECK-L2OO-150");
366-
require(oracle.L2_BLOCK_TIME() == 0, "CHECK-L2OO-160");
367-
require(oracle.l2BlockTime() == 0, "CHECK-L2OO-170");
368-
require(oracle.PROPOSER() == address(0), "CHECK-L2OO-180");
369-
require(oracle.proposer() == address(0), "CHECK-L2OO-190");
370-
require(oracle.CHALLENGER() == address(0), "CHECK-L2OO-200");
371-
require(oracle.challenger() == address(0), "CHECK-L2OO-210");
372-
require(oracle.FINALIZATION_PERIOD_SECONDS() == 0, "CHECK-L2OO-220");
373-
require(oracle.finalizationPeriodSeconds() == 0, "CHECK-L2OO-230");
374-
require(oracle.startingBlockNumber() == 0, "CHECK-L2OO-240");
375-
require(oracle.startingTimestamp() == 0, "CHECK-L2OO-250");
376-
}
377-
}
378-
379312
/// @notice Asserts that the OptimismMintableERC20Factory is setup correctly
380313
function checkOptimismMintableERC20Factory(Types.ContractSet memory _contracts, bool _isProxy) internal view {
381314
IOptimismMintableERC20Factory factory = IOptimismMintableERC20Factory(_contracts.OptimismMintableERC20Factory);
@@ -428,39 +361,6 @@ library ChainAssertions {
428361
}
429362

430363
/// @notice Asserts the OptimismPortal is setup correctly
431-
function checkOptimismPortal(Types.ContractSet memory _contracts, DeployConfig _cfg, bool _isProxy) internal view {
432-
IOptimismPortal portal = IOptimismPortal(payable(_contracts.OptimismPortal));
433-
console.log(
434-
"Running chain assertions on the OptimismPortal %s at %s",
435-
_isProxy ? "proxy" : "implementation",
436-
address(portal)
437-
);
438-
require(address(portal) != address(0), "CHECK-OP-10");
439-
440-
// Check that the contract is initialized
441-
DeployUtils.assertInitialized({ _contractAddress: address(portal), _isProxy: _isProxy, _slot: 0, _offset: 0 });
442-
443-
address guardian = _cfg.superchainConfigGuardian();
444-
if (guardian.code.length == 0) {
445-
console.log("Guardian has no code: %s", guardian);
446-
}
447-
448-
if (_isProxy) {
449-
require(address(portal.l2Oracle()) == _contracts.L2OutputOracle, "CHECK-OP-20");
450-
require(address(portal.systemConfig()) == _contracts.SystemConfig, "CHECK-OP-30");
451-
require(portal.guardian() == guardian, "CHECK-OP-40");
452-
require(address(portal.superchainConfig()) == address(_contracts.SuperchainConfig), "CHECK-OP-50");
453-
require(portal.paused() == ISuperchainConfig(_contracts.SuperchainConfig).paused(), "CHECK-OP-60");
454-
require(portal.l2Sender() == Constants.DEFAULT_L2_SENDER, "CHECK-OP-70");
455-
} else {
456-
require(address(portal.l2Oracle()) == address(0), "CHECK-OP-80");
457-
require(address(portal.systemConfig()) == address(0), "CHECK-OP-90");
458-
require(address(portal.superchainConfig()) == address(0), "CHECK-OP-100");
459-
require(portal.l2Sender() == address(0), "CHECK-OP-110");
460-
}
461-
}
462-
463-
/// @notice Asserts the OptimismPortal2 is setup correctly
464364
function checkOptimismPortal2(
465365
Types.ContractSet memory _contracts,
466366
DeployConfig _cfg,
@@ -469,7 +369,7 @@ library ChainAssertions {
469369
internal
470370
view
471371
{
472-
IOptimismPortal2 portal = IOptimismPortal2(payable(_contracts.OptimismPortal2));
372+
IOptimismPortal2 portal = IOptimismPortal2(payable(_contracts.OptimismPortal));
473373
console.log(
474374
"Running chain assertions on the OptimismPortal2 %s at %s",
475375
_isProxy ? "proxy" : "implementation",
@@ -596,7 +496,7 @@ library ChainAssertions {
596496
// Ensure that the OPCM impls are correctly saved
597497
OPContractsManager.Implementations memory impls = _opcm.implementations();
598498
require(impls.l1ERC721BridgeImpl == _contracts.L1ERC721Bridge, "CHECK-OPCM-50");
599-
require(impls.optimismPortalImpl == _contracts.OptimismPortal2, "CHECK-OPCM-60");
499+
require(impls.optimismPortalImpl == _contracts.OptimismPortal, "CHECK-OPCM-60");
600500
require(impls.systemConfigImpl == _contracts.SystemConfig, "CHECK-OPCM-70");
601501
require(impls.optimismMintableERC20FactoryImpl == _contracts.OptimismMintableERC20Factory, "CHECK-OPCM-80");
602502
require(impls.l1CrossDomainMessengerImpl == _contracts.L1CrossDomainMessenger, "CHECK-OPCM-90");

0 commit comments

Comments
 (0)