Skip to content
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

P256.sol: support precompile as primary, use solidity as fallback #43

Merged
merged 2 commits into from
May 19, 2024

Conversation

nalinbhardwaj
Copy link
Member

@nalinbhardwaj nalinbhardwaj commented May 18, 2024

untested, need to figure out a way to test it against a deployment that is finalized before merging -- using foundry with Polygon Amoy testnet fork-url doesn't seem to work.

@nalinbhardwaj nalinbhardwaj requested a review from dcposch May 18, 2024 21:46
@nalinbhardwaj nalinbhardwaj changed the base branch from master to next May 18, 2024 21:46
@nalinbhardwaj nalinbhardwaj force-pushed the nibnalin/support-precompile branch from bdb0c18 to 4ad990d Compare May 18, 2024 21:50
src/P256.sol Outdated

return abi.decode(ret, (uint256)) == 1;
(bool success, bytes memory ret) = PRECOMPILE.staticcall(args);
if (success && ret.length > 0) return abi.decode(ret, (uint256)) == 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check will pass if the precompile is not deployed on a given chain...

Just confirmed that an undeployed contract (codesize 0) will return success=true, ret=empty array. And codesize will return 0 for the precompile address whether you're on a 7212 chain or not.

I think RIP-7212 is flawed and needs to be fixed

Copy link
Member

@dcposch dcposch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

@nalinbhardwaj nalinbhardwaj force-pushed the nibnalin/support-precompile branch from e671bd2 to fd46bca Compare May 19, 2024 05:01
@nalinbhardwaj nalinbhardwaj merged commit 09e769f into next May 19, 2024
5 checks passed
nalinbhardwaj added a commit that referenced this pull request May 19, 2024
* P256.sol: support precompile as primary, use solidity as fallback

* P256.sol: add fallback test
0xBigBoss pushed a commit to 0xBigBoss/p256-verifier that referenced this pull request Jul 11, 2024
…imo-eth#43)

* P256.sol: support precompile as primary, use solidity as fallback

* P256.sol: add fallback test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants