Skip to content

Commit

Permalink
Remove the dynamic fee + base fee on peaq
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypan authored and Jay Pan committed Oct 9, 2024
1 parent 4d36a9f commit bd5fced
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 95 deletions.
21 changes: 0 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ fp-evm = { git = "https://github.com/peaqnetwork/frontier", branch = "peaq-polka
fp-rpc = { git = "https://github.com/peaqnetwork/frontier", branch = "peaq-polkadot-v1.7.2", default-features = false }
fp-self-contained = { git = "https://github.com/peaqnetwork/frontier", branch = "peaq-polkadot-v1.7.2", default-features = false, features = ["serde"] }
pallet-base-fee = { git = "https://github.com/peaqnetwork/frontier", branch = "peaq-polkadot-v1.7.2", default-features = false }
pallet-dynamic-fee = { git = "https://github.com/peaqnetwork/frontier", branch = "peaq-polkadot-v1.7.2", default-features = false }
pallet-ethereum = { git = "https://github.com/peaqnetwork/frontier", branch = "peaq-polkadot-v1.7.2", default-features = false }
pallet-evm = { git = "https://github.com/peaqnetwork/frontier", branch = "peaq-polkadot-v1.7.2", default-features = false }
pallet-evm-precompile-blake2 = { git = "https://github.com/peaqnetwork/frontier", branch = "peaq-polkadot-v1.7.2", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ fp-consensus = { workspace = true, default-features = true }
fp-storage = { workspace = true, default-features = true }
fp-rpc = { workspace = true, default-features = true }
pallet-base-fee = { workspace = true, default-features = true }
pallet-dynamic-fee = { workspace = true, default-features = true }
pallet-ethereum = { workspace = true, default-features = true }
pallet-evm = { workspace = true, default-features = true }
tokio = { workspace = true, default-features = true, features = [ "macros", "sync" ] }
Expand Down
1 change: 0 additions & 1 deletion node/src/parachain/dev_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ fn configure_genesis(
..Default::default()
},
ethereum: EthereumConfig { ..Default::default() },
dynamic_fee: Default::default(),
base_fee: Default::default(),
polkadot_xcm: peaq_dev_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
Expand Down
1 change: 0 additions & 1 deletion node/src/parachain/krest_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ fn configure_genesis(
..Default::default()
},
ethereum: EthereumConfig { ..Default::default() },
dynamic_fee: Default::default(),
base_fee: Default::default(),
polkadot_xcm: peaq_krest_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
Expand Down
2 changes: 0 additions & 2 deletions node/src/parachain/peaq_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ fn configure_genesis(
..Default::default()
},
ethereum: EthereumConfig { ..Default::default() },
dynamic_fee: Default::default(),
base_fee: Default::default(),
polkadot_xcm: peaq_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
..Default::default()
Expand Down
3 changes: 0 additions & 3 deletions runtime/krest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ fp-evm = { workspace = true, default-features = false }
fp-rpc = { workspace = true, default-features = false }
fp-self-contained = { workspace = true, default-features = false }
pallet-base-fee = { workspace = true, default-features = false }
pallet-dynamic-fee = { workspace = true, default-features = false }
pallet-ethereum = { workspace = true, default-features = false, features = ["forbid-evm-reentrancy"] }
pallet-evm = { workspace = true, default-features = false, features = ["forbid-evm-reentrancy"] }
pallet-evm-precompile-blake2 = { workspace = true, default-features = false }
Expand Down Expand Up @@ -227,7 +226,6 @@ std = [
"fp-evm/std",
"fp-self-contained/std",
"pallet-base-fee/std",
"pallet-dynamic-fee/std",
"pallet-ethereum/std",
"pallet-evm/std",
"pallet-evm-precompile-simple/std",
Expand Down Expand Up @@ -328,7 +326,6 @@ try-runtime = [
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-evm/try-runtime",
"pallet-dynamic-fee/try-runtime",
"pallet-base-fee/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-contracts/try-runtime",
Expand Down
11 changes: 1 addition & 10 deletions runtime/krest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,14 +701,6 @@ impl pallet_ethereum::Config for Runtime {
type ExtraDataLength = ConstU32<30>;
}

frame_support::parameter_types! {
pub BoundDivision: U256 = U256::from(1024);
}

impl pallet_dynamic_fee::Config for Runtime {
type MinGasPriceBoundDivisor = BoundDivision;
}

frame_support::parameter_types! {
pub DefaultBaseFeePerGas: U256 = U256::from(1024);
pub DefaultElasticity: Permill = Permill::zero();
Expand Down Expand Up @@ -1060,8 +1052,7 @@ construct_runtime!(
// EVM
Ethereum: pallet_ethereum = 11,
EVM: pallet_evm = 12,
// [TODO] Disable the fee evm calculator pallet because we didn't use that
DynamicFee: pallet_dynamic_fee = 13,
// DynamicFee: pallet_dynamic_fee = 13,
BaseFee: pallet_base_fee::{Pallet, Call, Storage, Config<T>, Event} = 14,

// Parachain
Expand Down
3 changes: 0 additions & 3 deletions runtime/peaq-dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ fp-evm = { workspace = true, default-features = false }
fp-rpc = { workspace = true, default-features = false }
fp-self-contained = { workspace = true, default-features = false }
pallet-base-fee = { workspace = true, default-features = false }
pallet-dynamic-fee = { workspace = true, default-features = false }
pallet-ethereum = { workspace = true, default-features = false, features = ["forbid-evm-reentrancy"] }
pallet-evm = { workspace = true, default-features = false, features = ["forbid-evm-reentrancy"] }
pallet-evm-precompile-blake2 = { workspace = true, default-features = false }
Expand Down Expand Up @@ -229,7 +228,6 @@ std = [
"fp-evm/std",
"fp-self-contained/std",
"pallet-base-fee/std",
"pallet-dynamic-fee/std",
"pallet-ethereum/std",
"pallet-evm/std",
"pallet-evm-precompile-simple/std",
Expand Down Expand Up @@ -330,7 +328,6 @@ try-runtime = [
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-evm/try-runtime",
"pallet-dynamic-fee/try-runtime",
"pallet-base-fee/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-contracts/try-runtime",
Expand Down
11 changes: 1 addition & 10 deletions runtime/peaq-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,14 +707,6 @@ impl pallet_ethereum::Config for Runtime {
type ExtraDataLength = ConstU32<30>;
}

frame_support::parameter_types! {
pub BoundDivision: U256 = U256::from(1024);
}

impl pallet_dynamic_fee::Config for Runtime {
type MinGasPriceBoundDivisor = BoundDivision;
}

frame_support::parameter_types! {
pub DefaultBaseFeePerGas: U256 = U256::from(1024);
pub DefaultElasticity: Permill = Permill::zero();
Expand Down Expand Up @@ -1074,8 +1066,7 @@ construct_runtime!(
// EVM
Ethereum: pallet_ethereum = 11,
EVM: pallet_evm = 12,
// [TODO] Disable the fee evm calculator pallet because we didn't use that
DynamicFee: pallet_dynamic_fee = 13,
// DynamicFee: pallet_dynamic_fee = 13,
BaseFee: pallet_base_fee::{Pallet, Call, Storage, Config<T>, Event} = 14,

// Parachain
Expand Down
6 changes: 0 additions & 6 deletions runtime/peaq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ sp-io = { workspace = true, default-features = false }
fp-evm = { workspace = true, default-features = false }
fp-rpc = { workspace = true, default-features = false }
fp-self-contained = { workspace = true, default-features = false }
pallet-base-fee = { workspace = true, default-features = false }
pallet-dynamic-fee = { workspace = true, default-features = false }
pallet-ethereum = { workspace = true, default-features = false, features = ["forbid-evm-reentrancy"] }
pallet-evm = { workspace = true, default-features = false, features = ["forbid-evm-reentrancy"] }
pallet-evm-precompile-blake2 = { workspace = true, default-features = false }
Expand Down Expand Up @@ -226,8 +224,6 @@ std = [
"sp-io/std",
"fp-evm/std",
"fp-self-contained/std",
"pallet-base-fee/std",
"pallet-dynamic-fee/std",
"pallet-ethereum/std",
"pallet-evm/std",
"pallet-evm-precompile-simple/std",
Expand Down Expand Up @@ -328,8 +324,6 @@ try-runtime = [
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-evm/try-runtime",
"pallet-dynamic-fee/try-runtime",
"pallet-base-fee/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-contracts/try-runtime",
"pallet-utility/try-runtime",
Expand Down
38 changes: 2 additions & 36 deletions runtime/peaq/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,39 +749,6 @@ impl pallet_ethereum::Config for Runtime {
type ExtraDataLength = ConstU32<30>;
}

frame_support::parameter_types! {
pub BoundDivision: U256 = U256::from(1024);
}

impl pallet_dynamic_fee::Config for Runtime {
type MinGasPriceBoundDivisor = BoundDivision;
}

frame_support::parameter_types! {
pub DefaultBaseFeePerGas: U256 = U256::from(1024);
pub DefaultElasticity: Permill = Permill::zero();
}

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 RuntimeEvent = RuntimeEvent;
type Threshold = BaseFeeThreshold;
type DefaultBaseFeePerGas = DefaultBaseFeePerGas;
type DefaultElasticity = DefaultElasticity;
}

impl pallet_insecure_randomness_collective_flip::Config for Runtime {}

// Parachain
Expand Down Expand Up @@ -1107,9 +1074,8 @@ construct_runtime!(
// EVM
Ethereum: pallet_ethereum = 11,
EVM: pallet_evm = 12,
// [TODO] We should disable the fee evm calculator pallet because we didn't use that anymore
DynamicFee: pallet_dynamic_fee = 13,
BaseFee: pallet_base_fee::{Pallet, Call, Storage, Config<T>, Event} = 14,
// DynamicFee: pallet_dynamic_fee = 13,
// BaseFee: pallet_base_fee::{Pallet, Call, Storage, Config<T>, Event} = 14,

// Parachain
InflationManager: inflation_manager::{Pallet, Call, Storage, Config<T>, Event<T>} = 15,
Expand Down

0 comments on commit bd5fced

Please sign in to comment.