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

fix(evm): P256Verify address #9618

Merged
merged 3 commits into from
Jan 3, 2025
Merged

fix(evm): P256Verify address #9618

merged 3 commits into from
Jan 3, 2025

Conversation

yash-atreya
Copy link
Member

Motivation

Currently the P256Verify is injected at the wrong address i.e 0x14.

Solution

Inject it at 0x100 according to the spec: https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md#specification.
Maintains backward compatibility by also injecting it at 0x14.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

let's keep the constant as 0x14 and use revm's default address for 0x100 instead

@@ -52,7 +52,7 @@ pub const PRECOMPILES: &[Address] = &[
/// [EIP-7212](https://eips.ethereum.org/EIPS/eip-7212) secp256r1 precompile address on Odyssey.
///
/// <https://github.com/ithacaxyz/odyssey/blob/482f4547631ae5c64ebea6a4b4ef93184a4abfee/crates/node/src/evm.rs#L35-L35>
pub const ODYSSEY_P256_ADDRESS: Address = address!("0000000000000000000000000000000000000014");
pub const ODYSSEY_P256_ADDRESS: Address = address!("0000000000000000000000000000000000000100");
Copy link
Member

Choose a reason for hiding this comment

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

we deployed on 0x14 and will keep that address for odyssey, the 0x100 is the proposed RIP address, I think we should just add the precompile to both addresses instead, IIRC revm has a constant for 0x100

@yash-atreya yash-atreya enabled auto-merge (squash) January 3, 2025 10:58
@yash-atreya yash-atreya merged commit f7bb427 into master Jan 3, 2025
22 checks passed
@yash-atreya yash-atreya deleted the yash/fix-7212-addr branch January 3, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants