Skip to content

Commit

Permalink
feat: add timestamp field in block proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
AnshuJalan committed Jun 21, 2024
1 parent 0e7f488 commit 86894b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions SmartContracts/src/avs/PreconfTaskManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ contract PreconfTaskManager is IPreconfTaskManager {

// Store the hash of the transaction list and the proposer of the proposed block.
// The hash is later used to verify transaction inclusion/ordering in a preconfirmation.
proposedBlocks[_nextBlockId % PROPOSED_BLOCK_BUFFER_SIZE] =
IPreconfTaskManager.ProposedBlock({proposer: msg.sender, txListHash: keccak256(txList)});
proposedBlocks[_nextBlockId % PROPOSED_BLOCK_BUFFER_SIZE] = IPreconfTaskManager.ProposedBlock({
proposer: msg.sender,
timestamp: uint96(block.timestamp),
txListHash: keccak256(txList)
});

nextBlockId = _nextBlockId + 1;

Expand Down
2 changes: 2 additions & 0 deletions SmartContracts/src/interfaces/IPreconfTaskManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ interface IPreconfTaskManager {
struct ProposedBlock {
// Proposer of the L2 block
address proposer;
// L1 block timestamp
uint96 timestamp;
// Keccak hash of the RLP transaction list of the block
bytes32 txListHash;
}
Expand Down

0 comments on commit 86894b9

Please sign in to comment.