Postman Can Incorrectly Deliver a Message While Still Collecting the Fees
The message service allows cross chain message delivery, where the user can define the parameters of the message as:\\nfrom: Sender of the message _to: Receiver of the message _fee: The fees, the sender wants to pay to the postman to deliver the message valueSent: The value in the native currency of the chain to be sent with the message messageNumber: Nonce value which increments for every message _calldata: Calldata for the message to be executed on the destination chain\\nThe postman estimates the gas before claiming/delivering the message on the destination chain, thus avoiding scenarios where the fees sent are less than the cost of claiming the message.\\nHowever, there is nothing that restricts the postman from sending the gas equal to the fees paid by the user. Although it contributes to the MEV, where the postman can select the messages with higher fees first and deliver them prior to others, it also opens up an opportunity where the postman can deliver a message incorrectly while still claiming the fees.\\nOne such scenario is, where the low-level call to target `_to` makes another sub-call to another address, let's say `x`. Let's assume, the `_to` address doesn't check, whether the call to address `x` was successful or not. Now, if the postman supplies a gas, which makes the top-level call succeed, but the low-level call to `x` fails silently, the postman will still be retrieving the fees of claiming the message, even though the message was not correctly delivered.\\n```\\n(bool success, bytes memory returnData) = \\_to.call{ value: \\_value }(\\_calldata);\\nif (!success) {\\n if (returnData.length > 0) {\\n assembly {\\n let data\\_size := mload(returnData)\\n revert(add(32, returnData), data\\_size)\\n }\\n } else {\\n revert MessageSendingFailed(\\_to);\\n }\\n}\\n```\\n\\n```\\n(bool success, bytes memory returnData) = \\_to.call{ value: \\_value }(\\_calldata);\\nif (!success) {\\n if (returnData.length > 0) {\\n assembly {\\n let data\\_size := mload(returnData)\\n revert(add(32, returnData), data\\_size)\\n }\\n } else {\\n revert MessageSendingFailed(\\_to);\\n }\\n}\\n```\\n
Another parameter can be added to the message construct giving the user the option to define the amount of gas required to complete a transaction entirely. Also, a check can be added while claiming the message, to make sure the gas supplied by the postman is sufficient enough compared to the gas defined/demanded by the user. The cases, where the user can demand a huge amount of gas, can be simply avoided by doing the gas estimation, and if the demanded gas is more than the supplied fees, the postman will simply opt not to deliver the message
```\\n(bool success, bytes memory returnData) = \\_to.call{ value: \\_value }(\\_calldata);\\nif (!success) {\\n if (returnData.length > 0) {\\n assembly {\\n let data\\_size := mload(returnData)\\n revert(add(32, returnData), data\\_size)\\n }\\n } else {\\n revert MessageSendingFailed(\\_to);\\n }\\n}\\n```\\n