Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ interface ICrossDomainMessenger {
function RELAY_CONSTANT_OVERHEAD() external view returns (uint64);
function RELAY_GAS_CHECK_BUFFER() external view returns (uint64);
function RELAY_RESERVED_GAS() external view returns (uint64);
function TX_BASE_GAS() external view returns (uint64);
function FLOOR_CALLDATA_OVERHEAD() external view returns (uint64);
function ENCODING_OVERHEAD() external view returns (uint64);
function baseGas(bytes memory _message, uint32 _minGasLimit) external pure returns (uint64);
function failedMessages(bytes32) external view returns (bool);
function messageNonce() external view returns (uint256);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ALLOWED_FILES=(
"src/L1/L1StandardBridge.sol"
"src/L1/OPContractsManager.sol"
"src/L1/OPContractsManagerInterop.sol"
"src/L1/OPPrestateUpdater.sol"
"src/L1/OptimismPortal2.sol"
"src/L1/OptimismPortalInterop.sol"
"src/L1/ProtocolVersions.sol"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "ENCODING_OVERHEAD",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "FLOOR_CALLDATA_OVERHEAD",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MESSAGE_VERSION",
Expand Down Expand Up @@ -134,6 +160,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "TX_BASE_GAS",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "ENCODING_OVERHEAD",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "FLOOR_CALLDATA_OVERHEAD",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MESSAGE_VERSION",
Expand Down Expand Up @@ -121,6 +147,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "TX_BASE_GAS",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down
40 changes: 20 additions & 20 deletions packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@
"sourceCodeHash": "0xe772f7db8033e4a738850cb28ac4849d3a454c93732135a8a10d4f7cb498088e"
},
"src/L1/L1CrossDomainMessenger.sol": {
"initCodeHash": "0x03a3c0eb2418aba9f93bb89723ba2ee7cb9e1988ca00f380503c960149c85b7a",
"sourceCodeHash": "0x5907cdb82ec5f6bef2184558a511d049ab3ee65388cf44d0c20d0f234ef8ca44"
"initCodeHash": "0x5a6272f6bd4346da460b7ff2ebc426d158d7ffc65dc0f2c0651a9e6d545bfd03",
"sourceCodeHash": "0xf11fa72481dbe43dad4e7a48645fcf92d0feeefa0b98b282042bdda568508372"
},
"src/L1/L1ERC721Bridge.sol": {
"initCodeHash": "0xa54dbc482f557966a636158bc3a566c351cb04ee8b1cb13aa2de61b9a0ddb064",
"sourceCodeHash": "0xe9c85de57005fe964acb9c62f5009aa5a4ba0eacc24bec67a0e4a043d2db5757"
"initCodeHash": "0x819fcccb74bef53241d7d651f73949115e5706b61c7cb8cdb9b6d9d34ef39e89",
"sourceCodeHash": "0x5036f59ae3414d1106f148765bba9d1759844c9c2d3e18ab5c81bb49cf59eab8"
},
"src/L1/L1StandardBridge.sol": {
"initCodeHash": "0xe95886a6408f77fb433687049d85dd3c2200dfacc2dd6c5fd7f9554f6fc5b11b",
"sourceCodeHash": "0x7f614d0c5251365580c02dd898900a583ece2aa28579adea74a3808b575949b4"
"initCodeHash": "0xbd4a03a3611a0de9669c4c8556f90c5aaef666b899d9ded1c07abc60263da8d6",
"sourceCodeHash": "0x44797707aea8c63dec049a02d69ea056662a06e5cf320028ab8b388634bf1c67"
},
"src/L1/OPContractsManager.sol": {
"initCodeHash": "0x7ad29e286feabd0ef333f8969be8e766b3c68e97fe7b75e4c8a9699dd49e87f8",
"sourceCodeHash": "0xa412132a08809d03088690b7275c8118327d69d1e42b9d033c34cc283dea77a0"
"initCodeHash": "0xc50bce08abbfc66d7f902b5b1f5504c99cbdca17ca4ff98f67801e40c0751f6b",
"sourceCodeHash": "0xff40fd58a78fdfa90e8ac84bed278e6af8329fd826b478fb4fcd6641f62ae1b6"
},
"src/L1/OptimismPortal2.sol": {
"initCodeHash": "0x93c5e8ff52ff8b1cedd985b4a8890c12b56d5959832405c7622615c3541908f5",
"sourceCodeHash": "0x753465f9317d89f8ea64bcd3fc3fb1164d040b9be2d5ba3d401d951f2ceff023"
"initCodeHash": "0xd1651b8a6f4d25611a0105d5cc7c1da3921417bd44da870ec63bf5ccd1bc7c63",
"sourceCodeHash": "0xce7373d8c7df47caa8b090f3afb3d2539677f12cb3eff7fc0ab1fd85638f05c1"
},
"src/L1/OptimismPortalInterop.sol": {
"initCodeHash": "0x12ecac882d3a45901993f93661a5e8ada1fb964d25e7843cfb9f56b2a30aa7b4",
"sourceCodeHash": "0xa031a40aa6f722466a76a36871989942f34351a327227a62266bb9a26c439fe2"
"initCodeHash": "0xd59854648bf205dfbea96b483b2937441c32e9ef66b002468c2c14c0d6661728",
"sourceCodeHash": "0xd00b267dcf125e77c10b28c088be4378ec779927e3bcfeb6aa9a7f3d51370490"
},
"src/L1/ProtocolVersions.sol": {
"initCodeHash": "0x5a76c8530cb24cf23d3baacc6eefaac226382af13f1e2a35535d2ec2b0573b29",
Expand Down Expand Up @@ -72,20 +72,20 @@
"sourceCodeHash": "0xd0471c328c1d17c5863261322bf8d5aff2e7e9e3a1135631a993aa75667621df"
},
"src/L2/L2CrossDomainMessenger.sol": {
"initCodeHash": "0x6117d2ca80029c802b1e5cc36341f03ec48efd07df0251121d3faf5e93aa5901",
"sourceCodeHash": "0x48001529220d274c5cd2e84787239b6d2244780d23894e0a8e96550a40be18fe"
"initCodeHash": "0xe160be403df12709c371c33195d1b9c3b5e9499e902e86bdabc8eed749c3fd61",
"sourceCodeHash": "0x12ea125038b87e259a0d203e119faa6e9726ab2bdbc30430f820ccd48fe87e14"
},
"src/L2/L2ERC721Bridge.sol": {
"initCodeHash": "0xe0c4646e3372d53c294028ecbeff97b1ecb14cf7e44361b112c62b0c0d956ea2",
"sourceCodeHash": "0xc3c7fe397f91baa0b89567b8ecb2c0aff522000fd4889346e1dfec2a281486fe"
"initCodeHash": "0x863f0f5b410983f3e51cd97c60a3a42915141b7452864d0e176571d640002b81",
"sourceCodeHash": "0xc05bfcfadfd09a56cfea68e7c1853faa36d114d9a54cd307348be143e442c35a"
},
"src/L2/L2StandardBridge.sol": {
"initCodeHash": "0x0b5ec1511a7059f8eed938e68a2258485a3e24ac9ebef1f386e8dd6725b1a7c4",
"sourceCodeHash": "0xf59e693939236d00dbc5e21a5ba3e94eb442967e6a4533973d805c391e554465"
"initCodeHash": "0xba5b288a396b34488ba7be68473305529c7da7c43e5f1cfc48d6a4aecd014103",
"sourceCodeHash": "0x9dd26676cd1276c807ffd4747236783c5170d0919c70693e70b7e4c4c2675429"
},
"src/L2/L2StandardBridgeInterop.sol": {
"initCodeHash": "0xa34db426a412a36c06b7a172a107af4b075d1df6997e9bb5619e14f8e52de49c",
"sourceCodeHash": "0xc2c5c34bfe7bf2833c2b4dec73f403b4c3a57d26ef0b19a9b6e4958dc0908090"
"initCodeHash": "0xa7a2e7efe8116ebb21f47ee06c1e62d3b2f5a046478094611a2ab4b714154030",
"sourceCodeHash": "0xde724da82ecf3c96b330c2876a7285b6e2b933ac599241eaa3174c443ebbe33a"
},
"src/L2/L2ToL1MessagePasser.sol": {
"initCodeHash": "0xf9d82084dcef31a3737a76d8ee4e5842ea190d0f77ed4678adb3bbb95217050f",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver {
address private spacer_253_0_20;

/// @notice Semantic version.
/// @custom:semver 2.5.0
string public constant version = "2.5.0";
/// @custom:semver 2.6.0
string public constant version = "2.6.0";

/// @notice Constructs the L1CrossDomainMessenger contract.
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/src/L1/L1ERC721Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ contract L1ERC721Bridge is ERC721Bridge, ISemver {
ISuperchainConfig public superchainConfig;

/// @notice Semantic version.
/// @custom:semver 2.3.1
string public constant version = "2.3.1";
/// @custom:semver 2.4.0
string public constant version = "2.4.0";

/// @notice Constructs the L1ERC721Bridge contract.
constructor() ERC721Bridge() {
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/src/L1/L1StandardBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ contract L1StandardBridge is StandardBridge, ISemver {
);

/// @notice Semantic version.
/// @custom:semver 2.2.2
string public constant version = "2.2.2";
/// @custom:semver 2.3.0
string public constant version = "2.3.0";

/// @notice Address of the SuperchainConfig contract.
ISuperchainConfig public superchainConfig;
Expand Down
18 changes: 16 additions & 2 deletions packages/contracts-bedrock/src/L1/OPContractsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,20 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase {
assertValidOpChainConfig(_opChainConfigs[i]);
ISystemConfig.Addresses memory opChainAddrs = _opChainConfigs[i].systemConfigProxy.getAddresses();

// -------- Upgrade Contracts Stored in SystemConfig --------

// OptimismPortal and L1CrossDomainMessenger are being upgraded to include the fixes
// for EIP-7623 (minimum gas limits for L1 -> L2 messages).
upgradeTo(_opChainConfigs[i].proxyAdmin, opChainAddrs.optimismPortal, impls.optimismPortalImpl);
upgradeTo(
_opChainConfigs[i].proxyAdmin, opChainAddrs.l1CrossDomainMessenger, impls.l1CrossDomainMessengerImpl
);

// L1ERC721Bridge and L1StandardBridge are being upgraded to include the tweaks to the
// EOA checking code for EIP-7702 (code length == 23).
upgradeTo(_opChainConfigs[i].proxyAdmin, opChainAddrs.l1ERC721Bridge, impls.l1ERC721BridgeImpl);
upgradeTo(_opChainConfigs[i].proxyAdmin, opChainAddrs.l1StandardBridge, impls.l1StandardBridgeImpl);

// -------- Discover and Upgrade Proofs Contracts --------

// All chains have the Permissioned Dispute Game.
Expand Down Expand Up @@ -1216,9 +1230,9 @@ contract OPContractsManager is ISemver {

// -------- Constants and Variables --------

/// @custom:semver 1.7.0
/// @custom:semver 1.8.0
function version() public pure virtual returns (string memory) {
return "1.7.0";
return "1.8.0";
}

OPContractsManagerGameTypeAdder public immutable opcmGameTypeAdder;
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts-bedrock/src/L1/OptimismPortal2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
}

/// @notice Semantic version.
/// @custom:semver 3.13.0
/// @custom:semver 3.14.0
function version() public pure virtual returns (string memory) {
return "3.13.0";
return "3.14.0";
}

/// @notice Constructs the OptimismPortal contract.
Expand Down Expand Up @@ -255,7 +255,7 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
/// @param _byteCount Number of bytes in the calldata.
/// @return The minimum gas limit for a deposit.
function minimumGasLimit(uint64 _byteCount) public pure returns (uint64) {
return _byteCount * 16 + 21000;
return _byteCount * 40 + 21000;
}

/// @notice Accepts value so that users can send ETH directly to this contract and have the
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ contract OptimismPortalInterop is OptimismPortal2 {
OptimismPortal2(_proofMaturityDelaySeconds, _disputeGameFinalityDelaySeconds)
{ }

/// @custom:semver +interop.2
/// @custom:semver +interop.3
function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop.2");
return string.concat(super.version(), "+interop.3");
}

/// @notice Sets static configuration options for the L2 system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { IL2ToL1MessagePasser } from "interfaces/L2/IL2ToL1MessagePasser.sol";
/// L2 on the L2 side. Users are generally encouraged to use this contract instead of lower
/// level message passing contracts.
contract L2CrossDomainMessenger is CrossDomainMessenger, ISemver {
/// @custom:semver 2.1.1-beta.8
string public constant version = "2.1.1-beta.8";
/// @custom:semver 2.2.0
string public constant version = "2.2.0";

/// @notice Constructs the L2CrossDomainMessenger contract.
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/src/L2/L2ERC721Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import { ISemver } from "interfaces/universal/ISemver.sol";
/// **WARNING**: Do not bridge an ERC721 that was originally deployed on Optimism. This
/// bridge ONLY supports ERC721s originally deployed on Ethereum.
contract L2ERC721Bridge is ERC721Bridge, ISemver {
/// @custom:semver 1.9.0
string public constant version = "1.9.0";
/// @custom:semver 1.10.0
string public constant version = "1.10.0";

/// @notice Constructs the L2ERC721Bridge contract.
constructor() ERC721Bridge() {
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/src/L2/L2StandardBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ contract L2StandardBridge is StandardBridge, ISemver {
);

/// @notice Semantic version.
/// @custom:semver 1.12.0
/// @custom:semver 1.13.0
function version() public pure virtual returns (string memory) {
return "1.12.0";
return "1.13.0";
}

/// @notice Constructs the L2StandardBridge contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ contract L2StandardBridgeInterop is L2StandardBridge {
event Converted(address indexed from, address indexed to, address indexed caller, uint256 amount);

/// @notice Semantic version.
/// @custom:semver +interop.9
/// @custom:semver +interop.10
function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop.9");
return string.concat(super.version(), "+interop.10");
}

/// @notice Converts `amount` of `from` token to `to` token.
Expand Down
5 changes: 4 additions & 1 deletion packages/contracts-bedrock/src/libraries/EOA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ library EOA {
function isSenderEOA() internal view returns (bool isEOA_) {
if (msg.sender == tx.origin) {
isEOA_ = true;
} else {
} else if (address(msg.sender).code.length == 23) {
// If the sender is not the origin, check for 7702 delegated EOAs.
assembly {
let ptr := mload(0x40)
mstore(0x40, add(ptr, 0x20))
extcodecopy(caller(), ptr, 0, 0x20)
isEOA_ := eq(shr(232, mload(ptr)), 0xEF0100)
}
} else {
// If more or less than 23 bytes of code, not a 7702 delegated EOA.
isEOA_ = false;
}
}
}
Loading