mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Bump Substrate (#986)
* Bump Substrate to commit `0495ead4` * Derive MaxEncodedLen for MillauHash * Add new config params to Balances pallet * Update Millau and Rialto service files * Add new Config items to mock runtime * Bump Substrate to `37bb3ae7` * Update Aura worker params
This commit is contained in:
committed by
Bastian Köcher
parent
37d067c0e0
commit
a6379d2968
@@ -39,8 +39,7 @@ use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
|
|||||||
use sc_telemetry::{Telemetry, TelemetryWorker};
|
use sc_telemetry::{Telemetry, TelemetryWorker};
|
||||||
use sp_consensus::SlotData;
|
use sp_consensus::SlotData;
|
||||||
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
||||||
use std::sync::Arc;
|
use std::{sync::Arc, time::Duration};
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
// Our native executor instance.
|
// Our native executor instance.
|
||||||
native_executor_instance!(
|
native_executor_instance!(
|
||||||
@@ -65,12 +64,7 @@ pub fn new_partial(
|
|||||||
sp_consensus::DefaultImportQueue<Block, FullClient>,
|
sp_consensus::DefaultImportQueue<Block, FullClient>,
|
||||||
sc_transaction_pool::FullPool<Block, FullClient>,
|
sc_transaction_pool::FullPool<Block, FullClient>,
|
||||||
(
|
(
|
||||||
sc_consensus_aura::AuraBlockImport<
|
sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
|
||||||
Block,
|
|
||||||
FullClient,
|
|
||||||
sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
|
|
||||||
AuraPair,
|
|
||||||
>,
|
|
||||||
sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
|
sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
|
||||||
Option<Telemetry>,
|
Option<Telemetry>,
|
||||||
),
|
),
|
||||||
@@ -80,6 +74,7 @@ pub fn new_partial(
|
|||||||
if config.keystore_remote.is_some() {
|
if config.keystore_remote.is_some() {
|
||||||
return Err(ServiceError::Other("Remote Keystores are not supported.".to_string()));
|
return Err(ServiceError::Other("Remote Keystores are not supported.".to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
let telemetry = config
|
let telemetry = config
|
||||||
.telemetry_endpoints
|
.telemetry_endpoints
|
||||||
.clone()
|
.clone()
|
||||||
@@ -119,14 +114,11 @@ pub fn new_partial(
|
|||||||
telemetry.as_ref().map(|x| x.handle()),
|
telemetry.as_ref().map(|x| x.handle()),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let aura_block_import =
|
|
||||||
sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(grandpa_block_import.clone(), client.clone());
|
|
||||||
|
|
||||||
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
|
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
|
||||||
|
|
||||||
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
|
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
|
||||||
block_import: aura_block_import.clone(),
|
block_import: grandpa_block_import.clone(),
|
||||||
justification_import: Some(Box::new(grandpa_block_import)),
|
justification_import: Some(Box::new(grandpa_block_import.clone())),
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
create_inherent_data_providers: move |_, ()| async move {
|
create_inherent_data_providers: move |_, ()| async move {
|
||||||
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
|
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
|
||||||
@@ -153,7 +145,7 @@ pub fn new_partial(
|
|||||||
keystore_container,
|
keystore_container,
|
||||||
select_chain,
|
select_chain,
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
other: (aura_block_import, grandpa_link, telemetry),
|
other: (grandpa_block_import, grandpa_link, telemetry),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,16 +186,15 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
.extra_sets
|
.extra_sets
|
||||||
.push(sc_finality_grandpa::grandpa_peers_set_config());
|
.push(sc_finality_grandpa::grandpa_peers_set_config());
|
||||||
|
|
||||||
let (network, network_status_sinks, system_rpc_tx, network_starter) =
|
let (network, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams {
|
||||||
sc_service::build_network(sc_service::BuildNetworkParams {
|
config: &config,
|
||||||
config: &config,
|
client: client.clone(),
|
||||||
client: client.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
spawn_handle: task_manager.spawn_handle(),
|
||||||
spawn_handle: task_manager.spawn_handle(),
|
import_queue,
|
||||||
import_queue,
|
on_demand: None,
|
||||||
on_demand: None,
|
block_announce_validator_builder: None,
|
||||||
block_announce_validator_builder: None,
|
})?;
|
||||||
})?;
|
|
||||||
|
|
||||||
if config.offchain_worker.enabled {
|
if config.offchain_worker.enabled {
|
||||||
sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone());
|
sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone());
|
||||||
@@ -266,7 +257,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
on_demand: None,
|
on_demand: None,
|
||||||
remote_blockchain: None,
|
remote_blockchain: None,
|
||||||
backend,
|
backend,
|
||||||
network_status_sinks,
|
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
config,
|
config,
|
||||||
telemetry: telemetry.as_mut(),
|
telemetry: telemetry.as_mut(),
|
||||||
@@ -286,7 +276,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
|
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
|
||||||
let raw_slot_duration = slot_duration.slot_duration();
|
let raw_slot_duration = slot_duration.slot_duration();
|
||||||
|
|
||||||
let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _>(StartAuraParams {
|
let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _, _>(StartAuraParams {
|
||||||
slot_duration,
|
slot_duration,
|
||||||
client,
|
client,
|
||||||
select_chain,
|
select_chain,
|
||||||
@@ -307,6 +297,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
keystore: keystore_container.sync_keystore(),
|
keystore: keystore_container.sync_keystore(),
|
||||||
can_author_with,
|
can_author_with,
|
||||||
sync_oracle: network.clone(),
|
sync_oracle: network.clone(),
|
||||||
|
justification_sync_link: network.clone(),
|
||||||
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
|
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
|
||||||
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
})?;
|
})?;
|
||||||
@@ -331,7 +322,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
name: Some(name),
|
name: Some(name),
|
||||||
observer_enabled: false,
|
observer_enabled: false,
|
||||||
keystore,
|
keystore,
|
||||||
is_authority: role.is_authority(),
|
local_role: role,
|
||||||
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -402,19 +393,17 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
on_demand.clone(),
|
on_demand.clone(),
|
||||||
));
|
));
|
||||||
|
|
||||||
let (grandpa_block_import, _) = sc_finality_grandpa::block_import(
|
let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
|
||||||
client.clone(),
|
client.clone(),
|
||||||
&(client.clone() as Arc<_>),
|
&(client.clone() as Arc<_>),
|
||||||
select_chain,
|
select_chain,
|
||||||
telemetry.as_ref().map(|x| x.handle()),
|
telemetry.as_ref().map(|x| x.handle()),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let aura_block_import =
|
|
||||||
sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(grandpa_block_import.clone(), client.clone());
|
|
||||||
|
|
||||||
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
|
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
|
||||||
|
|
||||||
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
|
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
|
||||||
block_import: aura_block_import,
|
block_import: grandpa_block_import.clone(),
|
||||||
justification_import: Some(Box::new(grandpa_block_import)),
|
justification_import: Some(Box::new(grandpa_block_import)),
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
create_inherent_data_providers: move |_, ()| async move {
|
create_inherent_data_providers: move |_, ()| async move {
|
||||||
@@ -434,21 +423,40 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let (network, network_status_sinks, system_rpc_tx, network_starter) =
|
let (network, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams {
|
||||||
sc_service::build_network(sc_service::BuildNetworkParams {
|
config: &config,
|
||||||
config: &config,
|
client: client.clone(),
|
||||||
client: client.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
spawn_handle: task_manager.spawn_handle(),
|
||||||
spawn_handle: task_manager.spawn_handle(),
|
import_queue,
|
||||||
import_queue,
|
on_demand: Some(on_demand.clone()),
|
||||||
on_demand: Some(on_demand.clone()),
|
block_announce_validator_builder: None,
|
||||||
block_announce_validator_builder: None,
|
})?;
|
||||||
})?;
|
|
||||||
|
|
||||||
if config.offchain_worker.enabled {
|
if config.offchain_worker.enabled {
|
||||||
sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone());
|
sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let enable_grandpa = !config.disable_grandpa;
|
||||||
|
if enable_grandpa {
|
||||||
|
let name = config.network.node_name.clone();
|
||||||
|
|
||||||
|
let config = sc_finality_grandpa::Config {
|
||||||
|
gossip_duration: std::time::Duration::from_millis(333),
|
||||||
|
justification_period: 512,
|
||||||
|
name: Some(name),
|
||||||
|
observer_enabled: false,
|
||||||
|
keystore: None,
|
||||||
|
local_role: config.role.clone(),
|
||||||
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
|
};
|
||||||
|
|
||||||
|
task_manager.spawn_handle().spawn_blocking(
|
||||||
|
"grandpa-observer",
|
||||||
|
sc_finality_grandpa::run_grandpa_observer(config, grandpa_link, network.clone())?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||||
remote_blockchain: Some(backend.remote_blockchain()),
|
remote_blockchain: Some(backend.remote_blockchain()),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
@@ -460,12 +468,10 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
keystore: keystore_container.sync_keystore(),
|
keystore: keystore_container.sync_keystore(),
|
||||||
backend,
|
backend,
|
||||||
network,
|
network,
|
||||||
network_status_sinks,
|
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
telemetry: telemetry.as_mut(),
|
telemetry: telemetry.as_mut(),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
network_starter.start_network();
|
network_starter.start_network();
|
||||||
|
|
||||||
Ok(task_manager)
|
Ok(task_manager)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,6 +250,7 @@ parameter_types! {
|
|||||||
// For weight estimation, we assume that the most locks on an individual account will be 50.
|
// For weight estimation, we assume that the most locks on an individual account will be 50.
|
||||||
// This number may need to be adjusted in the future if this assumption no longer holds true.
|
// This number may need to be adjusted in the future if this assumption no longer holds true.
|
||||||
pub const MaxLocks: u32 = 50;
|
pub const MaxLocks: u32 = 50;
|
||||||
|
pub const MaxReserves: u32 = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_balances::Config for Runtime {
|
impl pallet_balances::Config for Runtime {
|
||||||
@@ -263,6 +264,8 @@ impl pallet_balances::Config for Runtime {
|
|||||||
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
type MaxLocks = MaxLocks;
|
type MaxLocks = MaxLocks;
|
||||||
|
type MaxReserves = MaxReserves;
|
||||||
|
type ReserveIdentifier = [u8; 8];
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
// =====================================================================================
|
// =====================================================================================
|
||||||
// =====================================================================================
|
// =====================================================================================
|
||||||
|
|
||||||
|
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
|
||||||
|
|
||||||
use rialto_runtime::{self, opaque::Block, RuntimeApi};
|
use rialto_runtime::{self, opaque::Block, RuntimeApi};
|
||||||
use sc_client_api::{ExecutorProvider, RemoteBackend};
|
use sc_client_api::{ExecutorProvider, RemoteBackend};
|
||||||
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
|
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
|
||||||
@@ -39,8 +41,7 @@ use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
|
|||||||
use sc_telemetry::{Telemetry, TelemetryWorker};
|
use sc_telemetry::{Telemetry, TelemetryWorker};
|
||||||
use sp_consensus::SlotData;
|
use sp_consensus::SlotData;
|
||||||
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
||||||
use std::sync::Arc;
|
use std::{sync::Arc, time::Duration};
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
// Our native executor instance.
|
// Our native executor instance.
|
||||||
native_executor_instance!(
|
native_executor_instance!(
|
||||||
@@ -65,12 +66,7 @@ pub fn new_partial(
|
|||||||
sp_consensus::DefaultImportQueue<Block, FullClient>,
|
sp_consensus::DefaultImportQueue<Block, FullClient>,
|
||||||
sc_transaction_pool::FullPool<Block, FullClient>,
|
sc_transaction_pool::FullPool<Block, FullClient>,
|
||||||
(
|
(
|
||||||
sc_consensus_aura::AuraBlockImport<
|
sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
|
||||||
Block,
|
|
||||||
FullClient,
|
|
||||||
sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
|
|
||||||
AuraPair,
|
|
||||||
>,
|
|
||||||
sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
|
sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
|
||||||
Option<Telemetry>,
|
Option<Telemetry>,
|
||||||
),
|
),
|
||||||
@@ -120,14 +116,11 @@ pub fn new_partial(
|
|||||||
telemetry.as_ref().map(|x| x.handle()),
|
telemetry.as_ref().map(|x| x.handle()),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let aura_block_import =
|
|
||||||
sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(grandpa_block_import.clone(), client.clone());
|
|
||||||
|
|
||||||
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
|
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
|
||||||
|
|
||||||
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
|
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
|
||||||
block_import: aura_block_import.clone(),
|
block_import: grandpa_block_import.clone(),
|
||||||
justification_import: Some(Box::new(grandpa_block_import)),
|
justification_import: Some(Box::new(grandpa_block_import.clone())),
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
create_inherent_data_providers: move |_, ()| async move {
|
create_inherent_data_providers: move |_, ()| async move {
|
||||||
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
|
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
|
||||||
@@ -154,7 +147,7 @@ pub fn new_partial(
|
|||||||
keystore_container,
|
keystore_container,
|
||||||
select_chain,
|
select_chain,
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
other: (aura_block_import, grandpa_link, telemetry),
|
other: (grandpa_block_import, grandpa_link, telemetry),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,16 +188,15 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
.extra_sets
|
.extra_sets
|
||||||
.push(sc_finality_grandpa::grandpa_peers_set_config());
|
.push(sc_finality_grandpa::grandpa_peers_set_config());
|
||||||
|
|
||||||
let (network, network_status_sinks, system_rpc_tx, network_starter) =
|
let (network, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams {
|
||||||
sc_service::build_network(sc_service::BuildNetworkParams {
|
config: &config,
|
||||||
config: &config,
|
client: client.clone(),
|
||||||
client: client.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
spawn_handle: task_manager.spawn_handle(),
|
||||||
spawn_handle: task_manager.spawn_handle(),
|
import_queue,
|
||||||
import_queue,
|
on_demand: None,
|
||||||
on_demand: None,
|
block_announce_validator_builder: None,
|
||||||
block_announce_validator_builder: None,
|
})?;
|
||||||
})?;
|
|
||||||
|
|
||||||
if config.offchain_worker.enabled {
|
if config.offchain_worker.enabled {
|
||||||
sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone());
|
sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone());
|
||||||
@@ -268,7 +260,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
on_demand: None,
|
on_demand: None,
|
||||||
remote_blockchain: None,
|
remote_blockchain: None,
|
||||||
backend,
|
backend,
|
||||||
network_status_sinks,
|
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
config,
|
config,
|
||||||
telemetry: telemetry.as_mut(),
|
telemetry: telemetry.as_mut(),
|
||||||
@@ -287,7 +278,8 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
|
|
||||||
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
|
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
|
||||||
let raw_slot_duration = slot_duration.slot_duration();
|
let raw_slot_duration = slot_duration.slot_duration();
|
||||||
let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _>(StartAuraParams {
|
|
||||||
|
let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _, _>(StartAuraParams {
|
||||||
slot_duration,
|
slot_duration,
|
||||||
client,
|
client,
|
||||||
select_chain,
|
select_chain,
|
||||||
@@ -308,6 +300,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
keystore: keystore_container.sync_keystore(),
|
keystore: keystore_container.sync_keystore(),
|
||||||
can_author_with,
|
can_author_with,
|
||||||
sync_oracle: network.clone(),
|
sync_oracle: network.clone(),
|
||||||
|
justification_sync_link: network.clone(),
|
||||||
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
|
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
|
||||||
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
})?;
|
})?;
|
||||||
@@ -332,7 +325,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
name: Some(name),
|
name: Some(name),
|
||||||
observer_enabled: false,
|
observer_enabled: false,
|
||||||
keystore,
|
keystore,
|
||||||
is_authority: role.is_authority(),
|
local_role: role,
|
||||||
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -403,19 +396,17 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
on_demand.clone(),
|
on_demand.clone(),
|
||||||
));
|
));
|
||||||
|
|
||||||
let (grandpa_block_import, _) = sc_finality_grandpa::block_import(
|
let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
|
||||||
client.clone(),
|
client.clone(),
|
||||||
&(client.clone() as Arc<_>),
|
&(client.clone() as Arc<_>),
|
||||||
select_chain,
|
select_chain,
|
||||||
telemetry.as_ref().map(|x| x.handle()),
|
telemetry.as_ref().map(|x| x.handle()),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let aura_block_import =
|
|
||||||
sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(grandpa_block_import.clone(), client.clone());
|
|
||||||
|
|
||||||
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
|
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
|
||||||
|
|
||||||
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
|
let import_queue = sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
|
||||||
block_import: aura_block_import,
|
block_import: grandpa_block_import.clone(),
|
||||||
justification_import: Some(Box::new(grandpa_block_import)),
|
justification_import: Some(Box::new(grandpa_block_import)),
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
create_inherent_data_providers: move |_, ()| async move {
|
create_inherent_data_providers: move |_, ()| async move {
|
||||||
@@ -435,21 +426,40 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let (network, network_status_sinks, system_rpc_tx, network_starter) =
|
let (network, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams {
|
||||||
sc_service::build_network(sc_service::BuildNetworkParams {
|
config: &config,
|
||||||
config: &config,
|
client: client.clone(),
|
||||||
client: client.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
spawn_handle: task_manager.spawn_handle(),
|
||||||
spawn_handle: task_manager.spawn_handle(),
|
import_queue,
|
||||||
import_queue,
|
on_demand: Some(on_demand.clone()),
|
||||||
on_demand: Some(on_demand.clone()),
|
block_announce_validator_builder: None,
|
||||||
block_announce_validator_builder: None,
|
})?;
|
||||||
})?;
|
|
||||||
|
|
||||||
if config.offchain_worker.enabled {
|
if config.offchain_worker.enabled {
|
||||||
sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone());
|
sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let enable_grandpa = !config.disable_grandpa;
|
||||||
|
if enable_grandpa {
|
||||||
|
let name = config.network.node_name.clone();
|
||||||
|
|
||||||
|
let config = sc_finality_grandpa::Config {
|
||||||
|
gossip_duration: std::time::Duration::from_millis(333),
|
||||||
|
justification_period: 512,
|
||||||
|
name: Some(name),
|
||||||
|
observer_enabled: false,
|
||||||
|
keystore: None,
|
||||||
|
local_role: config.role.clone(),
|
||||||
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
|
};
|
||||||
|
|
||||||
|
task_manager.spawn_handle().spawn_blocking(
|
||||||
|
"grandpa-observer",
|
||||||
|
sc_finality_grandpa::run_grandpa_observer(config, grandpa_link, network.clone())?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||||
remote_blockchain: Some(backend.remote_blockchain()),
|
remote_blockchain: Some(backend.remote_blockchain()),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
@@ -461,12 +471,10 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
keystore: keystore_container.sync_keystore(),
|
keystore: keystore_container.sync_keystore(),
|
||||||
backend,
|
backend,
|
||||||
network,
|
network,
|
||||||
network_status_sinks,
|
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
telemetry: telemetry.as_mut(),
|
telemetry: telemetry.as_mut(),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
network_starter.start_network();
|
network_starter.start_network();
|
||||||
|
|
||||||
Ok(task_manager)
|
Ok(task_manager)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,6 +357,7 @@ parameter_types! {
|
|||||||
// For weight estimation, we assume that the most locks on an individual account will be 50.
|
// For weight estimation, we assume that the most locks on an individual account will be 50.
|
||||||
// This number may need to be adjusted in the future if this assumption no longer holds true.
|
// This number may need to be adjusted in the future if this assumption no longer holds true.
|
||||||
pub const MaxLocks: u32 = 50;
|
pub const MaxLocks: u32 = 50;
|
||||||
|
pub const MaxReserves: u32 = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_balances::Config for Runtime {
|
impl pallet_balances::Config for Runtime {
|
||||||
@@ -370,6 +371,8 @@ impl pallet_balances::Config for Runtime {
|
|||||||
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
type MaxLocks = MaxLocks;
|
type MaxLocks = MaxLocks;
|
||||||
|
type MaxReserves = MaxReserves;
|
||||||
|
type ReserveIdentifier = [u8; 8];
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ impl pallet_balances::Config for TestRuntime {
|
|||||||
type ExistentialDeposit = ExistentialDeposit;
|
type ExistentialDeposit = ExistentialDeposit;
|
||||||
type AccountStore = frame_system::Pallet<TestRuntime>;
|
type AccountStore = frame_system::Pallet<TestRuntime>;
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
|
type MaxReserves = ();
|
||||||
|
type ReserveIdentifier = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
|||||||
|
|
||||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
||||||
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
||||||
|
max-encoded-len = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false, features = ["derive"] }
|
||||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
||||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
||||||
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }
|
||||||
@@ -41,6 +42,7 @@ std = [
|
|||||||
"hash256-std-hasher/std",
|
"hash256-std-hasher/std",
|
||||||
"impl-codec/std",
|
"impl-codec/std",
|
||||||
"impl-serde",
|
"impl-serde",
|
||||||
|
"max-encoded-len/std",
|
||||||
"parity-util-mem/std",
|
"parity-util-mem/std",
|
||||||
"serde",
|
"serde",
|
||||||
"sp-api/std",
|
"sp-api/std",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
use frame_support::traits::MaxEncodedLen;
|
||||||
use parity_util_mem::MallocSizeOf;
|
use parity_util_mem::MallocSizeOf;
|
||||||
use sp_runtime::traits::CheckEqual;
|
use sp_runtime::traits::CheckEqual;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ use sp_runtime::traits::CheckEqual;
|
|||||||
|
|
||||||
fixed_hash::construct_fixed_hash! {
|
fixed_hash::construct_fixed_hash! {
|
||||||
/// Hash type used in Millau chain.
|
/// Hash type used in Millau chain.
|
||||||
#[derive(MallocSizeOf)]
|
#[derive(MallocSizeOf, MaxEncodedLen)]
|
||||||
pub struct MillauHash(64);
|
pub struct MillauHash(64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user