Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
d824abcc
Commit
d824abcc
authored
Dec 02, 2020
by
ben-chain
Committed by
GitHub
Dec 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify logic, fix tests (#78)
parent
0c3c6501
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
29 deletions
+9
-29
OVM_ExecutionManager.sol
...ptimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol
+7
-19
ovmSTATICCALL.spec.ts
.../OVM/execution/OVM_ExecutionManager/ovmSTATICCALL.spec.ts
+2
-10
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol
View file @
d824abcc
...
...
@@ -861,8 +861,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
"safeCREATE(address,bytes)",
_contractAddress,
_bytecode
),
false
)
);
// Need to make sure that this flag is reset so that it isn't propagated to creations in
...
...
@@ -906,8 +905,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
_nextMessageContext,
_gasLimit,
codeContractAddress,
_calldata,
_isStaticEntrypoint
_calldata
);
}
...
...
@@ -917,7 +915,6 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
* @param _gasLimit Amount of gas to be passed into this call.
* @param _target Address of the contract to call.
* @param _data Data to send along with the call.
* @param _isStaticEntrypoint Whether or not this is coming from ovmSTATICCALL.
* @return _success Whether or not the call returned (rather than reverted).
* @return _returndata Data returned by the call.
*/
...
...
@@ -925,8 +922,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
MessageContext memory _nextMessageContext,
uint256 _gasLimit,
address _target,
bytes memory _data,
bool _isStaticEntrypoint
bytes memory _data
)
internal
returns (
...
...
@@ -977,21 +973,13 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
_revertWithFlag(flag);
}
// STATIC_VIOLATION should be passed all the way back up to the previous ovmSTATICCALL
// in the call stack.
if (
flag == RevertFlag.STATIC_VIOLATION
&& _isStaticEntrypoint == false
) {
_revertWithFlag(flag);
}
// INTENTIONAL_REVERT and UNSAFE_BYTECODE aren't dependent on the input state, so we
// can just handle them like standard reverts. Our only change here is to record the
// gas refund reported by the call (enforced by safety checking).
// INTENTIONAL_REVERT, UNSAFE_BYTECODE, and STATIC_VIOLATION aren't dependent on the
// input state, so we can just handle them like standard reverts. Our only change here
// is to record the gas refund reported by the call (enforced by safety checking).
if (
flag == RevertFlag.INTENTIONAL_REVERT
|| flag == RevertFlag.UNSAFE_BYTECODE
|| flag == RevertFlag.STATIC_VIOLATION
) {
transactionRecord.ovmGasRefund = ovmGasRefund;
}
...
...
packages/contracts/test/contracts/OVM/execution/OVM_ExecutionManager/ovmSTATICCALL.spec.ts
View file @
d824abcc
...
...
@@ -226,14 +226,10 @@ const test_ovmSTATICCALL: TestDefinition = {
],
},
expectedReturnStatus
:
false
,
expectedReturnValue
:
{
flag
:
REVERT_FLAGS
.
STATIC_VIOLATION
,
nuisanceGasLeft
:
OVM_TX_GAS_LIMIT
/
2
,
},
},
],
},
expectedReturnStatus
:
fals
e
,
expectedReturnStatus
:
tru
e
,
},
],
},
...
...
@@ -321,14 +317,10 @@ const test_ovmSTATICCALL: TestDefinition = {
],
},
expectedReturnStatus
:
false
,
expectedReturnValue
:
{
flag
:
REVERT_FLAGS
.
STATIC_VIOLATION
,
nuisanceGasLeft
:
OVM_TX_GAS_LIMIT
/
2
,
},
},
],
},
expectedReturnStatus
:
fals
e
,
expectedReturnStatus
:
tru
e
,
},
],
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment