Skip to content

Commit a7479bc

Browse files
authored
chore: remove odyssey p256 precompile on 0x14 (#10220)
* remove odyssey 0x14 precompile * fmt
1 parent 0467078 commit a7479bc

File tree

2 files changed

+3
-34
lines changed

2 files changed

+3
-34
lines changed

crates/evm/core/src/precompiles.rs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
use alloy_primitives::{address, Address, Bytes, B256};
2-
use revm::{
3-
precompile::{secp256r1::p256_verify as revm_p256_verify, PrecompileWithAddress},
4-
primitives::{Precompile, PrecompileResult},
5-
};
1+
use alloy_primitives::{address, Address};
62

73
/// The ECRecover precompile address.
84
pub const EC_RECOVER: Address = address!("0x0000000000000000000000000000000000000001");
@@ -46,28 +42,4 @@ pub const PRECOMPILES: &[Address] = &[
4642
EC_PAIRING,
4743
BLAKE_2F,
4844
POINT_EVALUATION,
49-
ODYSSEY_P256_ADDRESS,
5045
];
51-
52-
/// [RIP-7212](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md) secp256r1 precompile address on Odyssey.
53-
///
54-
/// <https://github.com/ithacaxyz/odyssey/blob/482f4547631ae5c64ebea6a4b4ef93184a4abfee/crates/node/src/evm.rs#L35-L35>
55-
pub const ODYSSEY_P256_ADDRESS: Address = address!("0x0000000000000000000000000000000000000014");
56-
57-
/// Wrapper around revm P256 precompile, matching EIP-7212 spec.
58-
///
59-
/// Per Optimism implementation, P256 precompile returns empty bytes on failure, but per EIP-7212 it
60-
/// should be 32 bytes of zeros instead.
61-
pub fn p256_verify(input: &Bytes, gas_limit: u64) -> PrecompileResult {
62-
revm_p256_verify(input, gas_limit).map(|mut result| {
63-
if result.bytes.is_empty() {
64-
result.bytes = B256::default().into();
65-
}
66-
67-
result
68-
})
69-
}
70-
71-
/// [RIP-7212](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md) secp256r1 precompile.
72-
pub const ODYSSEY_P256: PrecompileWithAddress =
73-
PrecompileWithAddress(ODYSSEY_P256_ADDRESS, Precompile::Standard(p256_verify));

crates/evm/core/src/utils.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
pub use crate::ic::*;
2-
use crate::{
3-
backend::DatabaseExt, constants::DEFAULT_CREATE2_DEPLOYER_CODEHASH, precompiles::ODYSSEY_P256,
4-
InspectorExt,
5-
};
2+
use crate::{backend::DatabaseExt, constants::DEFAULT_CREATE2_DEPLOYER_CODEHASH, InspectorExt};
63
use alloy_consensus::BlockHeader;
74
use alloy_json_abi::{Function, JsonAbi};
85
use alloy_network::{AnyTxEnvelope, TransactionResponse};
@@ -312,7 +309,7 @@ pub fn odyssey_handler_register<EXT, DB: revm::Database>(handler: &mut EvmHandle
312309
handler.pre_execution.load_precompiles = Arc::new(move || {
313310
let mut loaded_precompiles = prev();
314311

315-
loaded_precompiles.extend([ODYSSEY_P256, P256VERIFY]);
312+
loaded_precompiles.extend([P256VERIFY]);
316313

317314
loaded_precompiles
318315
});

0 commit comments

Comments
 (0)