Skip to content

Commit

Permalink
fix: apply name changes for GrandPa
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Feb 1, 2022
1 parent bae5e94 commit 4130db3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nodes/standalone/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! substrate service.

use mashnet_node_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::ExecutorProvider;
use sc_client_api::{BlockBackend, ExecutorProvider};
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
pub use sc_executor::NativeElseWasmExecutor;
use sc_finality_grandpa::SharedVoterState;
Expand Down Expand Up @@ -83,6 +83,7 @@ pub fn new_partial(config: &Configuration) -> Result<PartialComponents, ServiceE
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
config.runtime_cache_size,
);

let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::<Block, RuntimeApi, _>(
Expand Down Expand Up @@ -180,11 +181,17 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
}
};
}
let grandpa_protocol_name = sc_finality_grandpa::protocol_standard_name(
&client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"),
&config.chain_spec,
);

config
.network
.extra_sets
.push(sc_finality_grandpa::grandpa_peers_set_config());
.push(sc_finality_grandpa::grandpa_peers_set_config(
grandpa_protocol_name.clone(),
));
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
Expand Down Expand Up @@ -305,6 +312,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
keystore,
local_role: role,
telemetry: telemetry.as_ref().map(|x| x.handle()),
protocol_name: grandpa_protocol_name,
};

if enable_grandpa {
Expand Down

0 comments on commit 4130db3

Please sign in to comment.