Skip to content

Commit

Permalink
feat: allow txList with zero byte
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Dec 9, 2022
1 parent 37992fd commit ebc5db6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/v1/V1Proposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ library V1Proposing {
bytes calldata txList = inputs[1];
// perform validation and populate some fields
require(
txList.length > 0 &&
txList.length >= 0 &&
txList.length <= LibConstants.K_TXLIST_MAX_BYTES &&
meta.txListHash == txList.hashTxList(),
"L1:txList"
Expand Down
4 changes: 4 additions & 0 deletions packages/protocol/contracts/libs/LibInvalidTxList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ library LibInvalidTxList {
Reason hint,
uint256 txIdx
) internal pure returns (Reason) {
if (encoded.length == 0) {
return Reason.OK;
}

if (encoded.length > LibConstants.K_TXLIST_MAX_BYTES) {
return Reason.BINARY_TOO_LARGE;
}
Expand Down

0 comments on commit ebc5db6

Please sign in to comment.