Skip to content

Commit 3dff0d3

Browse files
author
ZhAnGeek
committed
fix: removed unneccesary global mark
1 parent b8d59fa commit 3dff0d3

File tree

4 files changed

+50
-32
lines changed

4 files changed

+50
-32
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/precompile/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ secp256k1 = { version = ">=0.28, <=0.29", default-features = false, features = [
3838
"rand",
3939
"global-context",
4040
], optional = true }
41-
cometbft = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "5582327" }
42-
cometbft-light-client-verifier = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "5582327" }
43-
cometbft-proto = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "5582327" }
44-
cometbft-light-client = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "5582327", default-features = false }
41+
cometbft = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "ccf58da" }
42+
cometbft-light-client-verifier = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "ccf58da" }
43+
cometbft-proto = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "ccf58da" }
44+
cometbft-light-client = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "ccf58da", default-features = false }
4545
prost = { version = "0.12.6" }
4646
bls_on_arkworks = "0.3.0"
4747
tendermint = { git = "https://github.com/bnb-chain/tendermint-rs-parlia", rev = "8c21ccbd58a174e07eed2c9343e63ccd00f0fbd5", optional = true, features = ["secp256k1"] }
48-
parity-bytes = { version = "0.1.2", default-features = false }
48+
parity-bytes = { version = "0.1.2", default-features = false, optional = true }
4949

5050
# SHA2-256 and RIPEMD-160
5151
sha2 = { version = "0.10", default-features = false }
@@ -99,7 +99,7 @@ std = [
9999
hashbrown = ["revm-primitives/hashbrown"]
100100
asm-keccak = ["revm-primitives/asm-keccak"]
101101

102-
bsc = ["revm-primitives/bsc", "secp256k1", "secp256r1", "tendermint"]
102+
bsc = ["revm-primitives/bsc", "secp256k1", "secp256r1", "tendermint", "parity-bytes"]
103103

104104
optimism = ["revm-primitives/optimism", "secp256r1"]
105105
# Optimism default handler enabled Optimism handler register by default in EvmBuilder.

crates/precompile/src/lib.rs

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! Implementations of EVM precompiled contracts.
44
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
55
#![cfg_attr(not(feature = "std"), no_std)]
6-
#![allow(unused_mut)]
7-
#![allow(unused_crate_dependencies)]
86

97
#[macro_use]
108
#[cfg(not(feature = "std"))]
@@ -185,12 +183,17 @@ impl Precompiles {
185183
pub fn nano() -> &'static Self {
186184
static INSTANCE: OnceBox<Precompiles> = OnceBox::new();
187185
INSTANCE.get_or_init(|| {
188-
let mut precompiles = Self::istanbul().clone();
186+
let precompiles = Self::istanbul().clone();
187+
189188
#[cfg(feature = "bsc")]
190-
precompiles.extend([
191-
tendermint::TENDERMINT_HEADER_VALIDATION_NANO,
192-
iavl::IAVL_PROOF_VALIDATION_NANO,
193-
]);
189+
let precompiles = {
190+
let mut precompiles = precompiles;
191+
precompiles.extend([
192+
tendermint::TENDERMINT_HEADER_VALIDATION_NANO,
193+
iavl::IAVL_PROOF_VALIDATION_NANO,
194+
]);
195+
precompiles
196+
};
194197

195198
Box::new(precompiles)
196199
})
@@ -200,12 +203,17 @@ impl Precompiles {
200203
pub fn moran() -> &'static Self {
201204
static INSTANCE: OnceBox<Precompiles> = OnceBox::new();
202205
INSTANCE.get_or_init(|| {
203-
let mut precompiles = Self::istanbul().clone();
206+
let precompiles = Self::istanbul().clone();
207+
204208
#[cfg(feature = "bsc")]
205-
precompiles.extend([
206-
tendermint::TENDERMINT_HEADER_VALIDATION,
207-
iavl::IAVL_PROOF_VALIDATION_MORAN,
208-
]);
209+
let precompiles = {
210+
let mut precompiles = precompiles;
211+
precompiles.extend([
212+
tendermint::TENDERMINT_HEADER_VALIDATION,
213+
iavl::IAVL_PROOF_VALIDATION_MORAN,
214+
]);
215+
precompiles
216+
};
209217

210218
Box::new(precompiles)
211219
})
@@ -215,12 +223,17 @@ impl Precompiles {
215223
pub fn planck() -> &'static Self {
216224
static INSTANCE: OnceBox<Precompiles> = OnceBox::new();
217225
INSTANCE.get_or_init(|| {
218-
let mut precompiles = Self::istanbul().clone();
226+
let precompiles = Self::istanbul().clone();
227+
219228
#[cfg(feature = "bsc")]
220-
precompiles.extend([
221-
tendermint::TENDERMINT_HEADER_VALIDATION,
222-
iavl::IAVL_PROOF_VALIDATION_PLANCK,
223-
]);
229+
let precompiles = {
230+
let mut precompiles = precompiles;
231+
precompiles.extend([
232+
tendermint::TENDERMINT_HEADER_VALIDATION,
233+
iavl::IAVL_PROOF_VALIDATION_PLANCK,
234+
]);
235+
precompiles
236+
};
224237

225238
Box::new(precompiles)
226239
})
@@ -244,9 +257,13 @@ impl Precompiles {
244257
pub fn plato() -> &'static Self {
245258
static INSTANCE: OnceBox<Precompiles> = OnceBox::new();
246259
INSTANCE.get_or_init(|| {
247-
let mut precompiles = Self::luban().clone();
260+
let precompiles = Self::luban().clone();
248261
#[cfg(feature = "bsc")]
249-
precompiles.extend([iavl::IAVL_PROOF_VALIDATION_PLATO]);
262+
let precompiles = {
263+
let mut precompiles = precompiles;
264+
precompiles.extend([iavl::IAVL_PROOF_VALIDATION_PLATO]);
265+
precompiles
266+
};
250267

251268
Box::new(precompiles)
252269
})

crates/precompile/src/tm_secp256k1.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![allow(unused_imports)]
21
#![allow(dead_code)]
2+
#![cfg_attr(feature = "bsc", warn(dead_code))]
3+
34
use crate::{Bytes, Error, Precompile, PrecompileError, PrecompileResult, PrecompileWithAddress};
45
use revm_primitives::PrecompileOutput;
56
use secp256k1::{ecdsa, Message, PublicKey};

0 commit comments

Comments
 (0)