Skip to content

Commit

Permalink
fix messages compression
Browse files Browse the repository at this point in the history
  • Loading branch information
vladenysiuk committed May 28, 2024
1 parent cf1317f commit 41ca248
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions system-contracts/contracts/BatchAggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,15 @@ contract BatchAggregator is IBatchAggregator, ISystemContract {
calldataPtr += 4 + L2_TO_L1_LOG_SERIALIZE_SIZE * numberOfL2ToL1Logs;

/// Check messages
uint256 messageSliceStart = calldataPtr;
uint32 numberOfMessages = uint32(bytes4(_totalL2ToL1PubdataAndStateDiffs[calldataPtr:calldataPtr + 4]));
messageStorage[chainId].push(
_totalL2ToL1PubdataAndStateDiffs[calldataPtr:calldataPtr + 4 + numberOfMessages * 4]
);
calldataPtr += 4 + numberOfMessages * 4;
calldataPtr += 4;
bytes32 reconstructedChainedMessagesHash;
for (uint256 i = 0; i < numberOfMessages; ++i) {
uint32 currentMessageLength = uint32(bytes4(_totalL2ToL1PubdataAndStateDiffs[calldataPtr:calldataPtr + 4]));
calldataPtr += 4 + currentMessageLength;
}
messageStorage[chainId].push(_totalL2ToL1PubdataAndStateDiffs[messageSliceStart:calldataPtr]);

/// Check bytecodes
uint32 numberOfBytecodes = uint32(bytes4(_totalL2ToL1PubdataAndStateDiffs[calldataPtr:calldataPtr + 4]));
Expand Down

0 comments on commit 41ca248

Please sign in to comment.