mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 06:21:02 +00:00
do not start spec_version guard when version mode is set to auto (#1278)
This commit is contained in:
committed by
Bastian Köcher
parent
a7fa7a491f
commit
c4837d2368
@@ -528,6 +528,16 @@ macro_rules! declare_chain_options {
|
||||
}
|
||||
|
||||
impl [<$chain ConnectionParams>] {
|
||||
/// Returns `true` if version guard can be started.
|
||||
///
|
||||
/// There's no reason to run version guard when version mode is set to `Auto`. It can
|
||||
/// lead to relay shutdown when chain is upgraded, even though we have explicitly
|
||||
/// said that we don't want to shutdown.
|
||||
#[allow(dead_code)]
|
||||
pub fn can_start_version_guard(&self) -> bool {
|
||||
self.[<$chain_prefix _runtime_version>].[<$chain_prefix _version_mode>] != RuntimeVersionType::Auto
|
||||
}
|
||||
|
||||
/// Convert connection params into Substrate client.
|
||||
pub async fn to_client<Chain: CliChain>(
|
||||
&self,
|
||||
|
||||
@@ -157,7 +157,12 @@ impl RelayHeaders {
|
||||
signer: target_sign,
|
||||
mortality: target_transactions_mortality,
|
||||
};
|
||||
Finality::start_relay_guards(&target_client, &target_transactions_params);
|
||||
Finality::start_relay_guards(
|
||||
&target_client,
|
||||
&target_transactions_params,
|
||||
self.target.can_start_version_guard(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
substrate_relay_helper::finality_pipeline::run::<Finality>(
|
||||
source_client,
|
||||
|
||||
@@ -512,11 +512,15 @@ impl RelayHeadersAndMessages {
|
||||
LeftToRightFinality::start_relay_guards(
|
||||
&right_client,
|
||||
&left_to_right_transaction_params,
|
||||
);
|
||||
params.right.can_start_version_guard(),
|
||||
)
|
||||
.await?;
|
||||
RightToLeftFinality::start_relay_guards(
|
||||
&left_client,
|
||||
&right_to_left_transaction_params,
|
||||
);
|
||||
params.left.can_start_version_guard(),
|
||||
)
|
||||
.await?;
|
||||
let left_to_right_on_demand_headers = OnDemandHeadersRelay::new::<LeftToRightFinality>(
|
||||
left_client.clone(),
|
||||
right_client.clone(),
|
||||
|
||||
Reference in New Issue
Block a user