Repository navigation
feat(solidity-import): support ECDSA Yul signature unpacking, StorageSlot raw string/bytes slots, and error scalar casts (slice 40) - #2501
Conversation
…Slot raw string/bytes slots, and error scalar casts (slice 40)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11ef669195
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return some { | ||
| pre := buf.pre, | ||
| expr := .mload (.add buf.pointer (.literal (off - 32))) |
There was a problem hiding this comment.
Zero-pad the final materialized bytes word
When a root bytes memory parameter has a non-word-aligned length, this newly exposed mload can observe bytes past the declared payload. AbiLowering.bytesMemoryHead materializes each chunk with a full calldataload, so for a 33-byte value followed by nonzero trailing calldata, mload(add(b, 0x40)) returns those trailing bytes in the model; Solidity copies only the declared 33 bytes into memory and leaves the remaining 31 bytes zero. Mask/zero-pad the last copied word, or restrict this lowering to loads whose complete word is within the logical buffer.
Useful? React with 👍 / 👎.
Summary
mload(b)andmload(add(b, offset))foroffset >= 32 && offset % 32 == 0) on unshadowedbytes memoryandstring memoryvariables (yulByteBufferLoad?inCompiler/SolidityImport/Import.lean), enabling OpenZeppelinECDSA.tryRecover(bytes32, bytes memory)signature unpacking.isProvablyBoundedYulExpr:byte(i, x), comparisons,iszero, maskedand, highshr, boundedmod, or bounded literals) to narrow non-enum scalar locals (such asuint8 vinv := byte(0, mload(add(signature, 0x60)))), while keeping arbitrary unmasked narrow-local Yul assignments rejected.typeConversioncasts in custom-error revert arguments (revert ECDSAInvalidSignatureLength(uint256(errorArg))).bytes32slot wrappersStorageSlot.getStringSlot(bytes32 slot)andStorageSlot.getBytesSlot(bytes32 slot)ininlineStorageStructFn.EcdsaMerkleCheckpointsStorageSlotSequence), rejection tests, and mutation killers.