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
c236b1d4
Commit
c236b1d4
authored
Sep 22, 2020
by
ben-chain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts building
parent
cbc8925e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
21 deletions
+20
-21
OVM_ExecutionManager.sol
...ptimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol
+8
-8
iOVM_ExecutionManager.sol
...imistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol
+3
-8
Lib_OVMCodec.sol
...acts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol
+9
-5
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol
View file @
c236b1d4
...
...
@@ -126,7 +126,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
// Make sure the transaction's gas limit is valid. We don't revert here because we reserve
// reverts for INVALID_STATE_ACCESS.
if (_isValidGasLimit(_transaction.gasLimit, _transaction.
q
ueueOrigin) == false) {
if (_isValidGasLimit(_transaction.gasLimit, _transaction.
l1Q
ueueOrigin) == false) {
return;
}
...
...
@@ -143,7 +143,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
uint256 gasUsed = gasProvided - gasleft();
// Update the cumulative gas based on the amount of gas used.
_updateCumulativeGas(gasUsed, _transaction.
q
ueueOrigin);
_updateCumulativeGas(gasUsed, _transaction.
l1Q
ueueOrigin);
// Wipe the execution context.
_resetContext();
...
...
@@ -1532,7 +1532,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
*/
function _isValidGasLimit(
uint256 _gasLimit,
uint256
_queueOrigin
Lib_OVMCodec.QueueOrigin
_queueOrigin
)
internal
returns (
...
...
@@ -1549,7 +1549,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
GasMetadataKey cumulativeGasKey;
GasMetadataKey prevEpochGasKey;
if (_queueOrigin ==
uint256(QueueOrigin.SEQUENCER_QUEUE)
) {
if (_queueOrigin ==
Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
) {
cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
} else {
...
...
@@ -1573,12 +1573,12 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
*/
function _updateCumulativeGas(
uint256 _gasUsed,
uint256
_queueOrigin
Lib_OVMCodec.QueueOrigin
_queueOrigin
)
internal
{
GasMetadataKey cumulativeGasKey;
if (_queueOrigin ==
uint256(QueueOrigin.SEQUENCER_QUEUE)
) {
if (_queueOrigin ==
Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
) {
cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
} else {
cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
...
...
@@ -1692,12 +1692,12 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
function _resetContext()
internal
{
transactionContext.ovmORIGIN = address(0);
transactionContext.ovm
L1TX
ORIGIN = address(0);
transactionContext.ovmTIMESTAMP = 0;
transactionContext.ovmNUMBER = 0;
transactionContext.ovmGASLIMIT = 0;
transactionContext.ovmTXGASLIMIT = 0;
transactionContext.ovm
QUEUEORIGIN = 0
;
transactionContext.ovm
L1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
;
transactionRecord.ovmGasRefund = 0;
...
...
packages/contracts/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol
View file @
c236b1d4
...
...
@@ -29,12 +29,6 @@ interface iOVM_ExecutionManager {
PREV_EPOCH_SEQUENCER_QUEUE_GAS,
PREV_EPOCH_L1TOL2_QUEUE_GAS
}
enum QueueOrigin {
SEQUENCER_QUEUE,
L1TOL2_QUEUE
}
/***********
* Structs *
...
...
@@ -52,12 +46,12 @@ interface iOVM_ExecutionManager {
}
struct TransactionContext {
address ovmORIGIN;
uint256 ovmTIMESTAMP;
uint256 ovmNUMBER;
uint256 ovmGASLIMIT;
uint256 ovmTXGASLIMIT;
uint256 ovmL1QUEUEORIGIN;
Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
address ovmL1TXORIGIN;
}
struct TransactionRecord {
...
...
@@ -94,6 +88,7 @@ interface iOVM_ExecutionManager {
function ovmCALLER() external view returns (address _caller);
function ovmADDRESS() external view returns (address _address);
function ovmTIMESTAMP() external view returns (uint256 _timestamp);
function ovmNUMBER() external view returns (uint256 _number);
function ovmGASLIMIT() external view returns (uint256 _gasLimit);
function ovmCHAINID() external view returns (uint256 _chainId);
...
...
packages/contracts/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol
View file @
c236b1d4
...
...
@@ -43,13 +43,17 @@ library Lib_OVMCodec {
bytes32[] siblings;
}
enum QueueOrigin {
SEQUENCER_QUEUE,
L1TOL2_QUEUE
}
struct Transaction {
uint256 timestamp;
uint256 number;
uint256
l1QueueOrigin;
QueueOrigin
l1QueueOrigin;
address l1Txorigin;
address entrypoint;
address msgSender;
uint256 gasLimit;
bytes data;
}
...
...
@@ -124,10 +128,10 @@ library Lib_OVMCodec {
{
return abi.encodePacked(
_transaction.timestamp,
_transaction.queueOrigin,
_transaction.number,
_transaction.l1QueueOrigin,
_transaction.l1Txorigin,
_transaction.entrypoint,
_transaction.origin,
_transaction.msgSender,
_transaction.gasLimit,
_transaction.data
);
...
...
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