Commit a0eee5cc authored by Disco's avatar Disco Committed by GitHub

chore: solidity isthmus to interop (#12132)

* chore: rename isthmus to interop on solidity files

* chore: rename test file

* chore: update contracts versions (#66)
parent 3210a8c6
GasBenchMark_L1BlockIsthmus_DepositsComplete:test_depositsComplete_benchmark() (gas: 7567) GasBenchMark_L1BlockInterop_DepositsComplete:test_depositsComplete_benchmark() (gas: 7567)
GasBenchMark_L1BlockIsthmus_DepositsComplete_Warm:test_depositsComplete_benchmark() (gas: 5567) GasBenchMark_L1BlockInterop_DepositsComplete_Warm:test_depositsComplete_benchmark() (gas: 5567)
GasBenchMark_L1BlockIsthmus_SetValuesIsthmus:test_setL1BlockValuesIsthmus_benchmark() (gas: 175657) GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchmark() (gas: 175677)
GasBenchMark_L1BlockIsthmus_SetValuesIsthmus_Warm:test_setL1BlockValuesIsthmus_benchmark() (gas: 5121) GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5099)
GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531) GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531)
GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597) GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369242) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369242)
......
...@@ -384,7 +384,7 @@ contract L2Genesis is Deployer { ...@@ -384,7 +384,7 @@ contract L2Genesis is Deployer {
/// @notice This predeploy is following the safety invariant #1. /// @notice This predeploy is following the safety invariant #1.
function setL1Block() public { function setL1Block() public {
if (cfg.useInterop()) { if (cfg.useInterop()) {
string memory cname = "L1BlockIsthmus"; string memory cname = "L1BlockInterop";
address impl = Predeploys.predeployToCodeNamespace(Predeploys.L1_BLOCK_ATTRIBUTES); address impl = Predeploys.predeployToCodeNamespace(Predeploys.L1_BLOCK_ATTRIBUTES);
console.log("Setting %s implementation at: %s", cname, impl); console.log("Setting %s implementation at: %s", cname, impl);
vm.etch(impl, vm.getDeployedCode(string.concat(cname, ".sol:", cname))); vm.etch(impl, vm.getDeployedCode(string.concat(cname, ".sol:", cname)));
......
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
"sourceCodeHash": "0x3fb97859f66c078573753b6ba5ec370449ab03b8eca9e7779fce8db5bb23b7c0" "sourceCodeHash": "0x3fb97859f66c078573753b6ba5ec370449ab03b8eca9e7779fce8db5bb23b7c0"
}, },
"src/L1/OptimismPortalInterop.sol": { "src/L1/OptimismPortalInterop.sol": {
"initCodeHash": "0x1c8372865dbf38225de4d843ca696a17f0d9e3cacf13c10a3d065ba19bdca05e", "initCodeHash": "0xfeaa67ccd652bda9103fea507e4357b2bd4e93210b03ff85eb357d7145f1606c",
"sourceCodeHash": "0xe6a7794799915f408cb57c73af266670de8a3f02408d3dbc2c97db25d3e42635" "sourceCodeHash": "0x6401b81f04093863557ef46192f56793daa0d412618065383ab353b2ed2929d8"
}, },
"src/L1/ProtocolVersions.sol": { "src/L1/ProtocolVersions.sol": {
"initCodeHash": "0x8f033874dd8b36615b2209d553660dcff1ff91ca2bad3ca1de7b441dbfba4842", "initCodeHash": "0x8f033874dd8b36615b2209d553660dcff1ff91ca2bad3ca1de7b441dbfba4842",
...@@ -60,16 +60,16 @@ ...@@ -60,16 +60,16 @@
"sourceCodeHash": "0x06a50ac992175fdb434b13e8461893e83862c23ce399e697e6e8109728ad1a3d" "sourceCodeHash": "0x06a50ac992175fdb434b13e8461893e83862c23ce399e697e6e8109728ad1a3d"
}, },
"src/L1/SystemConfigInterop.sol": { "src/L1/SystemConfigInterop.sol": {
"initCodeHash": "0x1f500e310170769ffc747e08ad1d5b0de4b0f58534001bc4d4d563ec058bb331", "initCodeHash": "0x7515e5ed1266412a8c2d27d99aba6266fda2fc9068c20f0b7e6b555ee5073c91",
"sourceCodeHash": "0xcb6008cb49a06f87eb5b6cb4651e5e4aafe0b1f33000eccd165226c04f6b63c6" "sourceCodeHash": "0x441d1e3e8e987f829f55996b5b6c850da8c59ad48f09cf7e0a69a1fa559d42a2"
}, },
"src/L2/BaseFeeVault.sol": { "src/L2/BaseFeeVault.sol": {
"initCodeHash": "0x3bfcd57e25ad54b66c374f63e24e33a6cf107044aa8f5f69ef21202c380b5c5b", "initCodeHash": "0x3bfcd57e25ad54b66c374f63e24e33a6cf107044aa8f5f69ef21202c380b5c5b",
"sourceCodeHash": "0x2dc2284cf7c68e743da50e4113e96ffeab435de2390aeba2eab2f1e8ca411ce9" "sourceCodeHash": "0x2dc2284cf7c68e743da50e4113e96ffeab435de2390aeba2eab2f1e8ca411ce9"
}, },
"src/L2/CrossL2Inbox.sol": { "src/L2/CrossL2Inbox.sol": {
"initCodeHash": "0x0ee27866b4bf864a0b68ab25ea9559d7f2722b0396d02f2e8e089c6a1a5a6a93", "initCodeHash": "0x66b052adce7e9194d054952d67d08b53964120067600358243ec86c85b90877b",
"sourceCodeHash": "0xe6f453049035e0d77e4d7a92904b448bc17e04dd3d99e738b9af20e20986ce64" "sourceCodeHash": "0x38e6127ec6be99eb8c38c2c9d6e82761b33dde446bba250dc2c1b84983449e4e"
}, },
"src/L2/ETHLiquidity.sol": { "src/L2/ETHLiquidity.sol": {
"initCodeHash": "0x713c18f95a6a746d0703f475f3ae10c106c9b9ecb64d881a2e61b8969b581371", "initCodeHash": "0x713c18f95a6a746d0703f475f3ae10c106c9b9ecb64d881a2e61b8969b581371",
...@@ -83,9 +83,9 @@ ...@@ -83,9 +83,9 @@
"initCodeHash": "0xd12353c5bf71c6765cc9292eecf262f216e67f117f4ba6287796a5207dbca00f", "initCodeHash": "0xd12353c5bf71c6765cc9292eecf262f216e67f117f4ba6287796a5207dbca00f",
"sourceCodeHash": "0xfe3a9585d9bfca8428e12759cab68a3114374e5c37371cfe08bb1976a9a5a041" "sourceCodeHash": "0xfe3a9585d9bfca8428e12759cab68a3114374e5c37371cfe08bb1976a9a5a041"
}, },
"src/L2/L1BlockIsthmus.sol": { "src/L2/L1BlockInterop.sol": {
"initCodeHash": "0xb7a7a113056e4ac44824350b79fed5ea423e880223edcf1220e8f8b3172f50c5", "initCodeHash": "0x77b3b2151fe14ea36a640469115a5e4de27f7654a9606a9d0701522c6a4ad887",
"sourceCodeHash": "0x6be7e7402c4dfc10e1407e070712a3f9f352db45f8a8ab296e8f6bc56a341f47" "sourceCodeHash": "0x7417677643e1df1ae1782513b94c7821097b9529d3f8626c3bcb8b3a9ae0d180"
}, },
"src/L2/L1FeeVault.sol": { "src/L2/L1FeeVault.sol": {
"initCodeHash": "0x3bfcd57e25ad54b66c374f63e24e33a6cf107044aa8f5f69ef21202c380b5c5b", "initCodeHash": "0x3bfcd57e25ad54b66c374f63e24e33a6cf107044aa8f5f69ef21202c380b5c5b",
......
...@@ -354,7 +354,7 @@ ...@@ -354,7 +354,7 @@
}, },
{ {
"inputs": [], "inputs": [],
"name": "setL1BlockValuesIsthmus", "name": "setL1BlockValuesInterop",
"outputs": [], "outputs": [],
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
......
...@@ -3,7 +3,7 @@ pragma solidity 0.8.15; ...@@ -3,7 +3,7 @@ pragma solidity 0.8.15;
// Contracts // Contracts
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol"; import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { L1BlockIsthmus, ConfigType } from "src/L2/L1BlockIsthmus.sol"; import { L1BlockInterop, ConfigType } from "src/L2/L1BlockInterop.sol";
// Libraries // Libraries
import { Predeploys } from "src/libraries/Predeploys.sol"; import { Predeploys } from "src/libraries/Predeploys.sol";
...@@ -23,9 +23,9 @@ contract OptimismPortalInterop is OptimismPortal2 { ...@@ -23,9 +23,9 @@ contract OptimismPortalInterop is OptimismPortal2 {
OptimismPortal2(_proofMaturityDelaySeconds, _disputeGameFinalityDelaySeconds) OptimismPortal2(_proofMaturityDelaySeconds, _disputeGameFinalityDelaySeconds)
{ } { }
/// @custom:semver +interop /// @custom:semver +interop-beta.1
function version() public pure override returns (string memory) { function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop"); return string.concat(super.version(), "+interop-beta.1");
} }
/// @notice Sets static configuration options for the L2 system. /// @notice Sets static configuration options for the L2 system.
...@@ -48,7 +48,7 @@ contract OptimismPortalInterop is OptimismPortal2 { ...@@ -48,7 +48,7 @@ contract OptimismPortalInterop is OptimismPortal2 {
uint256(0), // value uint256(0), // value
uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit
false, // isCreation, false, // isCreation,
abi.encodeCall(L1BlockIsthmus.setConfig, (_type, _value)) abi.encodeCall(L1BlockInterop.setConfig, (_type, _value))
) )
); );
} }
......
...@@ -5,7 +5,7 @@ pragma solidity 0.8.15; ...@@ -5,7 +5,7 @@ pragma solidity 0.8.15;
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { IOptimismPortalInterop as IOptimismPortal } from "src/L1/interfaces/IOptimismPortalInterop.sol"; import { IOptimismPortalInterop as IOptimismPortal } from "src/L1/interfaces/IOptimismPortalInterop.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol";
import { ConfigType } from "src/L2/L1BlockIsthmus.sol"; import { ConfigType } from "src/L2/L1BlockInterop.sol";
// Libraries // Libraries
import { Constants } from "src/libraries/Constants.sol"; import { Constants } from "src/libraries/Constants.sol";
...@@ -68,9 +68,9 @@ contract SystemConfigInterop is SystemConfig { ...@@ -68,9 +68,9 @@ contract SystemConfigInterop is SystemConfig {
Storage.setAddress(DEPENDENCY_MANAGER_SLOT, _dependencyManager); Storage.setAddress(DEPENDENCY_MANAGER_SLOT, _dependencyManager);
} }
/// @custom:semver +interop /// @custom:semver +interop-beta.1
function version() public pure override returns (string memory) { function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop"); return string.concat(super.version(), "+interop-beta.1");
} }
/// @notice Internal setter for the gas paying token address, includes validation. /// @notice Internal setter for the gas paying token address, includes validation.
......
...@@ -7,7 +7,7 @@ import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol"; ...@@ -7,7 +7,7 @@ import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol"; import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";
import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol"; import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol";
import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol"; import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
import { ConfigType } from "src/L2/L1BlockIsthmus.sol"; import { ConfigType } from "src/L2/L1BlockInterop.sol";
interface IOptimismPortalInterop { interface IOptimismPortalInterop {
error AlreadyFinalized(); error AlreadyFinalized();
......
...@@ -7,7 +7,7 @@ import { ISemver } from "src/universal/interfaces/ISemver.sol"; ...@@ -7,7 +7,7 @@ import { ISemver } from "src/universal/interfaces/ISemver.sol";
import { ICrossL2Inbox } from "src/L2/interfaces/ICrossL2Inbox.sol"; import { ICrossL2Inbox } from "src/L2/interfaces/ICrossL2Inbox.sol";
import { SafeCall } from "src/libraries/SafeCall.sol"; import { SafeCall } from "src/libraries/SafeCall.sol";
import { IDependencySet } from "src/L2/interfaces/IDependencySet.sol"; import { IDependencySet } from "src/L2/interfaces/IDependencySet.sol";
import { IL1BlockIsthmus } from "src/L2/interfaces/IL1BlockIsthmus.sol"; import { IL1BlockInterop } from "src/L2/interfaces/IL1BlockInterop.sol";
/// @notice Thrown when the caller is not DEPOSITOR_ACCOUNT when calling `setInteropStart()` /// @notice Thrown when the caller is not DEPOSITOR_ACCOUNT when calling `setInteropStart()`
error NotDepositor(); error NotDepositor();
...@@ -65,8 +65,8 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware { ...@@ -65,8 +65,8 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware {
address internal constant DEPOSITOR_ACCOUNT = 0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001; address internal constant DEPOSITOR_ACCOUNT = 0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001;
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.0-beta.7 /// @custom:semver 1.0.0-beta.8
string public constant version = "1.0.0-beta.7"; string public constant version = "1.0.0-beta.8";
/// @notice Emitted when a cross chain message is being executed. /// @notice Emitted when a cross chain message is being executed.
/// @param msgHash Hash of message payload being executed. /// @param msgHash Hash of message payload being executed.
...@@ -140,7 +140,7 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware { ...@@ -140,7 +140,7 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware {
reentrantAware reentrantAware
{ {
// We need to know if this is being called on a depositTx // We need to know if this is being called on a depositTx
if (IL1BlockIsthmus(Predeploys.L1_BLOCK_ATTRIBUTES).isDeposit()) revert NoExecutingDeposits(); if (IL1BlockInterop(Predeploys.L1_BLOCK_ATTRIBUTES).isDeposit()) revert NoExecutingDeposits();
// Check the Identifier. // Check the Identifier.
_checkIdentifier(_id); _checkIdentifier(_id);
...@@ -165,7 +165,7 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware { ...@@ -165,7 +165,7 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware {
/// @param _msgHash Hash of the message payload to call target with. /// @param _msgHash Hash of the message payload to call target with.
function validateMessage(Identifier calldata _id, bytes32 _msgHash) external { function validateMessage(Identifier calldata _id, bytes32 _msgHash) external {
// We need to know if this is being called on a depositTx // We need to know if this is being called on a depositTx
if (IL1BlockIsthmus(Predeploys.L1_BLOCK_ATTRIBUTES).isDeposit()) revert NoExecutingDeposits(); if (IL1BlockInterop(Predeploys.L1_BLOCK_ATTRIBUTES).isDeposit()) revert NoExecutingDeposits();
// Check the Identifier. // Check the Identifier.
_checkIdentifier(_id); _checkIdentifier(_id);
......
...@@ -11,7 +11,7 @@ import { StaticConfig } from "src/libraries/StaticConfig.sol"; ...@@ -11,7 +11,7 @@ import { StaticConfig } from "src/libraries/StaticConfig.sol";
import { Predeploys } from "src/libraries/Predeploys.sol"; import { Predeploys } from "src/libraries/Predeploys.sol";
import "src/libraries/L1BlockErrors.sol"; import "src/libraries/L1BlockErrors.sol";
/// @notice Enum representing different types of configurations that can be set on L1BlockIsthmus. /// @notice Enum representing different types of configurations that can be set on L1BlockInterop.
/// @custom:value SET_GAS_PAYING_TOKEN Represents the config type for setting the gas paying token. /// @custom:value SET_GAS_PAYING_TOKEN Represents the config type for setting the gas paying token.
/// @custom:value ADD_DEPENDENCY Represents the config type for adding a chain to the interop dependency set. /// @custom:value ADD_DEPENDENCY Represents the config type for adding a chain to the interop dependency set.
/// @custom:value REMOVE_DEPENDENCY Represents the config type for removing a chain from the interop dependency set. /// @custom:value REMOVE_DEPENDENCY Represents the config type for removing a chain from the interop dependency set.
...@@ -23,9 +23,9 @@ enum ConfigType { ...@@ -23,9 +23,9 @@ enum ConfigType {
/// @custom:proxied true /// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000015 /// @custom:predeploy 0x4200000000000000000000000000000000000015
/// @title L1BlockIsthmus /// @title L1BlockInterop
/// @notice Isthmus extenstions of L1Block. /// @notice Interop extenstions of L1Block.
contract L1BlockIsthmus is L1Block { contract L1BlockInterop is L1Block {
using EnumerableSet for EnumerableSet.UintSet; using EnumerableSet for EnumerableSet.UintSet;
/// @notice Event emitted when a new dependency is added to the interop dependency set. /// @notice Event emitted when a new dependency is added to the interop dependency set.
...@@ -42,9 +42,9 @@ contract L1BlockIsthmus is L1Block { ...@@ -42,9 +42,9 @@ contract L1BlockIsthmus is L1Block {
/// keccak256(abi.encode(uint256(keccak256("l1Block.identifier.isDeposit")) - 1)) & ~bytes32(uint256(0xff)) /// keccak256(abi.encode(uint256(keccak256("l1Block.identifier.isDeposit")) - 1)) & ~bytes32(uint256(0xff))
uint256 internal constant IS_DEPOSIT_SLOT = 0x921bd3a089295c6e5540e8fba8195448d253efd6f2e3e495b499b627dc36a300; uint256 internal constant IS_DEPOSIT_SLOT = 0x921bd3a089295c6e5540e8fba8195448d253efd6f2e3e495b499b627dc36a300;
/// @custom:semver +isthmus /// @custom:semver +interop
function version() public pure override returns (string memory) { function version() public pure override returns (string memory) {
return string.concat(super.version(), "+isthmus"); return string.concat(super.version(), "+interop");
} }
/// @notice Returns whether the call was triggered from a a deposit or not. /// @notice Returns whether the call was triggered from a a deposit or not.
...@@ -70,10 +70,10 @@ contract L1BlockIsthmus is L1Block { ...@@ -70,10 +70,10 @@ contract L1BlockIsthmus is L1Block {
return uint8(dependencySet.length()); return uint8(dependencySet.length());
} }
/// @notice Updates the `isDeposit` flag and sets the L1 block values for an Isthmus upgraded chain. /// @notice Updates the `isDeposit` flag and sets the L1 block values for an Interop upgraded chain.
/// It updates the L1 block values through the `setL1BlockValuesEcotone` function. /// It updates the L1 block values through the `setL1BlockValuesEcotone` function.
/// It forwards the calldata to the internally-used `setL1BlockValuesEcotone` function. /// It forwards the calldata to the internally-used `setL1BlockValuesEcotone` function.
function setL1BlockValuesIsthmus() external { function setL1BlockValuesInterop() external {
// Set the isDeposit flag to true. // Set the isDeposit flag to true.
assembly { assembly {
sstore(IS_DEPOSIT_SLOT, 1) sstore(IS_DEPOSIT_SLOT, 1)
......
...@@ -7,7 +7,7 @@ enum ConfigType { ...@@ -7,7 +7,7 @@ enum ConfigType {
REMOVE_DEPENDENCY REMOVE_DEPENDENCY
} }
interface IL1BlockIsthmus { interface IL1BlockInterop {
error AlreadyDependency(); error AlreadyDependency();
error CantRemovedDependency(); error CantRemovedDependency();
error DependencySetSizeTooLarge(); error DependencySetSizeTooLarge();
...@@ -52,7 +52,7 @@ interface IL1BlockIsthmus { ...@@ -52,7 +52,7 @@ interface IL1BlockIsthmus {
) )
external; external;
function setL1BlockValuesEcotone() external; function setL1BlockValuesEcotone() external;
function setL1BlockValuesIsthmus() external; function setL1BlockValuesInterop() external;
function timestamp() external view returns (uint64); function timestamp() external view returns (uint64);
function version() external pure returns (string memory); function version() external pure returns (string memory);
......
...@@ -184,7 +184,7 @@ library Encoding { ...@@ -184,7 +184,7 @@ library Encoding {
/// @param _blobBaseFee L1 blob base fee. /// @param _blobBaseFee L1 blob base fee.
/// @param _hash L1 blockhash. /// @param _hash L1 blockhash.
/// @param _batcherHash Versioned hash to authenticate batcher by. /// @param _batcherHash Versioned hash to authenticate batcher by.
function encodeSetL1BlockValuesIsthmus( function encodeSetL1BlockValuesInterop(
uint32 _baseFeeScalar, uint32 _baseFeeScalar,
uint32 _blobBaseFeeScalar, uint32 _blobBaseFeeScalar,
uint64 _sequenceNumber, uint64 _sequenceNumber,
...@@ -199,7 +199,7 @@ library Encoding { ...@@ -199,7 +199,7 @@ library Encoding {
pure pure
returns (bytes memory) returns (bytes memory)
{ {
bytes4 functionSignature = bytes4(keccak256("setL1BlockValuesIsthmus()")); bytes4 functionSignature = bytes4(keccak256("setL1BlockValuesInterop()"));
return abi.encodePacked( return abi.encodePacked(
functionSignature, functionSignature,
_baseFeeScalar, _baseFeeScalar,
......
...@@ -10,7 +10,7 @@ import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol"; ...@@ -10,7 +10,7 @@ import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol";
// Libraries // Libraries
import { Types } from "src/libraries/Types.sol"; import { Types } from "src/libraries/Types.sol";
import { SafeCall } from "src/libraries/SafeCall.sol"; import { SafeCall } from "src/libraries/SafeCall.sol";
import { L1BlockIsthmus } from "src/L2/L1BlockIsthmus.sol"; import { L1BlockInterop } from "src/L2/L1BlockInterop.sol";
import { Encoding } from "src/libraries/Encoding.sol"; import { Encoding } from "src/libraries/Encoding.sol";
// Interfaces // Interfaces
...@@ -254,13 +254,13 @@ contract GasBenchMark_L1Block_SetValuesEcotone_Warm is GasBenchMark_L1Block { ...@@ -254,13 +254,13 @@ contract GasBenchMark_L1Block_SetValuesEcotone_Warm is GasBenchMark_L1Block {
} }
} }
contract GasBenchMark_L1BlockIsthmus is GasBenchMark_L1Block { contract GasBenchMark_L1BlockInterop is GasBenchMark_L1Block {
L1BlockIsthmus l1BlockIsthmus; L1BlockInterop l1BlockInterop;
function setUp() public virtual override { function setUp() public virtual override {
super.setUp(); super.setUp();
l1BlockIsthmus = new L1BlockIsthmus(); l1BlockInterop = new L1BlockInterop();
setValuesCalldata = Encoding.encodeSetL1BlockValuesIsthmus( setValuesCalldata = Encoding.encodeSetL1BlockValuesInterop(
type(uint32).max, type(uint32).max,
type(uint32).max, type(uint32).max,
type(uint64).max, type(uint64).max,
...@@ -274,42 +274,42 @@ contract GasBenchMark_L1BlockIsthmus is GasBenchMark_L1Block { ...@@ -274,42 +274,42 @@ contract GasBenchMark_L1BlockIsthmus is GasBenchMark_L1Block {
} }
} }
contract GasBenchMark_L1BlockIsthmus_SetValuesIsthmus is GasBenchMark_L1BlockIsthmus { contract GasBenchMark_L1BlockInterop_SetValuesInterop is GasBenchMark_L1BlockInterop {
function test_setL1BlockValuesIsthmus_benchmark() external { function test_setL1BlockValuesInterop_benchmark() external {
SafeCall.call({ _target: address(l1BlockIsthmus), _calldata: setValuesCalldata }); SafeCall.call({ _target: address(l1BlockInterop), _calldata: setValuesCalldata });
} }
} }
contract GasBenchMark_L1BlockIsthmus_SetValuesIsthmus_Warm is GasBenchMark_L1BlockIsthmus { contract GasBenchMark_L1BlockInterop_SetValuesInterop_Warm is GasBenchMark_L1BlockInterop {
function setUp() public virtual override { function setUp() public virtual override {
SafeCall.call({ _target: address(l1BlockIsthmus), _calldata: setValuesCalldata }); SafeCall.call({ _target: address(l1BlockInterop), _calldata: setValuesCalldata });
} }
function test_setL1BlockValuesIsthmus_benchmark() external { function test_setL1BlockValuesInterop_benchmark() external {
SafeCall.call({ _target: address(l1BlockIsthmus), _calldata: setValuesCalldata }); SafeCall.call({ _target: address(l1BlockInterop), _calldata: setValuesCalldata });
} }
} }
contract GasBenchMark_L1BlockIsthmus_DepositsComplete is GasBenchMark_L1BlockIsthmus { contract GasBenchMark_L1BlockInterop_DepositsComplete is GasBenchMark_L1BlockInterop {
function test_depositsComplete_benchmark() external { function test_depositsComplete_benchmark() external {
SafeCall.call({ SafeCall.call({
_target: address(l1BlockIsthmus), _target: address(l1BlockInterop),
_calldata: abi.encodeWithSelector(l1BlockIsthmus.depositsComplete.selector) _calldata: abi.encodeWithSelector(l1BlockInterop.depositsComplete.selector)
}); });
} }
} }
contract GasBenchMark_L1BlockIsthmus_DepositsComplete_Warm is GasBenchMark_L1BlockIsthmus { contract GasBenchMark_L1BlockInterop_DepositsComplete_Warm is GasBenchMark_L1BlockInterop {
function setUp() public virtual override { function setUp() public virtual override {
super.setUp(); super.setUp();
// Set the isDeposit flag to true so then we can benchmark when it is reset. // Set the isDeposit flag to true so then we can benchmark when it is reset.
SafeCall.call({ _target: address(l1BlockIsthmus), _calldata: setValuesCalldata }); SafeCall.call({ _target: address(l1BlockInterop), _calldata: setValuesCalldata });
} }
function test_depositsComplete_benchmark() external { function test_depositsComplete_benchmark() external {
SafeCall.call({ SafeCall.call({
_target: address(l1BlockIsthmus), _target: address(l1BlockInterop),
_calldata: abi.encodeWithSelector(l1BlockIsthmus.depositsComplete.selector) _calldata: abi.encodeWithSelector(l1BlockInterop.depositsComplete.selector)
}); });
} }
} }
...@@ -12,7 +12,7 @@ import "src/libraries/PortalErrors.sol"; ...@@ -12,7 +12,7 @@ import "src/libraries/PortalErrors.sol";
// Target contract dependencies // Target contract dependencies
import "src/libraries/PortalErrors.sol"; import "src/libraries/PortalErrors.sol";
import { OptimismPortalInterop } from "src/L1/OptimismPortalInterop.sol"; import { OptimismPortalInterop } from "src/L1/OptimismPortalInterop.sol";
import { L1BlockIsthmus, ConfigType } from "src/L2/L1BlockIsthmus.sol"; import { L1BlockInterop, ConfigType } from "src/L2/L1BlockInterop.sol";
// Interfaces // Interfaces
import { IOptimismPortalInterop } from "src/L1/interfaces/IOptimismPortalInterop.sol"; import { IOptimismPortalInterop } from "src/L1/interfaces/IOptimismPortalInterop.sol";
...@@ -35,7 +35,7 @@ contract OptimismPortalInterop_Test is CommonTest { ...@@ -35,7 +35,7 @@ contract OptimismPortalInterop_Test is CommonTest {
_mint: 0, _mint: 0,
_gasLimit: 200_000, _gasLimit: 200_000,
_isCreation: false, _isCreation: false,
_data: abi.encodeCall(L1BlockIsthmus.setConfig, (ConfigType.SET_GAS_PAYING_TOKEN, _value)) _data: abi.encodeCall(L1BlockInterop.setConfig, (ConfigType.SET_GAS_PAYING_TOKEN, _value))
}); });
vm.prank(address(_optimismPortalInterop().systemConfig())); vm.prank(address(_optimismPortalInterop().systemConfig()));
...@@ -58,7 +58,7 @@ contract OptimismPortalInterop_Test is CommonTest { ...@@ -58,7 +58,7 @@ contract OptimismPortalInterop_Test is CommonTest {
_mint: 0, _mint: 0,
_gasLimit: 200_000, _gasLimit: 200_000,
_isCreation: false, _isCreation: false,
_data: abi.encodeCall(L1BlockIsthmus.setConfig, (ConfigType.ADD_DEPENDENCY, _value)) _data: abi.encodeCall(L1BlockInterop.setConfig, (ConfigType.ADD_DEPENDENCY, _value))
}); });
vm.prank(address(_optimismPortalInterop().systemConfig())); vm.prank(address(_optimismPortalInterop().systemConfig()));
...@@ -81,7 +81,7 @@ contract OptimismPortalInterop_Test is CommonTest { ...@@ -81,7 +81,7 @@ contract OptimismPortalInterop_Test is CommonTest {
_mint: 0, _mint: 0,
_gasLimit: 200_000, _gasLimit: 200_000,
_isCreation: false, _isCreation: false,
_data: abi.encodeCall(L1BlockIsthmus.setConfig, (ConfigType.REMOVE_DEPENDENCY, _value)) _data: abi.encodeCall(L1BlockInterop.setConfig, (ConfigType.REMOVE_DEPENDENCY, _value))
}); });
vm.prank(address(_optimismPortalInterop().systemConfig())); vm.prank(address(_optimismPortalInterop().systemConfig()));
......
...@@ -6,7 +6,7 @@ import { CommonTest } from "test/setup/CommonTest.sol"; ...@@ -6,7 +6,7 @@ import { CommonTest } from "test/setup/CommonTest.sol";
// Contracts // Contracts
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ConfigType } from "src/L2/L1BlockIsthmus.sol"; import { ConfigType } from "src/L2/L1BlockInterop.sol";
// Libraries // Libraries
import { Constants } from "src/libraries/Constants.sol"; import { Constants } from "src/libraries/Constants.sol";
......
...@@ -19,7 +19,7 @@ import { ...@@ -19,7 +19,7 @@ import {
NotDepositor, NotDepositor,
InteropStartAlreadySet InteropStartAlreadySet
} from "src/L2/CrossL2Inbox.sol"; } from "src/L2/CrossL2Inbox.sol";
import { IL1BlockIsthmus } from "src/L2/interfaces/IL1BlockIsthmus.sol"; import { IL1BlockInterop } from "src/L2/interfaces/IL1BlockInterop.sol";
import { ICrossL2Inbox } from "src/L2/interfaces/ICrossL2Inbox.sol"; import { ICrossL2Inbox } from "src/L2/interfaces/ICrossL2Inbox.sol";
/// @title CrossL2InboxWithModifiableTransientStorage /// @title CrossL2InboxWithModifiableTransientStorage
...@@ -160,7 +160,7 @@ contract CrossL2InboxTest is Test { ...@@ -160,7 +160,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -222,7 +222,7 @@ contract CrossL2InboxTest is Test { ...@@ -222,7 +222,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -282,7 +282,7 @@ contract CrossL2InboxTest is Test { ...@@ -282,7 +282,7 @@ contract CrossL2InboxTest is Test {
// Ensure it is a deposit transaction // Ensure it is a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(true) returnData: abi.encode(true)
}); });
...@@ -312,7 +312,7 @@ contract CrossL2InboxTest is Test { ...@@ -312,7 +312,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -346,7 +346,7 @@ contract CrossL2InboxTest is Test { ...@@ -346,7 +346,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -375,7 +375,7 @@ contract CrossL2InboxTest is Test { ...@@ -375,7 +375,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -419,7 +419,7 @@ contract CrossL2InboxTest is Test { ...@@ -419,7 +419,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -464,7 +464,7 @@ contract CrossL2InboxTest is Test { ...@@ -464,7 +464,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -485,7 +485,7 @@ contract CrossL2InboxTest is Test { ...@@ -485,7 +485,7 @@ contract CrossL2InboxTest is Test {
// Ensure it is a deposit transaction // Ensure it is a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(true) returnData: abi.encode(true)
}); });
...@@ -508,7 +508,7 @@ contract CrossL2InboxTest is Test { ...@@ -508,7 +508,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -537,7 +537,7 @@ contract CrossL2InboxTest is Test { ...@@ -537,7 +537,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
...@@ -571,7 +571,7 @@ contract CrossL2InboxTest is Test { ...@@ -571,7 +571,7 @@ contract CrossL2InboxTest is Test {
// Ensure is not a deposit transaction // Ensure is not a deposit transaction
vm.mockCall({ vm.mockCall({
callee: Predeploys.L1_BLOCK_ATTRIBUTES, callee: Predeploys.L1_BLOCK_ATTRIBUTES,
data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector),
returnData: abi.encode(false) returnData: abi.encode(false)
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment