mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
Change on-the-wire protocol names to include genesis hash & fork id (#11938)
* Rename transactions protocol to include genesis hash
* Add protocol name generation to sc_network::utils
* Use utils functions for transactions protocol name generation
* Extract protocol name generation into public module
* Use sc_network::protocol_name::standard_protocol_name() for BEEFY and GRANDPA
* minor: add missing newline at EOF
* Change block-announces protocol name to include genesis_hash & fork_id
* Change protocol names to include genesis hash and fork id
Protocols changed:
- sync
- state
- light
- sync/warp
* Revert "Use sc_network::protocol_name::standard_protocol_name() for BEEFY and GRANDPA"
This reverts commit cd60a95a3face397e1b67f4bc95dd0f2b581bfae.
* Get rid of `protocol_name` module
This commit is contained in:
@@ -741,6 +741,7 @@ where
|
||||
// Allow both outgoing and incoming requests.
|
||||
let (handler, protocol_config) = BlockRequestHandler::new(
|
||||
&protocol_id,
|
||||
config.chain_spec.fork_id(),
|
||||
client.clone(),
|
||||
config.network.default_peers_set.in_peers as usize +
|
||||
config.network.default_peers_set.out_peers as usize,
|
||||
@@ -753,6 +754,7 @@ where
|
||||
// Allow both outgoing and incoming requests.
|
||||
let (handler, protocol_config) = StateRequestHandler::new(
|
||||
&protocol_id,
|
||||
config.chain_spec.fork_id(),
|
||||
client.clone(),
|
||||
config.network.default_peers_set_num_full as usize,
|
||||
);
|
||||
@@ -763,8 +765,16 @@ where
|
||||
let (warp_sync_provider, warp_sync_protocol_config) = warp_sync
|
||||
.map(|provider| {
|
||||
// Allow both outgoing and incoming requests.
|
||||
let (handler, protocol_config) =
|
||||
WarpSyncRequestHandler::new(protocol_id.clone(), provider.clone());
|
||||
let (handler, protocol_config) = WarpSyncRequestHandler::new(
|
||||
protocol_id.clone(),
|
||||
client
|
||||
.block_hash(0u32.into())
|
||||
.ok()
|
||||
.flatten()
|
||||
.expect("Genesis block exists; qed"),
|
||||
config.chain_spec.fork_id(),
|
||||
provider.clone(),
|
||||
);
|
||||
spawn_handle.spawn("warp-sync-request-handler", Some("networking"), handler.run());
|
||||
(Some(provider), Some(protocol_config))
|
||||
})
|
||||
@@ -772,8 +782,11 @@ where
|
||||
|
||||
let light_client_request_protocol_config = {
|
||||
// Allow both outgoing and incoming requests.
|
||||
let (handler, protocol_config) =
|
||||
LightClientRequestHandler::new(&protocol_id, client.clone());
|
||||
let (handler, protocol_config) = LightClientRequestHandler::new(
|
||||
&protocol_id,
|
||||
config.chain_spec.fork_id(),
|
||||
client.clone(),
|
||||
);
|
||||
spawn_handle.spawn("light-client-request-handler", Some("networking"), handler.run());
|
||||
protocol_config
|
||||
};
|
||||
@@ -808,6 +821,7 @@ where
|
||||
chain: client.clone(),
|
||||
transaction_pool: transaction_pool_adapter as _,
|
||||
protocol_id,
|
||||
fork_id: config.chain_spec.fork_id().map(ToOwned::to_owned),
|
||||
import_queue: Box::new(import_queue),
|
||||
chain_sync: Box::new(chain_sync),
|
||||
metrics_registry: config.prometheus_config.as_ref().map(|config| config.registry.clone()),
|
||||
|
||||
Reference in New Issue
Block a user