From 1f00a30ebf50b4e75277dcf81033039a7ef46767 Mon Sep 17 00:00:00 2001 From: Kelvin Fichter Date: Mon, 26 Apr 2021 14:57:46 -0400 Subject: [PATCH 1/3] fix[contracts]: Remove unnecessary EXTCODECOPY logic --- .../OVM/execution/OVM_ExecutionManager.sol | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol b/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol index b88c771c030a1..999c47d536d12 100644 --- a/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol +++ b/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol @@ -747,13 +747,6 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { bytes memory _code ) { - // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of - // return data. By blocking reads of one byte, we're able to use the condition that an - // OVM_ExecutionManager function return value having a length of exactly one byte indicates - // an error without an explicit revert. If users were able to read a single byte, they - // could forcibly trigger behavior that should only be available to this contract. - uint256 length = _length == 1 ? 2 : _length; - return Lib_EthUtils.getCode( _getAccountEthAddress(_contract), _offset, From faa7d87460b4c773bd56aa5c8a4acf6a0a6d378f Mon Sep 17 00:00:00 2001 From: Kelvin Fichter Date: Mon, 26 Apr 2021 14:59:24 -0400 Subject: [PATCH 2/3] chore[contracts]: Add changeset --- .changeset/twelve-items-sing.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/twelve-items-sing.md diff --git a/.changeset/twelve-items-sing.md b/.changeset/twelve-items-sing.md new file mode 100644 index 0000000000000..688bd369e7729 --- /dev/null +++ b/.changeset/twelve-items-sing.md @@ -0,0 +1,5 @@ +--- +"@eth-optimism/contracts": patch +--- + +Remove unused logic in ovmEXTCODECOPY From 6407e7574424862060602fe26f3776abaa82b65f Mon Sep 17 00:00:00 2001 From: smartcontracts Date: Mon, 26 Apr 2021 16:07:20 -0400 Subject: [PATCH 3/3] Update OVM_ExecutionManager.sol --- .../optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol b/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol index 999c47d536d12..6fbd2e3ab867b 100644 --- a/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol +++ b/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol @@ -750,7 +750,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { return Lib_EthUtils.getCode( _getAccountEthAddress(_contract), _offset, - length + _length ); }