mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
Companion for paritytech/polkadot#6744: Retire OldV1SessionInfo (#2213)
* Adjust commands
* Use `NetworkWorker::next_action()` instead of `poll()`
* rustfmt
* minor: fix mutability
* Move imports
* Replace `NetworkWorker::next_action()` with `run()`
* Import fix
* Make `NetworkWorker::run` consume self
* Retire `OldV1SessionInfo`
* update lockfile for {"polkadot", "substrate"}
* update lockfile for {"substrate", "polkadot"}
* update lockfile for {"substrate", "polkadot"}
* Make stuff compile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Piotr Mikołajczyk <piomiko41@gmail.com>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: parity-processbot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Generated
+263
-254
File diff suppressed because it is too large
Load Diff
@@ -253,14 +253,6 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient {
|
|||||||
Ok(self.rpc_client.parachain_host_session_info(at, index).await?)
|
Ok(self.rpc_client.parachain_host_session_info(at, index).await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn session_info_before_version_2(
|
|
||||||
&self,
|
|
||||||
at: Hash,
|
|
||||||
index: polkadot_primitives::SessionIndex,
|
|
||||||
) -> Result<Option<polkadot_primitives::OldV1SessionInfo>, sp_api::ApiError> {
|
|
||||||
Ok(self.rpc_client.parachain_host_session_info_before_version_2(at, index).await?)
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn session_executor_params(
|
async fn session_executor_params(
|
||||||
&self,
|
&self,
|
||||||
at: Hash,
|
at: Hash,
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ pub(crate) fn build_collator_network(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
network_worker.await
|
network_worker.run().await;
|
||||||
});
|
});
|
||||||
|
|
||||||
let network_starter = NetworkStarter::new(network_start_tx);
|
let network_starter = NetworkStarter::new(network_start_tx);
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ use cumulus_primitives_core::{
|
|||||||
relay_chain::{
|
relay_chain::{
|
||||||
vstaging::ExecutorParams, CandidateCommitments, CandidateEvent, CandidateHash,
|
vstaging::ExecutorParams, CandidateCommitments, CandidateEvent, CandidateHash,
|
||||||
CommittedCandidateReceipt, CoreState, DisputeState, GroupRotationInfo, Hash as RelayHash,
|
CommittedCandidateReceipt, CoreState, DisputeState, GroupRotationInfo, Hash as RelayHash,
|
||||||
Header as RelayHeader, InboundHrmpMessage, OccupiedCoreAssumption, OldV1SessionInfo,
|
Header as RelayHeader, InboundHrmpMessage, OccupiedCoreAssumption, PvfCheckStatement,
|
||||||
PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode,
|
ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode, ValidationCodeHash,
|
||||||
ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
|
ValidatorId, ValidatorIndex, ValidatorSignature,
|
||||||
},
|
},
|
||||||
InboundDownwardMessage, ParaId, PersistedValidationData,
|
InboundDownwardMessage, ParaId, PersistedValidationData,
|
||||||
};
|
};
|
||||||
@@ -135,17 +135,6 @@ impl RelayChainRpcClient {
|
|||||||
self.call_remote_runtime_function("BabeApi_current_epoch", at, None::<()>).await
|
self.call_remote_runtime_function("BabeApi_current_epoch", at, None::<()>).await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Old method to fetch v1 session info.
|
|
||||||
pub async fn parachain_host_session_info_before_version_2(
|
|
||||||
&self,
|
|
||||||
at: RelayHash,
|
|
||||||
index: SessionIndex,
|
|
||||||
) -> Result<Option<OldV1SessionInfo>, RelayChainError> {
|
|
||||||
// The function in wasm never changes/gets augmented with a version
|
|
||||||
self.call_remote_runtime_function("ParachainHost_session_info", at, Some(index))
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Scrape dispute relevant from on-chain, backing votes and resolved disputes.
|
/// Scrape dispute relevant from on-chain, backing votes and resolved disputes.
|
||||||
pub async fn parachain_host_on_chain_votes(
|
pub async fn parachain_host_on_chain_votes(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
@@ -229,9 +229,12 @@ pub fn run() -> Result<()> {
|
|||||||
},
|
},
|
||||||
#[cfg(feature = "try-runtime")]
|
#[cfg(feature = "try-runtime")]
|
||||||
Some(Subcommand::TryRuntime(cmd)) => {
|
Some(Subcommand::TryRuntime(cmd)) => {
|
||||||
|
use parachain_template_runtime::MILLISECS_PER_BLOCK;
|
||||||
|
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
|
||||||
|
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
|
||||||
|
|
||||||
let runner = cli.create_runner(cmd)?;
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
|
||||||
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
|
|
||||||
type HostFunctionsOf<E> = ExtendedHostFunctions<
|
type HostFunctionsOf<E> = ExtendedHostFunctions<
|
||||||
sp_io::SubstrateHostFunctions,
|
sp_io::SubstrateHostFunctions,
|
||||||
<E as NativeExecutionDispatch>::ExtendHostFunctions,
|
<E as NativeExecutionDispatch>::ExtendHostFunctions,
|
||||||
@@ -243,8 +246,15 @@ pub fn run() -> Result<()> {
|
|||||||
sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
|
sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
|
||||||
.map_err(|e| format!("Error: {:?}", e))?;
|
.map_err(|e| format!("Error: {:?}", e))?;
|
||||||
|
|
||||||
|
let info_provider = timestamp_with_aura_info(MILLISECS_PER_BLOCK);
|
||||||
|
|
||||||
runner.async_run(|_| {
|
runner.async_run(|_| {
|
||||||
Ok((cmd.run::<Block, HostFunctionsOf<ParachainNativeExecutor>>(), task_manager))
|
Ok((
|
||||||
|
cmd.run::<Block, HostFunctionsOf<ParachainNativeExecutor>, _>(Some(
|
||||||
|
info_provider,
|
||||||
|
)),
|
||||||
|
task_manager,
|
||||||
|
))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
#[cfg(not(feature = "try-runtime"))]
|
#[cfg(not(feature = "try-runtime"))]
|
||||||
|
|||||||
@@ -704,82 +704,97 @@ pub fn run() -> Result<()> {
|
|||||||
},
|
},
|
||||||
#[cfg(feature = "try-runtime")]
|
#[cfg(feature = "try-runtime")]
|
||||||
Some(Subcommand::TryRuntime(cmd)) => {
|
Some(Subcommand::TryRuntime(cmd)) => {
|
||||||
|
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
|
||||||
|
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
|
||||||
|
|
||||||
// grab the task manager.
|
// grab the task manager.
|
||||||
let runner = cli.create_runner(cmd)?;
|
let runner = cli.create_runner(cmd)?;
|
||||||
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
|
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
|
||||||
let task_manager =
|
let task_manager =
|
||||||
sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
|
sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
|
||||||
.map_err(|e| format!("Error: {:?}", e))?;
|
.map_err(|e| format!("Error: {:?}", e))?;
|
||||||
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
|
|
||||||
type HostFunctionsOf<E> = ExtendedHostFunctions<
|
type HostFunctionsOf<E> = ExtendedHostFunctions<
|
||||||
sp_io::SubstrateHostFunctions,
|
sp_io::SubstrateHostFunctions,
|
||||||
<E as NativeExecutionDispatch>::ExtendHostFunctions,
|
<E as NativeExecutionDispatch>::ExtendHostFunctions,
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
let info_provider = timestamp_with_aura_info(6000);
|
||||||
|
|
||||||
match runner.config().chain_spec.runtime() {
|
match runner.config().chain_spec.runtime() {
|
||||||
Runtime::Statemine => runner.async_run(|_| {
|
Runtime::Statemine => runner.async_run(|_| {
|
||||||
Ok((
|
Ok((
|
||||||
cmd.run::<Block, HostFunctionsOf<StatemineRuntimeExecutor>>(),
|
cmd.run::<Block, HostFunctionsOf<StatemineRuntimeExecutor>, _>(Some(
|
||||||
|
info_provider,
|
||||||
|
)),
|
||||||
task_manager,
|
task_manager,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
Runtime::Westmint => runner.async_run(|_| {
|
Runtime::Westmint => runner.async_run(|_| {
|
||||||
Ok((cmd.run::<Block, HostFunctionsOf<WestmintRuntimeExecutor>>(), task_manager))
|
Ok((
|
||||||
|
cmd.run::<Block, HostFunctionsOf<WestmintRuntimeExecutor>, _>(Some(
|
||||||
|
info_provider,
|
||||||
|
)),
|
||||||
|
task_manager,
|
||||||
|
))
|
||||||
}),
|
}),
|
||||||
Runtime::Statemint => runner.async_run(|_| {
|
Runtime::Statemint => runner.async_run(|_| {
|
||||||
Ok((
|
Ok((
|
||||||
cmd.run::<Block, HostFunctionsOf<StatemintRuntimeExecutor>>(),
|
cmd.run::<Block, HostFunctionsOf<StatemintRuntimeExecutor>, _>(Some(
|
||||||
|
info_provider,
|
||||||
|
)),
|
||||||
task_manager,
|
task_manager,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
Runtime::CollectivesPolkadot | Runtime::CollectivesWestend =>
|
Runtime::CollectivesPolkadot | Runtime::CollectivesWestend =>
|
||||||
runner.async_run(|_| {
|
runner.async_run(|_| {
|
||||||
Ok((
|
Ok((
|
||||||
cmd.run::<Block, HostFunctionsOf<CollectivesPolkadotRuntimeExecutor>>(),
|
cmd.run::<Block, HostFunctionsOf<CollectivesPolkadotRuntimeExecutor>, _>(Some(info_provider)),
|
||||||
task_manager,
|
task_manager,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type {
|
Runtime::BridgeHub(bridge_hub_runtime_type) =>
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot |
|
match bridge_hub_runtime_type {
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotLocal |
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot |
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotDevelopment => runner.async_run(|_| {
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotLocal |
|
||||||
Ok((
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotDevelopment =>
|
||||||
cmd.run::<Block, HostFunctionsOf<BridgeHubPolkadotRuntimeExecutor>>(),
|
runner.async_run(|_| {
|
||||||
|
Ok((
|
||||||
|
cmd.run::<Block, HostFunctionsOf<BridgeHubPolkadotRuntimeExecutor>, _>(Some(info_provider)),
|
||||||
task_manager,
|
task_manager,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama |
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama |
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal |
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal |
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaDevelopment => runner.async_run(|_| {
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaDevelopment => runner.async_run(|_| {
|
||||||
Ok((
|
Ok((
|
||||||
cmd.run::<Block, HostFunctionsOf<BridgeHubKusamaRuntimeExecutor>>(),
|
cmd.run::<Block, HostFunctionsOf<BridgeHubKusamaRuntimeExecutor>, _>(Some(info_provider)),
|
||||||
task_manager,
|
task_manager,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo |
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo |
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal |
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal |
|
||||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoDevelopment => runner.async_run(|_| {
|
chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoDevelopment => runner.async_run(|_| {
|
||||||
Ok((
|
Ok((
|
||||||
cmd.run::<Block, HostFunctionsOf<BridgeHubRococoRuntimeExecutor>>(),
|
cmd.run::<Block, HostFunctionsOf<BridgeHubRococoRuntimeExecutor>, _>(Some(info_provider)),
|
||||||
task_manager,
|
task_manager,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
_ => Err(format!(
|
_ => Err(format!(
|
||||||
"Chain '{:?}' doesn't support try-runtime for bridge_hub_runtime_type: {:?}",
|
"Chain '{:?}' doesn't support try-runtime for bridge_hub_runtime_type: {:?}",
|
||||||
runner.config().chain_spec.runtime(),
|
runner.config().chain_spec.runtime(),
|
||||||
bridge_hub_runtime_type
|
bridge_hub_runtime_type
|
||||||
)
|
)
|
||||||
.into()),
|
.into()),
|
||||||
},
|
},
|
||||||
Runtime::Shell => runner.async_run(|_| {
|
Runtime::Shell => runner.async_run(|_| {
|
||||||
Ok((
|
Ok((
|
||||||
cmd.run::<Block, HostFunctionsOf<crate::service::ShellRuntimeExecutor>>(),
|
cmd.run::<Block, HostFunctionsOf<crate::service::ShellRuntimeExecutor>, _>(Some(info_provider)),
|
||||||
task_manager,
|
task_manager,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
Runtime::ContractsRococo => runner.async_run(|_| {
|
Runtime::ContractsRococo => runner.async_run(|_| {
|
||||||
Ok((
|
Ok((
|
||||||
cmd.run::<Block, HostFunctionsOf<crate::service::ContractsRococoRuntimeExecutor>>(),
|
cmd.run::<Block, HostFunctionsOf<crate::service::ContractsRococoRuntimeExecutor>, _>(Some(info_provider)),
|
||||||
task_manager,
|
task_manager,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user