Skip to content

Commit

Permalink
Remove pallet-dynamic-fee
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-otf committed Jan 31, 2025
1 parent 97be330 commit f182532
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 59 deletions.
27 changes: 0 additions & 27 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 node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ substrate-prometheus-endpoint = { workspace = true }
fc-storage = { workspace = true }
fc-db = { workspace = true }
fc-consensus = { workspace = true }
fp-dynamic-fee = { workspace = true }
fc-api = { workspace = true }
fc-rpc = { workspace = true }
fc-rpc-core = { workspace = true }
Expand Down
4 changes: 0 additions & 4 deletions node/src/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ pub struct EthConfiguration {
#[arg(long)]
pub enable_dev_signer: bool,

/// The dynamic-fee pallet target gas price set by block author
#[arg(long, default_value = "1")]
pub target_gas_price: u64,

/// Maximum allowed gas limit will be `block.gas_limit * execute_gas_limit_multiplier`
/// when using eth_call/eth_estimateGas.
#[arg(long, default_value = "10")]
Expand Down
25 changes: 6 additions & 19 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder as BlockBuilderApi;
use sp_consensus::Error as ConsensusError;
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
use sp_core::U256;
use sp_runtime::traits::{Block as BlockT, Header, NumberFor};
use std::{cell::RefCell, path::Path};
use std::{marker::PhantomData, sync::Arc, time::Duration};
Expand Down Expand Up @@ -279,7 +278,7 @@ where
pub fn build_aura_grandpa_import_queue(
client: Arc<FullClient>,
config: &Configuration,
eth_config: &EthConfiguration,
_eth_config: &EthConfiguration,
task_manager: &TaskManager,
telemetry: Option<TelemetryHandle>,
grandpa_block_import: GrandpaBlockImport,
Expand All @@ -294,16 +293,14 @@ where
);

let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
let target_gas_price = eth_config.target_gas_price;
let create_inherent_data_providers = move |_, ()| async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot =
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
slot_duration,
);
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
Ok((slot, timestamp, dynamic_fee))
Ok((slot, timestamp))
};

let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _>(
Expand Down Expand Up @@ -521,7 +518,6 @@ where
));

let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
let target_gas_price = eth_config.target_gas_price;
let pending_create_inherent_data_providers = move |_, ()| async move {
let current = sp_timestamp::InherentDataProvider::from_system_time();
let next_slot = current
Expand All @@ -533,8 +529,7 @@ where
*timestamp,
slot_duration,
);
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
Ok((slot, timestamp, dynamic_fee))
Ok((slot, timestamp))
};

Box::new(move |subscription_task_executor| {
Expand Down Expand Up @@ -613,7 +608,6 @@ where
// manual-seal authorship
if let Some(sealing) = sealing {
run_manual_seal_authorship(
&eth_config,
sealing,
client,
transaction_pool,
Expand All @@ -639,15 +633,13 @@ where
);

let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
let target_gas_price = eth_config.target_gas_price;
let create_inherent_data_providers = move |_, ()| async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
slot_duration,
);
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
Ok((slot, timestamp, dynamic_fee))
Ok((slot, timestamp))
};

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

#[allow(clippy::too_many_arguments)]
fn run_manual_seal_authorship(
eth_config: &EthConfiguration,
sealing: Sealing,
client: Arc<FullClient>,
transaction_pool: Arc<FullPool<Block, FullClient>>,
Expand Down Expand Up @@ -820,12 +811,8 @@ fn run_manual_seal_authorship(
}
}

let target_gas_price = eth_config.target_gas_price;
let create_inherent_data_providers = move |_, ()| async move {
let timestamp = MockTimestampInherentDataProvider;
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
Ok((timestamp, dynamic_fee))
};
let create_inherent_data_providers =
move |_, ()| async move { Ok(MockTimestampInherentDataProvider) };

let manual_seal = match sealing {
Sealing::Manual => future::Either::Left(sc_consensus_manual_seal::run_manual_seal(
Expand Down
3 changes: 0 additions & 3 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ fp-self-contained = { workspace = true }

# Frontier FRAME
pallet-base-fee = { workspace = true }
pallet-dynamic-fee = { workspace = true }
pallet-ethereum = { workspace = true }
pallet-evm = { workspace = true }
pallet-evm-chain-id = { workspace = true }
Expand Down Expand Up @@ -193,7 +192,6 @@ std = [
"fp-self-contained/std",
# Frontier FRAME
"pallet-base-fee/std",
"pallet-dynamic-fee/std",
"pallet-ethereum/std",
"pallet-evm/std",
"pallet-evm-chain-id/std",
Expand Down Expand Up @@ -270,7 +268,6 @@ try-runtime = [
# EVM + Frontier
"fp-self-contained/try-runtime",
"pallet-base-fee/try-runtime",
"pallet-dynamic-fee/try-runtime",
"pallet-ethereum/try-runtime",
"pallet-evm/try-runtime",
"pallet-evm-chain-id/try-runtime",
Expand Down
6 changes: 1 addition & 5 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1289,10 +1289,6 @@ parameter_types! {
pub BoundDivision: U256 = U256::from(1024);
}

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

parameter_types! {
pub DefaultBaseFeePerGas: U256 = U256::from(20_000_000_000_u128);
pub DefaultElasticity: Permill = Permill::from_parts(125_000);
Expand Down Expand Up @@ -1427,7 +1423,7 @@ construct_runtime!(
Ethereum: pallet_ethereum = 21,
EVM: pallet_evm = 22,
EVMChainId: pallet_evm_chain_id = 23,
DynamicFee: pallet_dynamic_fee = 24,
// pallet_dynamic_fee was 24
BaseFee: pallet_base_fee = 25,

Drand: pallet_drand = 26,
Expand Down

0 comments on commit f182532

Please sign in to comment.