Potential Code Corrections
Function `_updateL1L2MessageStatusToReceived` and `addL1L2MessageHashes` allows status update for already received/sent/claimed messages.\\n```\\nfunction \\_updateL1L2MessageStatusToReceived(bytes32[] memory \\_messageHashes) internal {\\n uint256 messageHashArrayLength = \\_messageHashes.length;\\n\\n for (uint256 i; i < messageHashArrayLength; ) {\\n bytes32 messageHash = \\_messageHashes[i];\\n uint256 existingStatus = outboxL1L2MessageStatus[messageHash];\\n\\n if (existingStatus == INBOX\\_STATUS\\_UNKNOWN) {\\n revert L1L2MessageNotSent(messageHash);\\n }\\n\\n if (existingStatus != OUTBOX\\_STATUS\\_RECEIVED) {\\n outboxL1L2MessageStatus[messageHash] = OUTBOX\\_STATUS\\_RECEIVED;\\n }\\n\\n unchecked {\\n i++;\\n }\\n }\\n\\n emit L1L2MessagesReceivedOnL2(\\_messageHashes);\\n}\\n```\\n\\n```\\nfunction addL1L2MessageHashes(bytes32[] calldata \\_messageHashes) external onlyRole(L1\\_L2\\_MESSAGE\\_SETTER\\_ROLE) {\\n uint256 messageHashesLength = \\_messageHashes.length;\\n\\n if (messageHashesLength > 100) {\\n revert MessageHashesListLengthHigherThanOneHundred(messageHashesLength);\\n }\\n\\n for (uint256 i; i < messageHashesLength; ) {\\n bytes32 messageHash = \\_messageHashes[i];\\n if (inboxL1L2MessageStatus[messageHash] == INBOX\\_STATUS\\_UNKNOWN) {\\n inboxL1L2MessageStatus[messageHash] = INBOX\\_STATUS\\_RECEIVED;\\n }\\n unchecked {\\n i++;\\n }\\n }\\n\\n emit L1L2MessageHashesAddedToInbox(\\_messageHashes);\\n```\\n\\nIt may trigger false alarms, as they will still be a part of `L1L2MessagesReceivedOnL2` and `L1L2MessageHashesAddedToInbox`.\\n`_updateL1L2MessageStatusToReceived` checks the status of L1->L2 messages as:\\n```\\nif (existingStatus == INBOX\\_STATUS\\_UNKNOWN) {\\n revert L1L2MessageNotSent(messageHash);\\n}\\n```\\n\\nHowever, the status is need to be checked with `OUTBOX_STATUS_UNKNOWN` instead of `INBOX_STATUS_UNKNOWN` as it is an outbox message. This creates a hindrance in the code readability and should be fixed.\\nArray `timestampHashes` stores `l2BlockTimestamp` as integers, contrary to the hashes that the variable name states.\\n```\\ntimestampHashes[i] = blockInfo.l2BlockTimestamp;\\n```\\n\\nUnused error declaration\\n```\\n \\* dev Thrown when the decoding action is invalid.\\n \\*/\\n\\nerror InvalidAction();\\n```\\n\\nTransactionDecoder defines an error as `InvalidAction` which is supposed to be thrown when the decoding action is invalid, as stated in NATSPEC comment. However, it is currently unutilized.
Only update the status for sent messages in `_updateL1L2MessageStatusToReceived`, and unknown messages in `addL1L2MessageHashes` and revert otherwise, to avoid off-chain accounting errors.\\nCheck the status of L1->L2 sent message with `OUTBOX_STATUS_UNKNOWN` to increase code readability.\\nEither store timestamp hashes in the variable `timestampHashes` or update the variable name likewise.\\nRemove the error declaration if it is not serving any purpose.
```\\nfunction \\_updateL1L2MessageStatusToReceived(bytes32[] memory \\_messageHashes) internal {\\n uint256 messageHashArrayLength = \\_messageHashes.length;\\n\\n for (uint256 i; i < messageHashArrayLength; ) {\\n bytes32 messageHash = \\_messageHashes[i];\\n uint256 existingStatus = outboxL1L2MessageStatus[messageHash];\\n\\n if (existingStatus == INBOX\\_STATUS\\_UNKNOWN) {\\n revert L1L2MessageNotSent(messageHash);\\n }\\n\\n if (existingStatus != OUTBOX\\_STATUS\\_RECEIVED) {\\n outboxL1L2MessageStatus[messageHash] = OUTBOX\\_STATUS\\_RECEIVED;\\n }\\n\\n unchecked {\\n i++;\\n }\\n }\\n\\n emit L1L2MessagesReceivedOnL2(\\_messageHashes);\\n}\\n```\\n