Commit 7ab3f1a2 authored by Karl Floersch's avatar Karl Floersch

Add some extra comments

parent 2bf05686
...@@ -107,30 +107,39 @@ contract OVM_CanonicalTransactionChain is OVM_BaseChain, Lib_AddressResolver { / ...@@ -107,30 +107,39 @@ contract OVM_CanonicalTransactionChain is OVM_BaseChain, Lib_AddressResolver { /
uint startingGas = gasleft(); uint startingGas = gasleft();
uint i; uint i;
while(startingGas - gasleft() > gasToConsume) { while(startingGas - gasleft() > gasToConsume) {
i++; // TODO: Replace this dumb work with minting gas token. i++; // TODO: Replace this dumb work with minting gas token. (not today)
} }
Lib_OVMCodec.QueueElement memory element = Lib_OVMCodec.QueueElement({ // This struct shows the form of the queueElement but isn't how we store it
timestamp: uint40(block.timestamp), // Lib_OVMCodec.QueueElement memory element = Lib_OVMCodec.QueueElement({
blockNumber: uint32(block.number), // timestamp: uint40(block.timestamp),
batchRoot: keccak256(abi.encodePacked( // blockNumber: uint32(block.number),
_target, // batchRoot: keccak256(abi.encodePacked(
_gasLimit, // _target,
_data // _gasLimit,
)) // _data
}); // ))
// });
// bytes32 extraData = timestamp + blockNumber
// queue.push2(batchRoot, ); // bytes28 timestampBlockNumber = concat(timestamp, blockNumber)
// We need access to the timestamp and blocknumber for EVERY queue tx
// So we use push2 to push both the batchRoot and timestampAndBlocknumber
// This way we have all the info we need for calling appendSequencerMultiBatch
// queue.push2(batchRoot, timestampBlocknNumber);
} }
// function getQueueIndex(uint queueIndex) {
// uint realIndex = queueIndex * 2;
// uint timestampBlockNumber = queueIndex * 2 + 1;
// }
/**************************************** /****************************************
* Public Functions: Batch Manipulation * * Public Functions: Batch Manipulation *
****************************************/ ****************************************/
// TODO: allow the sequencer to append queue batches at any time // TODO: allow the sequencer/users to append queue batches independently
/** /**
...@@ -157,7 +166,7 @@ contract OVM_CanonicalTransactionChain is OVM_BaseChain, Lib_AddressResolver { / ...@@ -157,7 +166,7 @@ contract OVM_CanonicalTransactionChain is OVM_BaseChain, Lib_AddressResolver { /
// TODO: Verify that there are no outstanding queue transactions which need to be processed // TODO: Verify that there are no outstanding queue transactions which need to be processed
// require( // require(
// block.timestamp < queue.get(lastQueueIndex).timestamp + forceInclusionPeriodSeconds, // block.timestamp < queue.getQueueElement(lastQueueIndex).timestamp + forceInclusionPeriodSeconds,
// "Older queue batches must be processed before a new sequencer batch." // "Older queue batches must be processed before a new sequencer batch."
// ); // );
...@@ -241,6 +250,9 @@ contract OVM_CanonicalTransactionChain is OVM_BaseChain, Lib_AddressResolver { / ...@@ -241,6 +250,9 @@ contract OVM_CanonicalTransactionChain is OVM_BaseChain, Lib_AddressResolver { /
_appendBatch(batchHeader); _appendBatch(batchHeader);
// lastOVMTimestamp = _queueElement.timestamp; // lastOVMTimestamp = _queueElement.timestamp;
// Put last timestamp & blockNumber into the extraData feild in push(...)
// bytes28 timestampBlockNumber = concat(timestamp, blockNumber)
// batches.push(batchHeader, timestampBlockNumber)
} }
// TODO docstring // TODO docstring
......
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