From b2d43d750527436be48ad5c5bc34c0d4ef811eb0 Mon Sep 17 00:00:00 2001 From: bear Date: Wed, 11 Jan 2023 17:54:58 +0800 Subject: [PATCH 1/2] Delete BaseFee --- Cargo.lock | 18 --------- node/src/chain_spec/crab.rs | 2 - node/src/chain_spec/darwinia.rs | 2 - node/src/chain_spec/pangolin.rs | 2 - runtime/crab/Cargo.toml | 3 -- runtime/crab/src/lib.rs | 3 +- runtime/crab/src/pallets/base_fee.rs | 47 ------------------------ runtime/crab/src/pallets/mod.rs | 2 - runtime/darwinia/Cargo.toml | 3 -- runtime/darwinia/src/lib.rs | 3 +- runtime/darwinia/src/pallets/base_fee.rs | 47 ------------------------ runtime/darwinia/src/pallets/mod.rs | 2 - runtime/pangolin/Cargo.toml | 3 -- runtime/pangolin/src/lib.rs | 3 +- runtime/pangolin/src/pallets/base_fee.rs | 47 ------------------------ runtime/pangolin/src/pallets/mod.rs | 2 - 16 files changed, 3 insertions(+), 186 deletions(-) delete mode 100644 runtime/crab/src/pallets/base_fee.rs delete mode 100644 runtime/darwinia/src/pallets/base_fee.rs delete mode 100644 runtime/pangolin/src/pallets/base_fee.rs diff --git a/Cargo.lock b/Cargo.lock index 6e9e6cf1..80bea8b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1350,7 +1350,6 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", - "pallet-base-fee", "pallet-bridge-dispatch", "pallet-bridge-grandpa", "pallet-bridge-messages", @@ -2509,7 +2508,6 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", - "pallet-base-fee", "pallet-bridge-dispatch", "pallet-bridge-grandpa", "pallet-bridge-messages", @@ -6239,21 +6237,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-base-fee" -version = "1.0.0" -source = "git+https://github.com/darwinia-network/frontier?branch=prepare-polkadot-v0.9.33#e66dc0457406dde585f6189bdcd685776814eb83" -dependencies = [ - "fp-evm", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-runtime", -] - [[package]] name = "pallet-beefy" version = "4.0.0-dev" @@ -7344,7 +7327,6 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", - "pallet-base-fee", "pallet-bridge-dispatch", "pallet-bridge-grandpa", "pallet-bridge-messages", diff --git a/node/src/chain_spec/crab.rs b/node/src/chain_spec/crab.rs index 88eacdf4..fd75137c 100644 --- a/node/src/chain_spec/crab.rs +++ b/node/src/chain_spec/crab.rs @@ -199,7 +199,6 @@ pub fn genesis_config() -> ChainSpec { // EVM stuff. ethereum: Default::default(), evm: Default::default(), - base_fee: Default::default(), // S2S stuff. bridge_polkadot_grandpa: Default::default(), @@ -332,7 +331,6 @@ fn testnet_genesis( ) }, }, - base_fee: Default::default(), // S2S stuff. bridge_polkadot_grandpa: Default::default(), diff --git a/node/src/chain_spec/darwinia.rs b/node/src/chain_spec/darwinia.rs index e8204b74..4bcf03db 100644 --- a/node/src/chain_spec/darwinia.rs +++ b/node/src/chain_spec/darwinia.rs @@ -199,7 +199,6 @@ pub fn genesis_config() -> ChainSpec { // EVM stuff. ethereum: Default::default(), evm: Default::default(), - base_fee: Default::default(), // S2S stuff. bridge_kusama_grandpa: Default::default(), @@ -332,7 +331,6 @@ fn testnet_genesis( ) }, }, - base_fee: Default::default(), // S2S stuff. bridge_kusama_grandpa: Default::default(), diff --git a/node/src/chain_spec/pangolin.rs b/node/src/chain_spec/pangolin.rs index 25d1239b..83e18c29 100644 --- a/node/src/chain_spec/pangolin.rs +++ b/node/src/chain_spec/pangolin.rs @@ -199,7 +199,6 @@ pub fn genesis_config() -> ChainSpec { // EVM stuff. ethereum: Default::default(), evm: Default::default(), - base_fee: Default::default(), } }, Vec::new(), @@ -326,6 +325,5 @@ fn testnet_genesis( ) }, }, - base_fee: Default::default(), } } diff --git a/runtime/crab/Cargo.toml b/runtime/crab/Cargo.toml index 29f4c602..5c8f1ca2 100644 --- a/runtime/crab/Cargo.toml +++ b/runtime/crab/Cargo.toml @@ -62,7 +62,6 @@ pallet-fee-market = { default-features = false, git = "https://github.com # frontier fp-rpc = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } fp-self-contained = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } -pallet-base-fee = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-ethereum = { default-features = false, features = ["forbid-evm-reentrancy"], git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-evm = { default-features = false, features = ["forbid-evm-reentrancy"], git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-evm-precompile-blake2 = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } @@ -175,7 +174,6 @@ std = [ # frontier "fp-rpc/std", "fp-self-contained/std", - "pallet-base-fee/std", "pallet-ethereum/std", "pallet-evm/std", "pallet-evm-precompile-blake2/std", @@ -310,7 +308,6 @@ try-runtime = [ "parachain-info/try-runtime", # frontier - "pallet-base-fee/try-runtime", "pallet-ethereum/try-runtime", "pallet-evm/try-runtime", diff --git a/runtime/crab/src/lib.rs b/runtime/crab/src/lib.rs index fa3558ab..985736f0 100644 --- a/runtime/crab/src/lib.rs +++ b/runtime/crab/src/lib.rs @@ -312,7 +312,6 @@ frame_support::construct_runtime! { // EVM stuff. Ethereum: pallet_ethereum = 31, Evm: pallet_evm = 32, - BaseFee: pallet_base_fee = 33, MessageTransact: darwinia_message_transact = 39, // S2S stuff. @@ -618,7 +617,7 @@ sp_api::impl_runtime_apis! { } fn elasticity() -> Option { - Some(BaseFee::elasticity()) + None } fn gas_limit_multiplier_support() { diff --git a/runtime/crab/src/pallets/base_fee.rs b/runtime/crab/src/pallets/base_fee.rs deleted file mode 100644 index d1da68d2..00000000 --- a/runtime/crab/src/pallets/base_fee.rs +++ /dev/null @@ -1,47 +0,0 @@ -// This file is part of Darwinia. -// -// Copyright (C) 2018-2023 Darwinia Network -// SPDX-License-Identifier: GPL-3.0 -// -// Darwinia is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Darwinia is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Darwinia. If not, see . - -// darwinia -use crate::*; - -frame_support::parameter_types! { - pub DefaultBaseFeePerGas: U256 = U256::from(1_000_000_000); - pub DefaultElasticity: Permill = Permill::from_parts(125_000); -} - -pub struct BaseFeeThreshold; -impl pallet_base_fee::BaseFeeThreshold for BaseFeeThreshold { - fn lower() -> Permill { - Permill::zero() - } - - fn ideal() -> Permill { - Permill::from_parts(500_000) - } - - fn upper() -> Permill { - Permill::from_parts(1_000_000) - } -} - -impl pallet_base_fee::Config for Runtime { - type DefaultBaseFeePerGas = DefaultBaseFeePerGas; - type DefaultElasticity = DefaultElasticity; - type RuntimeEvent = RuntimeEvent; - type Threshold = BaseFeeThreshold; -} diff --git a/runtime/crab/src/pallets/mod.rs b/runtime/crab/src/pallets/mod.rs index 8849eddb..894ac1c3 100644 --- a/runtime/crab/src/pallets/mod.rs +++ b/runtime/crab/src/pallets/mod.rs @@ -103,8 +103,6 @@ mod ethereum; mod evm; pub use evm::*; -mod base_fee; - mod message_transact; // S2S stuff. diff --git a/runtime/darwinia/Cargo.toml b/runtime/darwinia/Cargo.toml index b6265467..4802522f 100644 --- a/runtime/darwinia/Cargo.toml +++ b/runtime/darwinia/Cargo.toml @@ -62,7 +62,6 @@ pallet-fee-market = { default-features = false, git = "https://github.com # frontier fp-rpc = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } fp-self-contained = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } -pallet-base-fee = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-ethereum = { default-features = false, features = ["forbid-evm-reentrancy"], git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-evm = { default-features = false, features = ["forbid-evm-reentrancy"], git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-evm-precompile-blake2 = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } @@ -175,7 +174,6 @@ std = [ # frontier "fp-rpc/std", "fp-self-contained/std", - "pallet-base-fee/std", "pallet-ethereum/std", "pallet-evm/std", "pallet-evm-precompile-blake2/std", @@ -310,7 +308,6 @@ try-runtime = [ "parachain-info/try-runtime", # frontier - "pallet-base-fee/try-runtime", "pallet-ethereum/try-runtime", "pallet-evm/try-runtime", diff --git a/runtime/darwinia/src/lib.rs b/runtime/darwinia/src/lib.rs index 0884d5a8..b4579bec 100644 --- a/runtime/darwinia/src/lib.rs +++ b/runtime/darwinia/src/lib.rs @@ -312,7 +312,6 @@ frame_support::construct_runtime! { // EVM stuff. Ethereum: pallet_ethereum = 31, Evm: pallet_evm = 32, - BaseFee: pallet_base_fee = 33, MessageTransact: darwinia_message_transact = 39, // S2S stuff. @@ -618,7 +617,7 @@ sp_api::impl_runtime_apis! { } fn elasticity() -> Option { - Some(BaseFee::elasticity()) + None } fn gas_limit_multiplier_support() { diff --git a/runtime/darwinia/src/pallets/base_fee.rs b/runtime/darwinia/src/pallets/base_fee.rs deleted file mode 100644 index d1da68d2..00000000 --- a/runtime/darwinia/src/pallets/base_fee.rs +++ /dev/null @@ -1,47 +0,0 @@ -// This file is part of Darwinia. -// -// Copyright (C) 2018-2023 Darwinia Network -// SPDX-License-Identifier: GPL-3.0 -// -// Darwinia is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Darwinia is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Darwinia. If not, see . - -// darwinia -use crate::*; - -frame_support::parameter_types! { - pub DefaultBaseFeePerGas: U256 = U256::from(1_000_000_000); - pub DefaultElasticity: Permill = Permill::from_parts(125_000); -} - -pub struct BaseFeeThreshold; -impl pallet_base_fee::BaseFeeThreshold for BaseFeeThreshold { - fn lower() -> Permill { - Permill::zero() - } - - fn ideal() -> Permill { - Permill::from_parts(500_000) - } - - fn upper() -> Permill { - Permill::from_parts(1_000_000) - } -} - -impl pallet_base_fee::Config for Runtime { - type DefaultBaseFeePerGas = DefaultBaseFeePerGas; - type DefaultElasticity = DefaultElasticity; - type RuntimeEvent = RuntimeEvent; - type Threshold = BaseFeeThreshold; -} diff --git a/runtime/darwinia/src/pallets/mod.rs b/runtime/darwinia/src/pallets/mod.rs index 8849eddb..894ac1c3 100644 --- a/runtime/darwinia/src/pallets/mod.rs +++ b/runtime/darwinia/src/pallets/mod.rs @@ -103,8 +103,6 @@ mod ethereum; mod evm; pub use evm::*; -mod base_fee; - mod message_transact; // S2S stuff. diff --git a/runtime/pangolin/Cargo.toml b/runtime/pangolin/Cargo.toml index 3dee7331..3586db9a 100644 --- a/runtime/pangolin/Cargo.toml +++ b/runtime/pangolin/Cargo.toml @@ -61,7 +61,6 @@ pallet-fee-market = { default-features = false, git = "https://github.com/d # frontier fp-rpc = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } fp-self-contained = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } -pallet-base-fee = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-ethereum = { default-features = false, features = ["forbid-evm-reentrancy"], git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-evm = { default-features = false, features = ["forbid-evm-reentrancy"], git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } pallet-evm-precompile-blake2 = { default-features = false, git = "https://github.com/darwinia-network/frontier", branch = "prepare-polkadot-v0.9.33" } @@ -173,7 +172,6 @@ std = [ # frontier "fp-rpc/std", "fp-self-contained/std", - "pallet-base-fee/std", "pallet-ethereum/std", "pallet-evm/std", "pallet-evm-precompile-blake2/std", @@ -307,7 +305,6 @@ try-runtime = [ "parachain-info/try-runtime", # frontier - "pallet-base-fee/try-runtime", "pallet-ethereum/try-runtime", "pallet-evm/try-runtime", diff --git a/runtime/pangolin/src/lib.rs b/runtime/pangolin/src/lib.rs index 0a95d999..770b115d 100644 --- a/runtime/pangolin/src/lib.rs +++ b/runtime/pangolin/src/lib.rs @@ -309,7 +309,6 @@ frame_support::construct_runtime! { // EVM stuff. Ethereum: pallet_ethereum = 31, Evm: pallet_evm = 32, - BaseFee: pallet_base_fee = 33, MessageTransact: darwinia_message_transact = 39, } } @@ -608,7 +607,7 @@ sp_api::impl_runtime_apis! { } fn elasticity() -> Option { - Some(BaseFee::elasticity()) + None } fn gas_limit_multiplier_support() { diff --git a/runtime/pangolin/src/pallets/base_fee.rs b/runtime/pangolin/src/pallets/base_fee.rs deleted file mode 100644 index d1da68d2..00000000 --- a/runtime/pangolin/src/pallets/base_fee.rs +++ /dev/null @@ -1,47 +0,0 @@ -// This file is part of Darwinia. -// -// Copyright (C) 2018-2023 Darwinia Network -// SPDX-License-Identifier: GPL-3.0 -// -// Darwinia is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Darwinia is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Darwinia. If not, see . - -// darwinia -use crate::*; - -frame_support::parameter_types! { - pub DefaultBaseFeePerGas: U256 = U256::from(1_000_000_000); - pub DefaultElasticity: Permill = Permill::from_parts(125_000); -} - -pub struct BaseFeeThreshold; -impl pallet_base_fee::BaseFeeThreshold for BaseFeeThreshold { - fn lower() -> Permill { - Permill::zero() - } - - fn ideal() -> Permill { - Permill::from_parts(500_000) - } - - fn upper() -> Permill { - Permill::from_parts(1_000_000) - } -} - -impl pallet_base_fee::Config for Runtime { - type DefaultBaseFeePerGas = DefaultBaseFeePerGas; - type DefaultElasticity = DefaultElasticity; - type RuntimeEvent = RuntimeEvent; - type Threshold = BaseFeeThreshold; -} diff --git a/runtime/pangolin/src/pallets/mod.rs b/runtime/pangolin/src/pallets/mod.rs index a1a9c569..15db7fd3 100644 --- a/runtime/pangolin/src/pallets/mod.rs +++ b/runtime/pangolin/src/pallets/mod.rs @@ -103,6 +103,4 @@ mod ethereum; mod evm; pub use evm::*; -mod base_fee; - mod message_transact; From 611850572654fb44ab1dcb50ee54ae798d1b2a64 Mon Sep 17 00:00:00 2001 From: bear Date: Wed, 11 Jan 2023 18:02:50 +0800 Subject: [PATCH 2/2] Fix todo --- runtime/crab/src/lib.rs | 4 +--- runtime/darwinia/src/lib.rs | 1 - runtime/pangolin/src/lib.rs | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/runtime/crab/src/lib.rs b/runtime/crab/src/lib.rs index 985736f0..d91bf044 100644 --- a/runtime/crab/src/lib.rs +++ b/runtime/crab/src/lib.rs @@ -620,9 +620,7 @@ sp_api::impl_runtime_apis! { None } - fn gas_limit_multiplier_support() { - todo!() - } + fn gas_limit_multiplier_support() {} } impl fp_rpc::ConvertTransactionRuntimeApi for Runtime { diff --git a/runtime/darwinia/src/lib.rs b/runtime/darwinia/src/lib.rs index b4579bec..8c8c07ac 100644 --- a/runtime/darwinia/src/lib.rs +++ b/runtime/darwinia/src/lib.rs @@ -621,7 +621,6 @@ sp_api::impl_runtime_apis! { } fn gas_limit_multiplier_support() { - todo!() } } diff --git a/runtime/pangolin/src/lib.rs b/runtime/pangolin/src/lib.rs index 770b115d..b0d1f194 100644 --- a/runtime/pangolin/src/lib.rs +++ b/runtime/pangolin/src/lib.rs @@ -611,7 +611,6 @@ sp_api::impl_runtime_apis! { } fn gas_limit_multiplier_support() { - todo!() } }