Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit e9ef362

Browse files
committed
chore: remove bls precompiles
1 parent 5fa5db4 commit e9ef362

File tree

7 files changed

+4
-119
lines changed

7 files changed

+4
-119
lines changed

crates/node/src/evm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! This currently configures the instructions defined in [EIP3074-instructions](https://github.com/paradigmxyz/eip3074-instructions), and the
1111
//! precompiles defined by [`alphanet_precompile`].
1212
13-
use alphanet_precompile::{bls12_381, secp256r1};
13+
use alphanet_precompile::secp256r1;
1414
use reth::{
1515
primitives::{
1616
revm_primitives::{CfgEnvWithHandlerCfg, TxEnv},
@@ -51,7 +51,6 @@ impl AlphaNetEvmConfig {
5151
ContextPrecompiles::new(PrecompileSpecId::from_spec_id(spec_id));
5252

5353
loaded_precompiles.extend(secp256r1::precompiles());
54-
loaded_precompiles.extend(bls12_381::precompiles());
5554

5655
loaded_precompiles
5756
});

crates/precompile/src/bls12_381.rs

Lines changed: 0 additions & 28 deletions
This file was deleted.

crates/precompile/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@
33
//! Implementations of EVM precompiled contracts for AlphaNet.
44
//!
55
//! Alphanet currently implements the following EIPs, which define precompiles:
6-
//! - [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537): Precompile for BLS12-381 curve
7-
//! operations. The precompile implementation is located in the [bls12_381] module.
86
//! - [EIP-7212](https://eips.ethereum.org/EIPS/eip-7212): Precompile for secp256r1 Curve Support.
97
//! The precompile implementation is located in the [secp256r1] module.
108
119
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
1210

13-
/// The implementation of [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537): Precompile for BLS12-381 curve.
14-
pub mod bls12_381;
15-
1611
/// The implementation of [EIP-7212](https://eips.ethereum.org/EIPS/eip-7212): Precompile for secp256r1 Curve Support.
1712
pub mod secp256r1;
1813

crates/testing/resources/bls12-381/foundry.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

crates/testing/resources/bls12-381/out/BlsG1AddCaller.sol/BlsG1AddCaller.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

crates/testing/resources/bls12-381/src/BlsG1AddCaller.sol

Lines changed: 0 additions & 11 deletions
This file was deleted.

crates/testing/src/tests.rs

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,4 @@
1-
use crate::test_suite::TestSuite;
2-
use alloy::{
3-
primitives::hex,
4-
providers::{Provider, ProviderBuilder},
5-
sol,
6-
};
7-
use alphanet_node::node::AlphaNetNode;
8-
use once_cell::sync::Lazy;
9-
use reth::{builder::NodeHandle, tasks::TaskManager};
10-
use reth_chainspec::DEV;
11-
use reth_node_builder::NodeBuilder;
12-
use reth_node_core::{args::RpcServerArgs, node_config::NodeConfig};
13-
use reth_primitives::Bytes;
14-
use url::Url;
15-
16-
sol!(
17-
#[allow(clippy::too_many_arguments)]
18-
#[allow(missing_docs)]
19-
#[sol(rpc)]
20-
BlsG1AddCaller,
21-
"resources/bls12-381/out/BlsG1AddCaller.sol/BlsG1AddCaller.json"
22-
);
23-
24-
#[tokio::test]
25-
async fn test_bls12_381_g1_add() {
26-
reth_tracing::init_test_tracing();
27-
let tasks = TaskManager::current();
28-
let test_suite = TestSuite::new();
29-
30-
// spin up alphanet node
31-
let chain_spec = Lazy::force(&DEV).clone();
32-
let node_config = NodeConfig::test()
33-
.dev()
34-
.with_chain(chain_spec)
35-
.with_rpc(RpcServerArgs::default().with_unused_ports().with_http());
36-
let NodeHandle { node, .. } = NodeBuilder::new(node_config)
37-
.testing_node(tasks.executor())
38-
.node(AlphaNetNode::default())
39-
.launch()
40-
.await
41-
.unwrap();
42-
43-
let rpc_url = node.rpc_server_handle().http_url().unwrap();
44-
let deployer = test_suite.signer();
45-
let provider = ProviderBuilder::new()
46-
.with_recommended_fillers()
47-
.wallet(deployer)
48-
.on_http(Url::parse(&rpc_url).unwrap());
49-
let base_fee = provider.get_gas_price().await.unwrap();
50-
51-
// Deploy caller contract
52-
let caller_builder = BlsG1AddCaller::deploy_builder(&provider);
53-
let estimate = caller_builder.estimate_gas().await.unwrap();
54-
let caller_address =
55-
caller_builder.gas(estimate).gas_price(base_fee).nonce(0).deploy().await.unwrap();
56-
let caller = BlsG1AddCaller::new(caller_address, &provider);
57-
58-
// test input and expected output from https://github.com/ethereum/execution-spec-tests/blob/main/tests/prague/eip2537_bls_12_381_precompiles/vectors/add_G1_bls.json
59-
let data = hex!("0000000000000000000000000000000017f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb0000000000000000000000000000000008b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e100000000000000000000000000000000112b98340eee2777cc3c14163dea3ec97977ac3dc5c70da32e6e87578f44912e902ccef9efe28d4a78b8999dfbca942600000000000000000000000000000000186b28d92356c4dfec4b5201ad099dbdede3781f8998ddf929b4cd7756192185ca7b8f4ef7088f813270ac3d48868a21");
60-
61-
let builder = caller.call(data.into());
62-
let call_return = builder.call().await.unwrap();
63-
let expected: Bytes = hex!("000000000000000000000000000000000a40300ce2dec9888b60690e9a41d3004fda4886854573974fab73b046d3147ba5b7a5bde85279ffede1b45b3918d82d0000000000000000000000000000000006d3d887e9f53b9ec4eb6cedf5607226754b07c01ace7834f57f3e7315faefb739e59018e22c492006190fba4a870025").into();
64-
65-
assert_eq!(expected, call_return._output);
1+
#[test]
2+
fn dummy() {
3+
// kept here to prevent the ci from failing on no tests
664
}

0 commit comments

Comments
 (0)