Improve overall performance (#6699)

* Improve overall performance

* Clean up code

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Remove needless ::

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Remove needless ::

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
pscott
2020-07-21 14:46:49 +02:00
committed by GitHub
parent ab82eb1c98
commit 046fda914a
73 changed files with 141 additions and 144 deletions
@@ -156,7 +156,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
// if the node isn't actively participating in consensus then it doesn't
// need a keystore, regardless of which protocol we use below.
let keystore = if role.is_authority() {
Some(keystore.clone() as sp_core::traits::BareCryptoStorePtr)
Some(keystore as sp_core::traits::BareCryptoStorePtr)
} else {
None
};
@@ -182,11 +182,11 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
let grandpa_config = sc_finality_grandpa::GrandpaParams {
config: grandpa_config,
link: grandpa_link,
network: network.clone(),
inherent_data_providers: inherent_data_providers.clone(),
network,
inherent_data_providers,
telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()),
voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
prometheus_registry: prometheus_registry.clone(),
prometheus_registry,
shared_voter_state: SharedVoterState::empty(),
};
@@ -200,7 +200,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
sc_finality_grandpa::setup_disabled_grandpa(
client,
&inherent_data_providers,
network.clone(),
network,
)?;
}
@@ -221,7 +221,7 @@ pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {
let pool_api = sc_transaction_pool::LightChainApi::new(
builder.client().clone(),
fetcher.clone(),
fetcher,
);
let pool = Arc::new(sc_transaction_pool::BasicPool::new_light(
builder.config().transaction_pool.clone(),
-1
View File
@@ -124,7 +124,6 @@ impl Clone for TempDatabase {
.map(|f_result|
f_result.expect("failed to read file in seed db")
.path()
.clone()
).collect();
fs_extra::copy_items(
&self_db_files,
+3 -3
View File
@@ -272,7 +272,7 @@ pub fn new_full_base(
// if the node isn't actively participating in consensus then it doesn't
// need a keystore, regardless of which protocol we use below.
let keystore = if role.is_authority() {
Some(keystore.clone() as BareCryptoStorePtr)
Some(keystore as BareCryptoStorePtr)
} else {
None
};
@@ -302,7 +302,7 @@ pub fn new_full_base(
inherent_data_providers: inherent_data_providers.clone(),
telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()),
voting_rule: grandpa::VotingRulesBuilder::default().build(),
prometheus_registry: prometheus_registry.clone(),
prometheus_registry,
shared_voter_state,
};
@@ -403,7 +403,7 @@ pub fn new_light_base(config: Configuration) -> Result<(
babe_block_import,
None,
Some(Box::new(finality_proof_import)),
client.clone(),
client,
select_chain,
inherent_data_providers.clone(),
spawn_task_handle,
-1
View File
@@ -118,7 +118,6 @@ impl Clone for BenchDb {
.map(|f_result|
f_result.expect("failed to read file in seed db")
.path()
.clone()
).collect();
fs_extra::copy_items(
&seed_db_files,
@@ -131,7 +131,7 @@ fn generate_chain_spec(
Default::default(),
);
chain_spec.as_json(false).map_err(|err| err.to_string())
chain_spec.as_json(false).map_err(|err| err)
}
fn generate_authority_keys_and_store(