Skip to content

Commit

Permalink
Merge pull request #96 from maticnetwork/fix-exit-payload-length-check
Browse files Browse the repository at this point in the history
Remove exit payload length check
  • Loading branch information
jdkanani authored Sep 20, 2021
2 parents f9b5506 + 364982f commit 88dbf0a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions contracts/root/RootChainManager/RootChainManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,8 @@ contract RootChainManager is
* 9 - receiptLogIndex - Log Index to read from the receipt
*/
function exit(bytes calldata inputData) external override {
require(inputData.length == 10, "RootChainManager: BAD_PAYLOAD");

ExitPayloadReader.ExitPayload memory payload = inputData.toExitPayload();

bytes memory branchMaskBytes = payload.getBranchMaskAsBytes();
// checking if exit has already been processed
// unique exit is identified using hash of (blockNumber, branchMask, receiptLogIndex)
Expand Down
4 changes: 1 addition & 3 deletions contracts/tunnel/BaseRootTunnel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ abstract contract BaseRootTunnel is AccessControlMixin {
stateSender.syncState(childTunnel, message);
}

function _validateAndExtractMessage(bytes memory inputData) internal returns (bytes memory) {
require(inputData.length == 10, "RootTunnel: BAD_PAYLOAD");

function _validateAndExtractMessage(bytes memory inputData) internal returns (bytes memory) {
ExitPayloadReader.ExitPayload memory payload = inputData.toExitPayload();

bytes memory branchMaskBytes = payload.getBranchMaskAsBytes();
Expand Down
4 changes: 1 addition & 3 deletions flat/RootChainManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2247,10 +2247,8 @@ contract RootChainManager is
* 9 - receiptLogIndex - Log Index to read from the receipt
*/
function exit(bytes calldata inputData) external override {
require(inputData.length == 10, "RootChainManager: BAD_PAYLOAD");

ExitPayloadReader.ExitPayload memory payload = inputData.toExitPayload();

bytes memory branchMaskBytes = payload.getBranchMaskAsBytes();
// checking if exit has already been processed
// unique exit is identified using hash of (blockNumber, branchMask, receiptLogIndex)
Expand Down

0 comments on commit 88dbf0a

Please sign in to comment.