Skip to content

Commit

Permalink
Merge pull request #238 from renlabs-dev/fix-inherent-data-provers
Browse files Browse the repository at this point in the history
fix: inherent-data-provers
  • Loading branch information
Supremesource authored Dec 15, 2024
2 parents 72929fe + c76410f commit 3c3ae1c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use sc_service::{
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
use sp_core::U256;
use sp_runtime::traits::Block as BlockT;
use std::{path::PathBuf, sync::Arc, time::Duration};

Expand Down Expand Up @@ -281,18 +280,22 @@ pub fn build_aura_grandpa_import_queue(
#[cfg(feature = "testnet")]
let target_gas_price = eth_config.target_gas_price;

#[cfg(not(feature = "testnet"))]
let target_gas_price = 0;

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))

#[cfg(feature = "testnet")]
{
let dynamic_fee = fp_dynamic_fee::InherentDataProvider(U256::from(target_gas_price));
Ok((slot, timestamp, dynamic_fee))
}

#[cfg(not(feature = "testnet"))]
Ok((slot, timestamp))
};

let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _>(
Expand Down

0 comments on commit 3c3ae1c

Please sign in to comment.