mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
Companion for removal of execution strategies (#2836)
* Companion for removal of execution strategies https://github.com/paritytech/substrate/pull/14387 * Update Cargo.lock * Remove patches * Delete file again * update lockfile for {"polkadot", "substrate"} * Fix * FMT --------- Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+281
-269
File diff suppressed because it is too large
Load Diff
@@ -75,3 +75,4 @@ opt-level = 3
|
||||
inherits = "release"
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
|
||||
|
||||
@@ -178,12 +178,7 @@ where
|
||||
let inherent_res = self
|
||||
.client
|
||||
.runtime_api()
|
||||
.check_inherents_with_context(
|
||||
parent_hash,
|
||||
block_params.origin.into(),
|
||||
block,
|
||||
inherent_data,
|
||||
)
|
||||
.check_inherents(parent_hash, block, inherent_data)
|
||||
.map_err(|e| format!("Unable to check block inherents {:?}", e))?;
|
||||
|
||||
if !inherent_res.ok() {
|
||||
|
||||
@@ -72,11 +72,7 @@ impl RelayChainInterface for RelayChainInProcessInterface {
|
||||
para_id: ParaId,
|
||||
relay_parent: PHash,
|
||||
) -> RelayChainResult<Vec<InboundDownwardMessage>> {
|
||||
Ok(self.full_client.runtime_api().dmq_contents_with_context(
|
||||
relay_parent,
|
||||
sp_core::ExecutionContext::Importing,
|
||||
para_id,
|
||||
)?)
|
||||
Ok(self.full_client.runtime_api().dmq_contents(relay_parent, para_id)?)
|
||||
}
|
||||
|
||||
async fn retrieve_all_inbound_hrmp_channel_contents(
|
||||
@@ -84,11 +80,10 @@ impl RelayChainInterface for RelayChainInProcessInterface {
|
||||
para_id: ParaId,
|
||||
relay_parent: PHash,
|
||||
) -> RelayChainResult<BTreeMap<ParaId, Vec<InboundHrmpMessage>>> {
|
||||
Ok(self.full_client.runtime_api().inbound_hrmp_channels_contents_with_context(
|
||||
relay_parent,
|
||||
sp_core::ExecutionContext::Importing,
|
||||
para_id,
|
||||
)?)
|
||||
Ok(self
|
||||
.full_client
|
||||
.runtime_api()
|
||||
.inbound_hrmp_channels_contents(relay_parent, para_id)?)
|
||||
}
|
||||
|
||||
async fn header(&self, block_id: BlockId) -> RelayChainResult<Option<PHeader>> {
|
||||
@@ -342,8 +337,8 @@ mod tests {
|
||||
use polkadot_primitives::Block as PBlock;
|
||||
use polkadot_test_client::{
|
||||
construct_transfer_extrinsic, BlockBuilderExt, Client, ClientBlockImportExt,
|
||||
DefaultTestClientBuilderExt, ExecutionStrategy, InitPolkadotBlockBuilder,
|
||||
TestClientBuilder, TestClientBuilderExt,
|
||||
DefaultTestClientBuilderExt, InitPolkadotBlockBuilder, TestClientBuilder,
|
||||
TestClientBuilderExt,
|
||||
};
|
||||
use sp_consensus::{BlockOrigin, SyncOracle};
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
@@ -364,8 +359,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn build_client_backend_and_block() -> (Arc<Client>, PBlock, RelayChainInProcessInterface) {
|
||||
let builder =
|
||||
TestClientBuilder::new().set_execution_strategy(ExecutionStrategy::NativeWhenPossible);
|
||||
let builder = TestClientBuilder::new();
|
||||
let backend = builder.backend();
|
||||
let client = Arc::new(builder.build());
|
||||
|
||||
|
||||
@@ -56,10 +56,7 @@ fn call_validate_block(
|
||||
}
|
||||
|
||||
fn create_test_client() -> (Client, Header) {
|
||||
let client = TestClientBuilder::new()
|
||||
// NOTE: this allows easier debugging
|
||||
.set_execution_strategy(sc_client_api::ExecutionStrategy::NativeWhenPossible)
|
||||
.build();
|
||||
let client = TestClientBuilder::new().build();
|
||||
|
||||
let genesis_header = client
|
||||
.header(client.chain_info().genesis_hash)
|
||||
|
||||
@@ -15,6 +15,7 @@ log = "0.4.19"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
serde = { version = "1.0.168", features = ["derive"] }
|
||||
jsonrpsee = { version = "0.16.2", features = ["server"] }
|
||||
futures = "0.3.28"
|
||||
|
||||
# Local
|
||||
parachain-template-runtime = { path = "../runtime" }
|
||||
@@ -27,6 +28,7 @@ sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch
|
||||
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-offchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -21,6 +21,7 @@ use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
|
||||
// Substrate Imports
|
||||
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||
use sc_client_api::Backend;
|
||||
use sc_consensus::ImportQueue;
|
||||
use sc_executor::{
|
||||
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
|
||||
@@ -29,6 +30,7 @@ use sc_network::NetworkBlock;
|
||||
use sc_network_sync::SyncingService;
|
||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
|
||||
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
|
||||
use sp_keystore::KeystorePtr;
|
||||
use substrate_prometheus_endpoint::Registry;
|
||||
|
||||
@@ -194,11 +196,25 @@ async fn start_node_impl(
|
||||
.await?;
|
||||
|
||||
if parachain_config.offchain_worker.enabled {
|
||||
sc_service::build_offchain_workers(
|
||||
¶chain_config,
|
||||
task_manager.spawn_handle(),
|
||||
client.clone(),
|
||||
network.clone(),
|
||||
use futures::FutureExt;
|
||||
|
||||
task_manager.spawn_handle().spawn(
|
||||
"offchain-workers-runner",
|
||||
"offchain-work",
|
||||
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions {
|
||||
runtime_api_provider: client.clone(),
|
||||
keystore: Some(params.keystore_container.keystore()),
|
||||
offchain_db: backend.offchain_storage(),
|
||||
transaction_pool: Some(OffchainTransactionPoolFactory::new(
|
||||
transaction_pool.clone(),
|
||||
)),
|
||||
network_provider: network.clone(),
|
||||
is_validator: parachain_config.role.is_authority(),
|
||||
enable_http_requests: false,
|
||||
custom_extensions: move |_| vec![],
|
||||
})
|
||||
.run(client.clone(), task_manager.spawn_handle())
|
||||
.boxed(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,7 @@ fn benchmark_block_validation(c: &mut Criterion) {
|
||||
// Each account should only be included in one transfer.
|
||||
let (src_accounts, dst_accounts, account_ids) = utils::create_benchmark_accounts();
|
||||
|
||||
let mut test_client_builder = TestClientBuilder::with_default_backend()
|
||||
.set_execution_strategy(sc_client_api::ExecutionStrategy::AlwaysWasm);
|
||||
let mut test_client_builder = TestClientBuilder::with_default_backend();
|
||||
let genesis_init = test_client_builder.genesis_init_mut();
|
||||
*genesis_init = cumulus_test_client::GenesisParameters { endowed_accounts: account_ids };
|
||||
let client = test_client_builder.build_with_native_executor(None).0;
|
||||
|
||||
@@ -61,8 +61,7 @@ fn benchmark_block_validation(c: &mut Criterion) {
|
||||
let runtime = tokio::runtime::Runtime::new().expect("creating tokio runtime doesn't fail; qed");
|
||||
|
||||
let endowed_accounts = vec![AccountId::from(Alice.public())];
|
||||
let mut test_client_builder = TestClientBuilder::with_default_backend()
|
||||
.set_execution_strategy(sc_client_api::ExecutionStrategy::NativeElseWasm);
|
||||
let mut test_client_builder = TestClientBuilder::with_default_backend();
|
||||
let genesis_init = test_client_builder.genesis_init_mut();
|
||||
*genesis_init = cumulus_test_client::GenesisParameters { endowed_accounts };
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ use polkadot_node_subsystem::{errors::RecoveryError, messages::AvailabilityRecov
|
||||
use polkadot_overseer::Handle as OverseerHandle;
|
||||
use polkadot_primitives::{CollatorPair, Hash as PHash, PersistedValidationData};
|
||||
use polkadot_service::ProvideRuntimeApi;
|
||||
use sc_client_api::execution_extensions::ExecutionStrategies;
|
||||
use sc_consensus::ImportQueue;
|
||||
use sc_network::{
|
||||
config::{FullNetworkConfiguration, TransportConfig},
|
||||
@@ -758,13 +757,6 @@ pub fn node_config(
|
||||
wasm_method: WasmExecutionMethod::Compiled {
|
||||
instantiation_strategy: sc_executor_wasmtime::InstantiationStrategy::PoolingCopyOnWrite,
|
||||
},
|
||||
execution_strategies: ExecutionStrategies {
|
||||
syncing: sc_client_api::ExecutionStrategy::AlwaysWasm,
|
||||
importing: sc_client_api::ExecutionStrategy::AlwaysWasm,
|
||||
block_construction: sc_client_api::ExecutionStrategy::AlwaysWasm,
|
||||
offchain_worker: sc_client_api::ExecutionStrategy::AlwaysWasm,
|
||||
other: sc_client_api::ExecutionStrategy::AlwaysWasm,
|
||||
},
|
||||
rpc_addr: None,
|
||||
rpc_max_connections: Default::default(),
|
||||
rpc_cors: None,
|
||||
|
||||
Reference in New Issue
Block a user