Commit cbc8925e authored by ben-chain's avatar ben-chain

partial context update

parent c4733987
......@@ -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 ovmORIGIN()
function ovmTIMESTAMP()
override
public
view
returns (
address _ORIGIN
uint256 _TIMESTAMP
)
{
return transactionContext.ovmORIGIN;
return transactionContext.ovmTIMESTAMP;
}
/**
* @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 ovmTIMESTAMP()
function ovmNUMBER()
override
public
view
returns (
uint256 _TIMESTAMP
uint256 _NUMBER
)
{
return transactionContext.ovmTIMESTAMP;
return transactionContext.ovmNUMBER;
}
/**
......@@ -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;
......
......@@ -54,9 +54,10 @@ interface iOVM_ExecutionManager {
struct TransactionContext {
address ovmORIGIN;
uint256 ovmTIMESTAMP;
uint256 ovmNUMBER;
uint256 ovmGASLIMIT;
uint256 ovmTXGASLIMIT;
uint256 ovmQUEUEORIGIN;
uint256 ovmL1QUEUEORIGIN;
}
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 *
*******************/
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment