Skip to content

Commit

Permalink
feat: optimize dep
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhAnGeek committed Nov 11, 2024
1 parent 4197e85 commit eb6eb74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ portable = ["revm-primitives/portable", "c-kzg?/portable"]
# Use `secp256k1` as a faster alternative to `k256`.
# The problem that `secp256k1` has is it fails to build for `wasm` target on Windows and Mac as it is c lib.
# In Linux it passes. If you don't require to build wasm on win/mac, it is safe to use it and it is enabled by default.
secp256k1 = ["dep:secp256k1"]
secp256k1 = ["dep:secp256k1", "tendermint"]

# Enables the BLS12-381 precompiles.
blst = ["dep:blst"]
Expand Down
6 changes: 0 additions & 6 deletions crates/precompile/src/tm_secp256k1.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#![allow(unused_imports)]
#![allow(dead_code)]
use crate::{Bytes, Error, Precompile, PrecompileError, PrecompileResult, PrecompileWithAddress};
use revm_primitives::PrecompileOutput;
use secp256k1::{ecdsa, Message, PublicKey};
#[cfg(feature = "bsc")]
use tendermint::{account, public_key};

/// Tendermint SECP256K1 signature recover precompile for BSC.
#[cfg(feature = "bsc")]
pub(crate) const TM_SECP256K1_SIGNATURE_RECOVER: PrecompileWithAddress = PrecompileWithAddress(
crate::u64_to_address(105),
Precompile::Standard(tm_secp256k1_signature_recover_run),
Expand All @@ -24,7 +20,6 @@ const SECP256K1_SIGNATURE_MSGHASH_LENGTH: usize = 32;
/// | PubKey | Signature | SignatureMsgHash |
///
/// | 33 bytes | 64 bytes | 32 bytes |
#[cfg(feature = "bsc")]
fn tm_secp256k1_signature_recover_run(input: &Bytes, gas_limit: u64) -> PrecompileResult {
const TM_SECP256K1_SIGNATURE_RECOVER_BASE: u64 = 3_000;

Expand Down Expand Up @@ -76,7 +71,6 @@ fn tm_secp256k1_signature_recover_run(input: &Bytes, gas_limit: u64) -> Precompi
}

#[cfg(test)]
#[cfg(feature = "bsc")]
mod tests {
use super::*;
use revm_primitives::hex;
Expand Down

0 comments on commit eb6eb74

Please sign in to comment.