Skip to content

Commit f0ceef7

Browse files
authored
Merge pull request #1220 from opentensor/fix/remove-dynamic-fee
Remove dynamic fee pallet
2 parents 5ec05d6 + 7df774b commit f0ceef7

File tree

6 files changed

+7
-59
lines changed

6 files changed

+7
-59
lines changed

Cargo.lock

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

node/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ substrate-prometheus-endpoint = { workspace = true }
9595
fc-storage = { workspace = true }
9696
fc-db = { workspace = true }
9797
fc-consensus = { workspace = true }
98-
fp-dynamic-fee = { workspace = true }
9998
fc-api = { workspace = true }
10099
fc-rpc = { workspace = true }
101100
fc-rpc-core = { workspace = true }

node/src/ethereum.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ pub struct EthConfiguration {
5656
#[arg(long)]
5757
pub enable_dev_signer: bool,
5858

59-
/// The dynamic-fee pallet target gas price set by block author
60-
#[arg(long, default_value = "1")]
61-
pub target_gas_price: u64,
62-
6359
/// Maximum allowed gas limit will be `block.gas_limit * execute_gas_limit_multiplier`
6460
/// when using eth_call/eth_estimateGas.
6561
#[arg(long, default_value = "10")]

node/src/service.rs

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use sp_api::ProvideRuntimeApi;
1919
use sp_block_builder::BlockBuilder as BlockBuilderApi;
2020
use sp_consensus::Error as ConsensusError;
2121
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
22-
use sp_core::U256;
2322
use sp_runtime::traits::{Block as BlockT, Header, NumberFor};
2423
use std::{cell::RefCell, path::Path};
2524
use std::{marker::PhantomData, sync::Arc, time::Duration};
@@ -279,7 +278,7 @@ where
279278
pub fn build_aura_grandpa_import_queue(
280279
client: Arc<FullClient>,
281280
config: &Configuration,
282-
eth_config: &EthConfiguration,
281+
_eth_config: &EthConfiguration,
283282
task_manager: &TaskManager,
284283
telemetry: Option<TelemetryHandle>,
285284
grandpa_block_import: GrandpaBlockImport,
@@ -294,16 +293,14 @@ where
294293
);
295294

296295
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
297-
let target_gas_price = eth_config.target_gas_price;
298296
let create_inherent_data_providers = move |_, ()| async move {
299297
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
300298
let slot =
301299
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
302300
*timestamp,
303301
slot_duration,
304302
);
305-
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
306-
Ok((slot, timestamp, dynamic_fee))
303+
Ok((slot, timestamp))
307304
};
308305

309306
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _>(
@@ -521,7 +518,6 @@ where
521518
));
522519

523520
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
524-
let target_gas_price = eth_config.target_gas_price;
525521
let pending_create_inherent_data_providers = move |_, ()| async move {
526522
let current = sp_timestamp::InherentDataProvider::from_system_time();
527523
let next_slot = current
@@ -533,8 +529,7 @@ where
533529
*timestamp,
534530
slot_duration,
535531
);
536-
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
537-
Ok((slot, timestamp, dynamic_fee))
532+
Ok((slot, timestamp))
538533
};
539534

540535
Box::new(move |subscription_task_executor| {
@@ -613,7 +608,6 @@ where
613608
// manual-seal authorship
614609
if let Some(sealing) = sealing {
615610
run_manual_seal_authorship(
616-
&eth_config,
617611
sealing,
618612
client,
619613
transaction_pool,
@@ -639,15 +633,13 @@ where
639633
);
640634

641635
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
642-
let target_gas_price = eth_config.target_gas_price;
643636
let create_inherent_data_providers = move |_, ()| async move {
644637
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
645638
let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
646639
*timestamp,
647640
slot_duration,
648641
);
649-
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
650-
Ok((slot, timestamp, dynamic_fee))
642+
Ok((slot, timestamp))
651643
};
652644

653645
let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _>(
@@ -770,7 +762,6 @@ pub fn new_chain_ops(
770762

771763
#[allow(clippy::too_many_arguments)]
772764
fn run_manual_seal_authorship(
773-
eth_config: &EthConfiguration,
774765
sealing: Sealing,
775766
client: Arc<FullClient>,
776767
transaction_pool: Arc<FullPool<Block, FullClient>>,
@@ -820,12 +811,8 @@ fn run_manual_seal_authorship(
820811
}
821812
}
822813

823-
let target_gas_price = eth_config.target_gas_price;
824-
let create_inherent_data_providers = move |_, ()| async move {
825-
let timestamp = MockTimestampInherentDataProvider;
826-
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
827-
Ok((timestamp, dynamic_fee))
828-
};
814+
let create_inherent_data_providers =
815+
move |_, ()| async move { Ok(MockTimestampInherentDataProvider) };
829816

830817
let manual_seal = match sealing {
831818
Sealing::Manual => future::Either::Left(sc_consensus_manual_seal::run_manual_seal(

runtime/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ fp-self-contained = { workspace = true }
103103

104104
# Frontier FRAME
105105
pallet-base-fee = { workspace = true }
106-
pallet-dynamic-fee = { workspace = true }
107106
pallet-ethereum = { workspace = true }
108107
pallet-evm = { workspace = true }
109108
pallet-evm-chain-id = { workspace = true }
@@ -193,7 +192,6 @@ std = [
193192
"fp-self-contained/std",
194193
# Frontier FRAME
195194
"pallet-base-fee/std",
196-
"pallet-dynamic-fee/std",
197195
"pallet-ethereum/std",
198196
"pallet-evm/std",
199197
"pallet-evm-chain-id/std",
@@ -270,7 +268,6 @@ try-runtime = [
270268
# EVM + Frontier
271269
"fp-self-contained/try-runtime",
272270
"pallet-base-fee/try-runtime",
273-
"pallet-dynamic-fee/try-runtime",
274271
"pallet-ethereum/try-runtime",
275272
"pallet-evm/try-runtime",
276273
"pallet-evm-chain-id/try-runtime",

runtime/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,10 +1289,6 @@ parameter_types! {
12891289
pub BoundDivision: U256 = U256::from(1024);
12901290
}
12911291

1292-
impl pallet_dynamic_fee::Config for Runtime {
1293-
type MinGasPriceBoundDivisor = BoundDivision;
1294-
}
1295-
12961292
parameter_types! {
12971293
pub DefaultBaseFeePerGas: U256 = U256::from(20_000_000_000_u128);
12981294
pub DefaultElasticity: Permill = Permill::from_parts(125_000);
@@ -1427,7 +1423,7 @@ construct_runtime!(
14271423
Ethereum: pallet_ethereum = 21,
14281424
EVM: pallet_evm = 22,
14291425
EVMChainId: pallet_evm_chain_id = 23,
1430-
DynamicFee: pallet_dynamic_fee = 24,
1426+
// pallet_dynamic_fee was 24
14311427
BaseFee: pallet_base_fee = 25,
14321428

14331429
Drand: pallet_drand = 26,

0 commit comments

Comments
 (0)