Skip to content

Commit

Permalink
chore: remove dynamic fee (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielMartinezRodriguez authored Oct 5, 2023
1 parent a65d9f3 commit 5525b5f
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 59 deletions.
29 changes: 0 additions & 29 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,13 @@ fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier"
fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36" }
# Frontier Primitive
fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
fp-dynamic-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
# Frontier FRAME
pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
pallet-dynamic-fee = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false }
pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", 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 @@ -71,7 +71,6 @@ fc-db = { workspace = true }
fc-mapping-sync = { workspace = true }
fc-rpc = { workspace = true }
fc-rpc-core = { workspace = true }
fp-dynamic-fee = { workspace = true, features = ["std"] }
fp-evm = { workspace = true, features = ["std"] }
fp-rpc = { workspace = true, features = ["std"] }
fp-storage = { workspace = true, features = ["std"] }
Expand Down
1 change: 0 additions & 1 deletion node/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ pub fn base_genesis(
},
},
ethereum: Default::default(),
dynamic_fee: Default::default(),
base_fee: Default::default(),
supported_tokens_manager: SupportedTokensManagerConfig {
initial_default_token,
Expand Down
3 changes: 0 additions & 3 deletions node/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,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.
Expand Down
17 changes: 4 additions & 13 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch};
use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker};
use sp_api::{ConstructRuntimeApi, TransactionFor};
use sp_core::U256;
use sp_runtime::traits::BlakeTwo256;
use sp_trie::PrefixedMemoryDB;
use stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi;
Expand Down Expand Up @@ -165,7 +164,7 @@ where
pub fn build_aura_grandpa_import_queue<RuntimeApi, Executor>(
client: Arc<FullClient<RuntimeApi, Executor>>,
config: &Configuration,
eth_config: &EthConfiguration,
_eth_config: &EthConfiguration,
task_manager: &TaskManager,
telemetry: Option<TelemetryHandle>,
grandpa_block_import: GrandpaBlockImport<FullClient<RuntimeApi, Executor>>,
Expand All @@ -191,16 +190,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 =
Expand Down Expand Up @@ -425,7 +422,6 @@ where
// manual-seal authorship
if let Some(sealing) = sealing {
run_manual_seal_authorship(
&eth_config,
sealing,
client,
transaction_pool,
Expand Down Expand Up @@ -455,15 +451,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::<
Expand Down Expand Up @@ -552,7 +546,6 @@ where
}

fn run_manual_seal_authorship<RuntimeApi, Executor>(
eth_config: &EthConfiguration,
sealing: Sealing,
client: Arc<FullClient<RuntimeApi, Executor>>,
transaction_pool: Arc<FullPool<FullClient<RuntimeApi, Executor>>>,
Expand Down Expand Up @@ -612,11 +605,9 @@ where
}
}

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))
Ok(timestamp)
};

let manual_seal = match sealing {
Expand Down
2 changes: 0 additions & 2 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ std = [
'fp-rpc/std',
'fp-self-contained/std',
'pallet-base-fee/std',
'pallet-dynamic-fee/std',
'pallet-ethereum/std',
'pallet-evm/std',
'pallet-evm-chain-id/std',
Expand Down Expand Up @@ -128,7 +127,6 @@ fp-rpc = { workspace = true }
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
8 changes: 0 additions & 8 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,6 @@ impl pallet_validator_fee_selector::Config for Runtime {

impl pallet_supported_tokens_manager::Config for Runtime {}

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(GAS_BASE_FEE);
Expand Down Expand Up @@ -779,7 +772,6 @@ construct_runtime!(
Ethereum: pallet_ethereum,
EVM: pallet_evm,
EVMChainId: pallet_evm_chain_id,
DynamicFee: pallet_dynamic_fee,
BaseFee: pallet_base_fee,
HotfixSufficients: pallet_hotfix_sufficients,
UserFeeSelector: pallet_user_fee_selector,
Expand Down

0 comments on commit 5525b5f

Please sign in to comment.