Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 6229468

Browse files
committed
Fixes for inherent stuff
TODO: check - parachain_inherent not needed anymore?
1 parent e6e428e commit 6229468

File tree

7 files changed

+86
-83
lines changed

7 files changed

+86
-83
lines changed

Cargo.lock

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

client/consensus/aura/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ where
201201

202202
let info = SlotInfo::new(
203203
inherent_data_providers.slot(),
204+
inherent_data_providers.timestamp(),
204205
inherent_data,
205206
self.slot_duration.as_duration(),
206207
parent.clone(),

parachain-template/node/src/service.rs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ where
289289
let prometheus_registry = parachain_config.prometheus_registry().cloned();
290290
let transaction_pool = params.transaction_pool.clone();
291291
let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);
292-
let (network, system_rpc_tx, tx_handler_controller, start_network) =
292+
let (network, system_rpc_tx, start_network) =
293293
sc_service::build_network(sc_service::BuildNetworkParams {
294294
config: &parachain_config,
295295
client: client.clone(),
@@ -327,7 +327,6 @@ where
327327
backend: backend.clone(),
328328
network: network.clone(),
329329
system_rpc_tx,
330-
tx_handler_controller,
331330
telemetry: telemetry.as_mut(),
332331
})?;
333332

@@ -436,7 +435,7 @@ pub fn parachain_build_import_queue(
436435
slot_duration,
437436
);
438437

439-
Ok((slot, timestamp))
438+
Ok((timestamp, slot))
440439
},
441440
registry: config.prometheus_registry(),
442441
spawner: &task_manager.spawn_essential_handle(),
@@ -488,13 +487,14 @@ pub async fn start_parachain_node(
488487
create_inherent_data_providers: move |_, (relay_parent, validation_data)| {
489488
let relay_chain_interface = relay_chain_interface.clone();
490489
async move {
491-
let parachain_inherent =
492-
cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
493-
relay_parent,
494-
&relay_chain_interface,
495-
&validation_data,
496-
id,
497-
).await;
490+
// TODO: check - parachain_inherent not needed?
491+
// let parachain_inherent =
492+
// cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
493+
// relay_parent,
494+
// &relay_chain_interface,
495+
// &validation_data,
496+
// id,
497+
// ).await;
498498
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
499499

500500
let slot =
@@ -503,12 +503,14 @@ pub async fn start_parachain_node(
503503
slot_duration,
504504
);
505505

506-
let parachain_inherent = parachain_inherent.ok_or_else(|| {
507-
Box::<dyn std::error::Error + Send + Sync>::from(
508-
"Failed to create parachain inherent",
509-
)
510-
})?;
511-
Ok((slot, timestamp, parachain_inherent))
506+
// TODO: check - parachain_inherent not needed?
507+
// let parachain_inherent = parachain_inherent.ok_or_else(|| {
508+
// Box::<dyn std::error::Error + Send + Sync>::from(
509+
// "Failed to create parachain inherent",
510+
// )
511+
// })?;
512+
// Ok((slot, timestamp, parachain_inherent))
513+
Ok((timestamp, slot))
512514
}
513515
},
514516
block_import: client.clone(),

parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use xcm::latest::prelude::*;
3131
use xcm_builder::{
3232
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
3333
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
34-
FixedWeightBounds, IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset,
34+
FixedWeightBounds, IsConcrete, ParentAsSuperuser, ParentIsPreset,
3535
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
3636
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
3737
UsingComponents,

polkadot-parachain/src/service.rs

Lines changed: 60 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ where
378378
let prometheus_registry = parachain_config.prometheus_registry().cloned();
379379
let transaction_pool = params.transaction_pool.clone();
380380
let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);
381-
let (network, system_rpc_tx, tx_handler_controller, start_network) =
381+
let (network, system_rpc_tx, start_network) =
382382
sc_service::build_network(sc_service::BuildNetworkParams {
383383
config: &parachain_config,
384384
client: client.clone(),
@@ -404,7 +404,6 @@ where
404404
backend: backend.clone(),
405405
network: network.clone(),
406406
system_rpc_tx,
407-
tx_handler_controller,
408407
telemetry: telemetry.as_mut(),
409408
})?;
410409

@@ -576,7 +575,7 @@ where
576575
let prometheus_registry = parachain_config.prometheus_registry().cloned();
577576
let transaction_pool = params.transaction_pool.clone();
578577
let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);
579-
let (network, system_rpc_tx, tx_handler_controller, start_network) =
578+
let (network, system_rpc_tx, start_network) =
580579
sc_service::build_network(sc_service::BuildNetworkParams {
581580
config: &parachain_config,
582581
client: client.clone(),
@@ -614,7 +613,6 @@ where
614613
backend: backend.clone(),
615614
network: network.clone(),
616615
system_rpc_tx,
617-
tx_handler_controller,
618616
telemetry: telemetry.as_mut(),
619617
})?;
620618

@@ -724,7 +722,7 @@ pub fn rococo_parachain_build_import_queue(
724722
slot_duration,
725723
);
726724

727-
Ok((slot, timestamp))
725+
Ok((timestamp, slot))
728726
},
729727
registry: config.prometheus_registry(),
730728
spawner: &task_manager.spawn_essential_handle(),
@@ -777,13 +775,14 @@ pub async fn start_rococo_parachain_node(
777775
let relay_chain_interface = relay_chain_interface.clone();
778776

779777
async move {
780-
let parachain_inherent =
781-
cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
782-
relay_parent,
783-
&relay_chain_interface,
784-
&validation_data,
785-
id,
786-
).await;
778+
// TODO: check - parachain_inherent not needed?
779+
// let parachain_inherent =
780+
// cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
781+
// relay_parent,
782+
// &relay_chain_interface,
783+
// &validation_data,
784+
// id,
785+
// ).await;
787786

788787
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
789788

@@ -793,13 +792,16 @@ pub async fn start_rococo_parachain_node(
793792
slot_duration,
794793
);
795794

796-
let parachain_inherent = parachain_inherent.ok_or_else(|| {
797-
Box::<dyn std::error::Error + Send + Sync>::from(
798-
"Failed to create parachain inherent",
799-
)
800-
})?;
795+
// TODO: check - parachain_inherent not needed?
796+
// let parachain_inherent = parachain_inherent.ok_or_else(|| {
797+
// Box::<dyn std::error::Error + Send + Sync>::from(
798+
// "Failed to create parachain inherent",
799+
// )
800+
// })?;
801801

802-
Ok((slot, timestamp, parachain_inherent))
802+
// TODO: check - parachain_inherent not needed?
803+
// Ok((slot, timestamp, parachain_inherent))
804+
Ok((timestamp, slot))
803805
}
804806
},
805807
block_import: client.clone(),
@@ -809,11 +811,11 @@ pub async fn start_rococo_parachain_node(
809811
keystore,
810812
force_authoring,
811813
slot_duration,
814+
telemetry,
812815
// We got around 500ms for proposing
813816
block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32),
814817
// And a maximum of 750ms if slots are skipped
815818
max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)),
816-
telemetry,
817819
},
818820
))
819821
},
@@ -1098,7 +1100,7 @@ where
10981100
slot_duration,
10991101
);
11001102

1101-
Ok((slot, timestamp))
1103+
Ok((timestamp, slot))
11021104
},
11031105
telemetry: telemetry_handle,
11041106
},
@@ -1201,13 +1203,14 @@ where
12011203
move |_, (relay_parent, validation_data)| {
12021204
let relay_chain_for_aura = relay_chain_for_aura.clone();
12031205
async move {
1204-
let parachain_inherent =
1205-
cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
1206-
relay_parent,
1207-
&relay_chain_for_aura,
1208-
&validation_data,
1209-
id,
1210-
).await;
1206+
// TODO: check - parachain_inherent not needed?
1207+
// let parachain_inherent =
1208+
// cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
1209+
// relay_parent,
1210+
// &relay_chain_for_aura,
1211+
// &validation_data,
1212+
// id,
1213+
// ).await;
12111214

12121215
let timestamp =
12131216
sp_timestamp::InherentDataProvider::from_system_time();
@@ -1218,14 +1221,17 @@ where
12181221
slot_duration,
12191222
);
12201223

1221-
let parachain_inherent =
1222-
parachain_inherent.ok_or_else(|| {
1223-
Box::<dyn std::error::Error + Send + Sync>::from(
1224-
"Failed to create parachain inherent",
1225-
)
1226-
})?;
1227-
1228-
Ok((slot, timestamp, parachain_inherent))
1224+
// TODO: check - parachain_inherent not needed?
1225+
// let parachain_inherent =
1226+
// parachain_inherent.ok_or_else(|| {
1227+
// Box::<dyn std::error::Error + Send + Sync>::from(
1228+
// "Failed to create parachain inherent",
1229+
// )
1230+
// })?;
1231+
1232+
// TODO: check - parachain_inherent not needed?
1233+
// Ok((slot, timestamp, parachain_inherent))
1234+
Ok((timestamp, slot))
12291235
}
12301236
},
12311237
block_import: client2.clone(),
@@ -1392,7 +1398,7 @@ where
13921398
let prometheus_registry = parachain_config.prometheus_registry().cloned();
13931399
let transaction_pool = params.transaction_pool.clone();
13941400
let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);
1395-
let (network, system_rpc_tx, tx_handler_controller, start_network) =
1401+
let (network, system_rpc_tx, start_network) =
13961402
sc_service::build_network(sc_service::BuildNetworkParams {
13971403
config: &parachain_config,
13981404
client: client.clone(),
@@ -1430,7 +1436,6 @@ where
14301436
backend: backend.clone(),
14311437
network: network.clone(),
14321438
system_rpc_tx,
1433-
tx_handler_controller,
14341439
telemetry: telemetry.as_mut(),
14351440
})?;
14361441

@@ -1540,7 +1545,7 @@ pub fn contracts_rococo_build_import_queue(
15401545
slot_duration,
15411546
);
15421547

1543-
Ok((slot, timestamp))
1548+
Ok((timestamp, slot))
15441549
},
15451550
registry: config.prometheus_registry(),
15461551
spawner: &task_manager.spawn_essential_handle(),
@@ -1592,13 +1597,14 @@ pub async fn start_contracts_rococo_node(
15921597
create_inherent_data_providers: move |_, (relay_parent, validation_data)| {
15931598
let relay_chain_interface = relay_chain_interface.clone();
15941599
async move {
1595-
let parachain_inherent =
1596-
cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
1597-
relay_parent,
1598-
&relay_chain_interface,
1599-
&validation_data,
1600-
id,
1601-
).await;
1600+
// TODO: check - parachain_inherent not needed?
1601+
// let parachain_inherent =
1602+
// cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
1603+
// relay_parent,
1604+
// &relay_chain_interface,
1605+
// &validation_data,
1606+
// id,
1607+
// ).await;
16021608

16031609
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
16041610

@@ -1608,13 +1614,16 @@ pub async fn start_contracts_rococo_node(
16081614
slot_duration,
16091615
);
16101616

1611-
let parachain_inherent = parachain_inherent.ok_or_else(|| {
1612-
Box::<dyn std::error::Error + Send + Sync>::from(
1613-
"Failed to create parachain inherent",
1614-
)
1615-
})?;
1617+
// TODO: check - parachain_inherent not needed?
1618+
// let parachain_inherent = parachain_inherent.ok_or_else(|| {
1619+
// Box::<dyn std::error::Error + Send + Sync>::from(
1620+
// "Failed to create parachain inherent",
1621+
// )
1622+
// })?;
16161623

1617-
Ok((slot, timestamp, parachain_inherent))
1624+
// TODO: check - parachain_inherent not needed?
1625+
// Ok((slot, timestamp, parachain_inherent))
1626+
Ok((timestamp, slot))
16181627
}
16191628
},
16201629
block_import: client.clone(),

primitives/utility/Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", default-features = f
1616
sp-trie = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
1717

1818
# Polkadot
19-
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
2019
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
21-
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
22-
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
2320
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
2421
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
2522
xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
@@ -33,13 +30,11 @@ default = [ "std" ]
3330
std = [
3431
"codec/std",
3532
"frame-support/std",
33+
"sp-io/std",
3634
"sp-runtime/std",
3735
"sp-std/std",
3836
"sp-trie/std",
39-
"polkadot-core-primitives/std",
4037
"polkadot-runtime-common/std",
41-
"polkadot-parachain/std",
42-
"polkadot-primitives/std",
4338
"cumulus-primitives-core/std",
4439
"xcm/std",
4540
"xcm-builder/std",

test/service/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ use frame_system_rpc_runtime_api::AccountNonceApi;
4545
use polkadot_primitives::v2::{CollatorPair, Hash as PHash, PersistedValidationData};
4646
use polkadot_service::ProvideRuntimeApi;
4747
use sc_client_api::execution_extensions::ExecutionStrategies;
48-
use sc_network::{multiaddr, NetworkBlock, NetworkService};
49-
use sc_network_common::{config::TransportConfig, service::NetworkStateInfo};
48+
use sc_network::{multiaddr, NetworkBlock, NetworkService, config::TransportConfig};
49+
use sc_network_common::service::NetworkStateInfo;
5050
use sc_service::{
5151
config::{
5252
BlocksPruning, DatabaseSource, KeystoreConfig, MultiaddrWithPeerId, NetworkConfiguration,
@@ -257,7 +257,7 @@ where
257257

258258
let prometheus_registry = parachain_config.prometheus_registry().cloned();
259259
let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);
260-
let (network, system_rpc_tx, tx_handler_controller, start_network) =
260+
let (network, system_rpc_tx, start_network) =
261261
sc_service::build_network(sc_service::BuildNetworkParams {
262262
config: &parachain_config,
263263
client: client.clone(),
@@ -284,7 +284,6 @@ where
284284
backend,
285285
network: network.clone(),
286286
system_rpc_tx,
287-
tx_handler_controller,
288287
telemetry: None,
289288
})?;
290289

@@ -629,7 +628,7 @@ pub fn node_config(
629628
if nodes_exlusive {
630629
network_config.default_peers_set.reserved_nodes = nodes;
631630
network_config.default_peers_set.non_reserved_mode =
632-
sc_network_common::config::NonReservedPeerMode::Deny;
631+
sc_network::config::NonReservedPeerMode::Deny;
633632
} else {
634633
network_config.boot_nodes = nodes;
635634
}
@@ -654,7 +653,7 @@ pub fn node_config(
654653
database: DatabaseSource::RocksDb { path: root.join("db"), cache_size: 128 },
655654
trie_cache_maximum_size: Some(64 * 1024 * 1024),
656655
state_pruning: Some(PruningMode::ArchiveAll),
657-
blocks_pruning: BlocksPruning::KeepAll,
656+
blocks_pruning: BlocksPruning::All,
658657
chain_spec: spec,
659658
wasm_method: WasmExecutionMethod::Interpreted,
660659
// NOTE: we enforce the use of the native runtime to make the errors more debuggable

0 commit comments

Comments
 (0)