-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Optimize ERC-1271 path in isValidSignatureNowCalldata to avoid extra allocation #6123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Optimize ERC-1271 path in isValidSignatureNowCalldata to avoid extra allocation #6123
Conversation
🦋 Changeset detectedLatest commit: 0f5d11b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis change introduces a new internal view function Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-10-15T02:52:05.027ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The calldata variant of SignatureChecker was passing bytes calldata into a memory-based ERC-1271 helper, introducing an unnecessary calldata-to-memory allocation followed by another memory copy when assembling the low-level call. This change adds isValidERC1271SignatureNowCalldata(address,bytes32,bytes calldata), which constructs the call buffer with calldatacopy and preserves the existing ABI layout and success checks. The isValidSignatureNowCalldata branch for contract signers now uses the calldata helper, eliminating the extra allocation/copy. Behavior is unchanged; only gas/memory efficiency improves and this is consistent with the library’s existing calldata optimizations in ECDSA