Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,392 changes: 1,966 additions & 1,426 deletions Cargo.lock

Large diffs are not rendered by default.

150 changes: 75 additions & 75 deletions Cargo.toml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ fmt:
.PHONY: clippy clippy-release
# Run rust clippy with debug profile
clippy:
cargo clippy --all --all-targets --features=runtime-benchmarks,try-runtime -- -D warnings
SKIP_WASM_BUILD=1 cargo clippy --all --all-targets --features=runtime-benchmarks,try-runtime -- -D warnings
# Run rust clippy with release profile
clippy-release:
cargo clippy --release --all --all-targets --features=runtime-benchmarks,try-runtime -- -D warnings
SKIP_WASM_BUILD=1 cargo clippy --release --all --all-targets --features=runtime-benchmarks,try-runtime -- -D warnings

.PHONY: check check-release
# Check code with debug profile
Expand Down
2 changes: 1 addition & 1 deletion client/cli/src/frontier_db_cmd/mapping_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ where
}
}

impl<'a, B: BlockT, C: HeaderBackend<B>> FrontierDbMessage for MappingDb<'a, B, C> {}
impl<B: BlockT, C: HeaderBackend<B>> FrontierDbMessage for MappingDb<'_, B, C> {}
2 changes: 1 addition & 1 deletion client/cli/src/frontier_db_cmd/meta_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ impl<'a, B: BlockT, C: HeaderBackend<B>> MetaDb<'a, B, C> {
}
}

impl<'a, B: BlockT, C: HeaderBackend<B>> FrontierDbMessage for MetaDb<'a, B, C> {}
impl<B: BlockT, C: HeaderBackend<B>> FrontierDbMessage for MetaDb<'_, B, C> {}
30 changes: 15 additions & 15 deletions client/cli/src/frontier_db_cmd/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn schema_create_success_if_value_is_empty() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

assert_eq!(backend.meta().ethereum_schema(), Ok(None));
Expand Down Expand Up @@ -158,7 +158,7 @@ fn schema_create_fails_if_value_is_not_empty() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

let data_before = vec![(EthereumStorageSchema::V2, H256::default())];
Expand Down Expand Up @@ -189,7 +189,7 @@ fn schema_read_works() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

assert_eq!(backend.meta().ethereum_schema(), Ok(None));
Expand Down Expand Up @@ -221,7 +221,7 @@ fn schema_update_works() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

assert_eq!(backend.meta().ethereum_schema(), Ok(None));
Expand All @@ -248,7 +248,7 @@ fn schema_delete_works() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

let data = vec![(EthereumStorageSchema::V2, H256::default())];
Expand Down Expand Up @@ -279,7 +279,7 @@ fn tips_create_success_if_value_is_empty() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

assert_eq!(backend.meta().current_syncing_tips(), Ok(vec![]));
Expand Down Expand Up @@ -308,7 +308,7 @@ fn tips_create_fails_if_value_is_not_empty() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

let data_before = vec![H256::default()];
Expand Down Expand Up @@ -338,7 +338,7 @@ fn tips_read_works() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

assert_eq!(backend.meta().current_syncing_tips(), Ok(vec![]));
Expand Down Expand Up @@ -369,7 +369,7 @@ fn tips_update_works() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

assert_eq!(backend.meta().current_syncing_tips(), Ok(vec![]));
Expand All @@ -396,7 +396,7 @@ fn tips_delete_works() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

let data = vec![H256::default()];
Expand Down Expand Up @@ -427,7 +427,7 @@ fn non_existent_meta_static_keys_are_no_op() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");
let client = client;

Expand Down Expand Up @@ -501,7 +501,7 @@ fn not_deserializable_input_value_is_no_op() {
let (client, _) = TestClientBuilder::new().build_with_native_executor::<RuntimeApi, _>(None);
let client = Arc::new(client);
// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");
let client = client;

Expand Down Expand Up @@ -563,7 +563,7 @@ fn commitment_create() {
let test_value_path = test_json_file(&tmp, &TestValue::Commitment(block_hash));

// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

// Run the command using some ethereum block hash as key.
Expand Down Expand Up @@ -649,7 +649,7 @@ fn commitment_update() {
let test_value_path = test_json_file(&tmp, &TestValue::Commitment(block_a1_hash));

// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

// Run the command using some ethereum block hash as key.
Expand Down Expand Up @@ -774,7 +774,7 @@ fn mapping_read_works() {
let test_value_path = test_json_file(&tmp, &TestValue::Commitment(block_hash));

// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

// Create command using some ethereum block hash as key.
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-core/src/types/block_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl From<BlockCount> for u64 {
}
}

impl<'a> Visitor<'a> for BlockCountVisitor {
impl Visitor<'_> for BlockCountVisitor {
type Value = BlockCount;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-core/src/types/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl<'a> Deserialize<'a> for Bytes {

struct BytesVisitor;

impl<'a> Visitor<'a> for BytesVisitor {
impl Visitor<'_> for BytesVisitor {
type Value = Bytes;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-core/src/types/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<'a> Deserialize<'a> for Index {

struct IndexVisitor;

impl<'a> Visitor<'a> for IndexVisitor {
impl Visitor<'_> for IndexVisitor {
type Value = Index;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-v2/types/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'de> serde::Deserialize<'de> for Index {

struct IndexVisitor;

impl<'de> de::Visitor<'de> for IndexVisitor {
impl de::Visitor<'_> for IndexVisitor {
type Value = Index;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-v2/types/src/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<'de> serde::Deserialize<'de> for Summary {
D: serde::Deserializer<'de>,
{
struct SummaryVisitor;
impl<'de> de::Visitor<'de> for SummaryVisitor {
impl de::Visitor<'_> for SummaryVisitor {
type Value = Summary;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ evm = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
jsonrpsee = { workspace = true, features = ["server", "macros"] }
libsecp256k1 = { workspace = true }
libsecp256k1 = { workspace = true, features = ["static-context", "hmac"] }
log = { workspace = true }
prometheus = { version = "0.13.4", default-features = false }
rand = "0.9"
Expand Down
4 changes: 2 additions & 2 deletions client/rpc/src/eth/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ where
}
};

return Ok(Some(Receipt {
Ok(Some(Receipt {
transaction_hash: Some(status.transaction_hash),
transaction_index: Some(status.transaction_index.into()),
block_hash: Some(block_hash),
Expand Down Expand Up @@ -389,7 +389,7 @@ where
ethereum::ReceiptV4::EIP1559(_) => U256::from(2),
ethereum::ReceiptV4::EIP7702(_) => U256::from(4),
},
}));
}))
}
_ => Ok(None),
}
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ mod tests {
let client = Arc::new(client);

// Create a temporary frontier secondary DB.
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.into_path())
let backend = open_frontier_backend::<OpaqueBlock, _>(client.clone(), tmp.keep())
.expect("a temporary db was created");

// A random ethereum block hash to use
Expand Down
6 changes: 3 additions & 3 deletions client/storage/src/overrides/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub mod v1 {
}
}

impl<'a, B, C, BE> StorageOverride<B> for SchemaStorageOverrideRef<'a, B, C, BE>
impl<B, C, BE> StorageOverride<B> for SchemaStorageOverrideRef<'_, B, C, BE>
where
B: BlockT,
C: StorageProvider<B, BE> + Send + Sync,
Expand Down Expand Up @@ -203,7 +203,7 @@ pub mod v2 {
}
}

impl<'a, B, C, BE> StorageOverride<B> for SchemaStorageOverrideRef<'a, B, C, BE>
impl<B, C, BE> StorageOverride<B> for SchemaStorageOverrideRef<'_, B, C, BE>
where
B: BlockT,
C: StorageProvider<B, BE> + Send + Sync,
Expand Down Expand Up @@ -315,7 +315,7 @@ pub mod v3 {
}
}

impl<'a, B, C, BE> StorageOverride<B> for SchemaStorageOverrideRef<'a, B, C, BE>
impl<B, C, BE> StorageOverride<B> for SchemaStorageOverrideRef<'_, B, C, BE>
where
B: BlockT,
C: StorageProvider<B, BE> + Send + Sync,
Expand Down
1 change: 0 additions & 1 deletion frame/base-fee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pub mod pallet {

#[pallet::config]
pub trait Config: frame_system::Config {
type RuntimeEvent: From<Event> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// Lower and upper bounds for increasing / decreasing `BaseFeePerGas`.
type Threshold: BaseFeeThreshold;
type DefaultBaseFeePerGas: Get<U256>;
Expand Down
1 change: 0 additions & 1 deletion frame/base-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ impl BaseFeeThresholdT for BaseFeeThreshold {
}

impl Config for Test {
type RuntimeEvent = RuntimeEvent;
type Threshold = BaseFeeThreshold;
type DefaultBaseFeePerGas = DefaultBaseFeePerGas;
type DefaultElasticity = DefaultElasticity;
Expand Down
5 changes: 0 additions & 5 deletions frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@ pub mod pallet {

#[pallet::config(with_default)]
pub trait Config: frame_system::Config + pallet_evm::Config {
/// The overarching event type.
#[pallet::no_default_bounds]
type RuntimeEvent: From<Event> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// How Ethereum state root is calculated.
type StateRoot: Get<H256>;
/// What's included in the PostLog.
Expand All @@ -228,8 +225,6 @@ pub mod pallet {

#[register_default_impl(TestDefaultConfig)]
impl DefaultConfig for TestDefaultConfig {
#[inject_runtime_type]
type RuntimeEvent = ();
type StateRoot = IntermediateStateRoot<Self::Version>;
type PostLogContent = PostBlockAndTxnHashes;
type ExtraDataLength = ConstU32<30>;
Expand Down
2 changes: 1 addition & 1 deletion frame/evm-polkavm/src/vm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ pub struct Runtime<'a, T, H, M: ?Sized> {
_phantom_data: PhantomData<(T, M)>,
}

impl<'a, T: Config, H: PrecompileHandle, M: PolkaVmInstance> Runtime<'a, T, H, M> {
impl<T: Config, H: PrecompileHandle, M: PolkaVmInstance> Runtime<'_, T, H, M> {
pub fn handle_interrupt(
&mut self,
interrupt: Result<polkavm::InterruptKind, polkavm::Error>,
Expand Down
1 change: 0 additions & 1 deletion frame/evm/precompile/dispatch/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ impl pallet_evm::Config for Test {
type AddressMapping = IdentityAddressMapping;
type Currency = Balances;

type RuntimeEvent = RuntimeEvent;
type PrecompilesType = ();
type PrecompilesValue = ();
type ChainId = ();
Expand Down
6 changes: 0 additions & 6 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ pub mod pallet {
#[pallet::no_default]
type Currency: Currency<AccountIdOf<Self>> + Inspect<AccountIdOf<Self>>;

/// The overarching event type.
#[pallet::no_default_bounds]
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;

/// Precompiles associated with this EVM engine.
type PrecompilesType: PrecompileSet;
type PrecompilesValue: Get<Self::PrecompilesType>;
Expand Down Expand Up @@ -252,8 +248,6 @@ pub mod pallet {
type FeeCalculator = FixedGasPrice;
type GasWeightMapping = FixedGasWeightMapping<Self>;
type WeightPerGas = WeightPerGas;
#[inject_runtime_type]
type RuntimeEvent = ();
type PrecompilesType = ();
type PrecompilesValue = ();
type ChainId = ChainId;
Expand Down
5 changes: 2 additions & 3 deletions frame/evm/src/runner/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ impl<'vicinity, 'config, T: Config> SubstrateStackState<'vicinity, 'config, T> {
}
}

impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, 'config, T>
impl<T: Config> BackendT for SubstrateStackState<'_, '_, T>
where
BalanceOf<T>: TryFrom<U256> + Into<U256>,
{
Expand Down Expand Up @@ -1058,8 +1058,7 @@ where
}
}

impl<'vicinity, 'config, T: Config> StackStateT<'config>
for SubstrateStackState<'vicinity, 'config, T>
impl<'config, T: Config> StackStateT<'config> for SubstrateStackState<'_, 'config, T>
where
BalanceOf<T>: TryFrom<U256> + Into<U256>,
{
Expand Down
2 changes: 1 addition & 1 deletion precompiles/macro/src/precompile/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ where
attr.path()
.segments
.first()
.map_or(false, |segment| segment.ident == "precompile")
.is_some_and(|segment| segment.ident == "precompile")
};

while let Some(index) = attributes.iter().position(pred) {
Expand Down
2 changes: 1 addition & 1 deletion precompiles/src/precompile_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ pub struct RestrictiveHandle<'a, H> {
allow_subcalls: bool,
}

impl<'a, H: PrecompileHandle> PrecompileHandle for RestrictiveHandle<'a, H> {
impl<H: PrecompileHandle> PrecompileHandle for RestrictiveHandle<'_, H> {
fn call(
&mut self,
address: H160,
Expand Down
4 changes: 4 additions & 0 deletions precompiles/tests-external/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ pallet-timestamp = { workspace = true }
fp-evm = { workspace = true }
pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] }
precompile-utils = { workspace = true, features = ["testing"] }

[features]
default = ["std"]
std = []
1 change: 0 additions & 1 deletion precompiles/tests-external/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ impl pallet_evm::Config for Runtime {
type WithdrawOrigin = EnsureAddressNever<AccountId>;
type AddressMapping = AccountId;
type Currency = Balances;
type RuntimeEvent = RuntimeEvent;
type PrecompilesType = Precompiles<Runtime>;
type PrecompilesValue = PrecompilesValue;
type ChainId = ();
Expand Down
Loading
Loading