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
cbc8925e
Commit
cbc8925e
authored
Sep 22, 2020
by
ben-chain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
partial context update
parent
c4733987
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
15 deletions
+60
-15
OVM_ExecutionManager.sol
...ptimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol
+47
-11
iOVM_ExecutionManager.sol
...imistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol
+10
-2
Lib_OVMCodec.sol
...acts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol
+3
-2
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol
View file @
cbc8925e
...
...
@@ -185,33 +185,33 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
}
/**
* @notice Overrides
ORIGIN
.
* @return _
ORIGIN Address of the ORIGIN
within the transaction context.
* @notice Overrides
TIMESTAMP
.
* @return _
TIMESTAMP Value of the TIMESTAMP
within the transaction context.
*/
function ovm
ORIGIN
()
function ovm
TIMESTAMP
()
override
public
view
returns (
address _ORIGIN
uint256 _TIMESTAMP
)
{
return transactionContext.ovm
ORIGIN
;
return transactionContext.ovm
TIMESTAMP
;
}
/**
* @notice Overrides
TIMESTAMP
.
* @return _
TIMESTAMP Value of the TIMESTAMP
within the transaction context.
* @notice Overrides
NUMBER
.
* @return _
NUMBER Value of the NUMBER
within the transaction context.
*/
function ovm
TIMESTAMP
()
function ovm
NUMBER
()
override
public
view
returns (
uint256 _
TIMESTAMP
uint256 _
NUMBER
)
{
return transactionContext.ovm
TIMESTAMP
;
return transactionContext.ovm
NUMBER
;
}
/**
...
...
@@ -244,6 +244,39 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
return globalContext.ovmCHAINID;
}
/*********************************
* Opcodes: L2 Execution Context *
*********************************/
/**
* @notice Specifies from which L1 rollup queue this transaction originated from.
* @return _queueOrigin Address of the CALLER within the current message context.
*/
function ovmL1QUEUEORIGIN()
override
public
view
returns (
Lib_OVMCodec.QueueOrigin _queueOrigin
)
{
return transactionContext.ovmL1QUEUEORIGIN;
}
/**
* @notice Specifies what L1 EOA, if any, sent this transaction.
* @return _l1TxOrigin Address of the EOA which send the tx into L2 from L1.
*/
function ovmL1TXORIGIN()
override
public
view
returns (
address _l1TxOrigin
)
{
return transactionContext.ovmL1TXORIGIN;
}
/********************
* Opcodes: Halting *
...
...
@@ -1646,8 +1679,10 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
internal
{
transactionContext.ovmTIMESTAMP = _transaction.timestamp;
transactionContext.ovmNUMBER = _transaction.number;
transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
transactionContext.ovmQUEUEORIGIN = _transaction.queueOrigin;
transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
transactionContext.ovmL1TXORIGIN = _transaction.l1Txorigin;
transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
}
...
...
@@ -1659,6 +1694,7 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
{
transactionContext.ovmORIGIN = address(0);
transactionContext.ovmTIMESTAMP = 0;
transactionContext.ovmNUMBER = 0;
transactionContext.ovmGASLIMIT = 0;
transactionContext.ovmTXGASLIMIT = 0;
transactionContext.ovmQUEUEORIGIN = 0;
...
...
packages/contracts/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol
View file @
cbc8925e
...
...
@@ -54,9 +54,10 @@ interface iOVM_ExecutionManager {
struct TransactionContext {
address ovmORIGIN;
uint256 ovmTIMESTAMP;
uint256 ovmNUMBER;
uint256 ovmGASLIMIT;
uint256 ovmTXGASLIMIT;
uint256 ovmQUEUEORIGIN;
uint256 ovm
L1
QUEUEORIGIN;
}
struct TransactionRecord {
...
...
@@ -92,12 +93,19 @@ interface iOVM_ExecutionManager {
function ovmCALLER() external view returns (address _caller);
function ovmADDRESS() external view returns (address _address);
function ovmORIGIN() external view returns (address _origin);
function ovmTIMESTAMP() external view returns (uint256 _timestamp);
function ovmGASLIMIT() external view returns (uint256 _gasLimit);
function ovmCHAINID() external view returns (uint256 _chainId);
/**********************
* L2 Context Opcodes *
**********************/
function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
/*******************
* Halting Opcodes *
*******************/
...
...
packages/contracts/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol
View file @
cbc8925e
...
...
@@ -45,9 +45,10 @@ library Lib_OVMCodec {
struct Transaction {
uint256 timestamp;
uint256 queueOrigin;
uint256 number;
uint256 l1QueueOrigin;
address l1Txorigin;
address entrypoint;
address origin;
address msgSender;
uint256 gasLimit;
bytes 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