Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
grandpa: prepend genesis hash to protocol name
Browse files Browse the repository at this point in the history
  • Loading branch information
acatangiu committed Dec 10, 2021
1 parent 5cd60d2 commit 9a3978a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
transaction_pool,
other: (block_import, grandpa_link, mut telemetry),
} = new_partial(&config)?;
// TODO: add genesis hash.
let chain_prefix = format!("/{}", config.protocol_id().as_ref());
let genesis_hash = client.block_hash(0).ok().flatten().unwrap_or_default();
let chain_prefix = format!("/{}/{}", config.protocol_id().as_ref(), genesis_hash);

if let Some(url) = &config.keystore_remote {
match remote_keystore(url) {
Expand Down
4 changes: 2 additions & 2 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ pub fn new_full_base(

let shared_voter_state = rpc_setup;
let auth_disc_publish_non_global_ips = config.network.allow_non_globals_in_dht;
// TODO: add genesis hash.
let chain_prefix = format!("/{}", config.protocol_id().as_ref());
let genesis_hash = client.block_hash(0).ok().flatten().unwrap_or_default();
let chain_prefix = format!("/{}/{}", config.protocol_id().as_ref(), genesis_hash);

config.network.extra_sets.push(grandpa::grandpa_peers_set_config(&chain_prefix));
let warp_sync = Arc::new(grandpa::warp_proof::NetworkProvider::new(
Expand Down

0 comments on commit 9a3978a

Please sign in to comment.