Skip to content

Commit c70450b

Browse files
committed
Merge remote-tracking branch 'origin/master' into girazoki-new-tests
2 parents 4df89ba + b866a6e commit c70450b

File tree

89 files changed

+6179
-3014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+6179
-3014
lines changed

Cargo.lock

Lines changed: 953 additions & 819 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 300 additions & 297 deletions
Large diffs are not rendered by default.

client/node-common/src/service.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ use {
4343
sc_network::{config::FullNetworkConfiguration, NetworkBlock},
4444
sc_network_sync::SyncingService,
4545
sc_network_transactions::TransactionsHandlerController,
46-
sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor},
4746
sc_service::{
4847
Configuration, KeystoreContainer, NetworkStarter, SpawnTaskHandle, TFullBackend,
4948
TFullClient, TaskManager,
@@ -65,6 +64,7 @@ use {
6564
#[allow(deprecated)]
6665
use sc_executor::NativeElseWasmExecutor;
6766
use sp_api::StorageProof;
67+
use sp_core::traits::SpawnNamed;
6868

6969
tp_traits::alias!(
7070
pub trait MinimalRuntimeApi<
@@ -250,6 +250,7 @@ where
250250

251251
let heap_pages =
252252
parachain_config
253+
.executor
253254
.default_heap_pages
254255
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static {
255256
extra_pages: h as u32,
@@ -260,12 +261,13 @@ where
260261
// to change once we start having runtime_cache_sizes, or
261262
// run nodes with the maximum for this value
262263
let mut wasm_builder = WasmExecutor::builder()
263-
.with_execution_method(parachain_config.wasm_method)
264+
.with_execution_method(parachain_config.executor.wasm_method)
264265
.with_onchain_heap_alloc_strategy(heap_pages)
265266
.with_offchain_heap_alloc_strategy(heap_pages)
266-
.with_max_runtime_instances(parachain_config.max_runtime_instances)
267-
.with_runtime_cache_size(parachain_config.runtime_cache_size);
268-
if let Some(ref wasmtime_precompiled_path) = parachain_config.wasmtime_precompiled {
267+
.with_max_runtime_instances(parachain_config.executor.max_runtime_instances)
268+
.with_runtime_cache_size(parachain_config.executor.runtime_cache_size);
269+
if let Some(ref wasmtime_precompiled_path) = parachain_config.executor.wasmtime_precompiled
270+
{
269271
wasm_builder = wasm_builder.with_wasmtime_precompiled_path(wasmtime_precompiled_path);
270272
}
271273

@@ -383,7 +385,10 @@ where
383385
import_queue_service: _,
384386
} = self;
385387

386-
let net_config = FullNetworkConfiguration::<_, _, Net>::new(&parachain_config.network);
388+
let net_config = FullNetworkConfiguration::<_, _, Net>::new(
389+
&parachain_config.network,
390+
prometheus_registry.clone(),
391+
);
387392

388393
let import_queue_service = import_queue.service();
389394
let spawn_handle = task_manager.spawn_handle();
@@ -461,7 +466,10 @@ where
461466
import_queue_service: _,
462467
} = self;
463468

464-
let net_config = FullNetworkConfiguration::<_, _, Net>::new(&parachain_config.network);
469+
let net_config = FullNetworkConfiguration::<_, _, Net>::new(
470+
&parachain_config.network,
471+
prometheus_registry.clone(),
472+
);
465473

466474
let metrics = Net::register_notification_metrics(
467475
parachain_config
@@ -479,7 +487,7 @@ where
479487
transaction_pool: transaction_pool.clone(),
480488
spawn_handle: task_manager.spawn_handle(),
481489
import_queue,
482-
warp_sync_params: None,
490+
warp_sync_config: None,
483491
block_announce_validator_builder: None,
484492
net_config,
485493
block_relay: None,
@@ -515,10 +523,7 @@ where
515523
self,
516524
parachain_config: Configuration,
517525
rpc_builder: Box<
518-
dyn Fn(
519-
DenyUnsafe,
520-
SubscriptionTaskExecutor,
521-
) -> Result<RpcModule<TRpc>, sc_service::Error>,
526+
dyn Fn(Arc<(dyn SpawnNamed + 'static)>) -> Result<RpcModule<TRpc>, sc_service::Error>,
522527
>,
523528
) -> sc_service::error::Result<NodeBuilder<T, Network<BlockOf<T>>, (), SImportQueueService>>
524529
where
@@ -594,7 +599,7 @@ where
594599
// in there and swapping out the requirements for your own are probably a good idea. The
595600
// requirements for a para-chain are dictated by its relay-chain.
596601
if collator {
597-
if let Err(err) = SUBSTRATE_REFERENCE_HARDWARE.check_hardware(hwbench) {
602+
if let Err(err) = SUBSTRATE_REFERENCE_HARDWARE.check_hardware(hwbench, false) {
598603
log::warn!(
599604
"⚠️ The hardware does not meet the minimal requirements {} for role 'Authority'.",
600605
err

client/service-container-chain/src/cli.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use {
2323
sc_network::config::MultiaddrWithPeerId,
2424
sc_service::BasePath,
2525
sp_runtime::Storage,
26-
std::{collections::BTreeMap, net::SocketAddr},
26+
std::collections::BTreeMap,
2727
url::Url,
2828
};
2929

@@ -147,7 +147,7 @@ impl ContainerChainCli {
147147
base.base
148148
.import_params
149149
.wasmtime_precompiled
150-
.clone_from(&para_config.wasmtime_precompiled);
150+
.clone_from(&para_config.executor.wasmtime_precompiled);
151151
}
152152

153153
// Set container base path to the same value as orchestrator base_path.
@@ -325,7 +325,10 @@ impl sc_cli::CliConfiguration<Self> for ContainerChainCli {
325325
self.shared_params().base_path()
326326
}
327327

328-
fn rpc_addr(&self, default_listen_port: u16) -> sc_cli::Result<Option<SocketAddr>> {
328+
fn rpc_addr(
329+
&self,
330+
default_listen_port: u16,
331+
) -> sc_cli::Result<Option<Vec<sc_cli::RpcEndpoint>>> {
329332
self.base.base.rpc_addr(default_listen_port)
330333
}
331334

@@ -344,10 +347,9 @@ impl sc_cli::CliConfiguration<Self> for ContainerChainCli {
344347
_support_url: &String,
345348
_impl_version: &String,
346349
_logger_hook: F,
347-
_config: &sc_service::Configuration,
348350
) -> sc_cli::Result<()>
349351
where
350-
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
352+
F: FnOnce(&mut sc_cli::LoggerBuilder),
351353
{
352354
unreachable!("PolkadotCli is never initialized; qed");
353355
}

client/service-container-chain/src/data_preservers.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Tanssi. If not, see <http://www.gnu.org/licenses/>
1616

17+
use frame_support::__private::sp_tracing::tracing::Instrument;
1718
use {
1819
crate::spawner::{wait_for_paritydb_lock, Spawner},
1920
dc_orchestrator_chain_interface::{
@@ -33,7 +34,6 @@ async fn try_fut<T, E>(fut: impl Future<Output = Result<T, E>>) -> Result<T, E>
3334

3435
/// Watch assignements by indefinitly listening to finalized block notifications and switching to
3536
/// the chain the profile is assigned to.
36-
#[sc_tracing::logging::prefix_logs_with("Data Preserver Assignment Watcher")]
3737
pub async fn task_watch_assignment(spawner: impl Spawner, profile_id: ProfileId) {
3838
use dc_orchestrator_chain_interface::DataPreserverAssignment as Assignment;
3939

@@ -111,6 +111,10 @@ pub async fn task_watch_assignment(spawner: impl Spawner, profile_id: ProfileId)
111111

112112
Ok(())
113113
})
114+
.instrument(sc_tracing::tracing::info_span!(
115+
sc_tracing::logging::PREFIX_LOG_SPAN,
116+
name = "Data Preserver Assignment Watcher",
117+
))
114118
.await
115119
{
116120
log::error!("Error in data preservers assignement watching task: {e:?}");

client/service-container-chain/src/rpc.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use {
3232
rpc::{ManualSeal, ManualSealApiServer},
3333
EngineCommand,
3434
},
35-
sc_rpc::DenyUnsafe,
3635
sc_transaction_pool_api::TransactionPool,
3736
sp_api::ProvideRuntimeApi,
3837
sp_block_builder::BlockBuilder,
@@ -49,8 +48,6 @@ pub struct FullDeps<C, P> {
4948
pub client: Arc<C>,
5049
/// Transaction pool instance.
5150
pub pool: Arc<P>,
52-
/// Whether to deny unsafe calls
53-
pub deny_unsafe: DenyUnsafe,
5451
/// Manual seal command sink
5552
pub command_sink: Option<futures::channel::mpsc::Sender<EngineCommand<Hash>>>,
5653
/// Channels for manual xcm messages (downward, hrmp)
@@ -92,12 +89,11 @@ where
9289
let FullDeps {
9390
client,
9491
pool,
95-
deny_unsafe,
9692
command_sink,
9793
xcm_senders,
9894
} = deps;
9995

100-
module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
96+
module.merge(System::new(client.clone(), pool).into_rpc())?;
10197

10298
if let Some(command_sink) = command_sink {
10399
module.merge(
@@ -144,10 +140,7 @@ pub mod generate_rpc_builder {
144140
pub type XcmSenders = (flume::Sender<Vec<u8>>, flume::Sender<(ParaId, Vec<u8>)>);
145141
pub type Network = dyn sc_network::service::traits::NetworkService;
146142
pub type CompleteRpcBuilder = Box<
147-
dyn Fn(
148-
sc_rpc::DenyUnsafe,
149-
sc_rpc::SubscriptionTaskExecutor,
150-
) -> Result<jsonrpsee::RpcModule<()>, ServiceError>,
143+
dyn Fn(sc_rpc::SubscriptionTaskExecutor) -> Result<jsonrpsee::RpcModule<()>, ServiceError>,
151144
>;
152145

153146
pub struct GenerateRpcBuilderParams<'a, RuntimeApi: MinimalContainerRuntimeApi> {
@@ -205,11 +198,10 @@ mod impl_generate_rpc_builder {
205198
let client = client.clone();
206199
let transaction_pool = transaction_pool.clone();
207200

208-
Ok(Box::new(move |deny_unsafe, _| {
201+
Ok(Box::new(move |_| {
209202
let deps = FullDeps {
210203
client: client.clone(),
211204
pool: transaction_pool.clone(),
212-
deny_unsafe,
213205
command_sink: command_sink.clone(),
214206
xcm_senders: xcm_senders.clone(),
215207
};

0 commit comments

Comments
 (0)