Skip to content

Commit c1a5dbf

Browse files
committed
Merge remote-tracking branch 'origin/master' into alindima/add-systematic-chunks-av-recovery
2 parents ce633b4 + e7d29bc commit c1a5dbf

File tree

46 files changed

+1193
-1226
lines changed

Some content is hidden

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

46 files changed

+1193
-1226
lines changed

.gitlab/pipeline/short-benchmarks.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# run short-benchmarks for relay chain runtimes from polkadot
77

8-
short-benchmark-polkadot: &short-bench
8+
short-benchmark-westend: &short-bench
99
stage: short-benchmarks
1010
extends:
1111
- .docker-env
@@ -14,22 +14,12 @@ short-benchmark-polkadot: &short-bench
1414
- job: build-short-benchmark
1515
artifacts: true
1616
variables:
17-
RUNTIME: polkadot
17+
RUNTIME: westend
1818
tags:
1919
- benchmark
2020
script:
2121
- ./artifacts/polkadot benchmark pallet --chain $RUNTIME-dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1
2222

23-
short-benchmark-kusama:
24-
<<: *short-bench
25-
variables:
26-
RUNTIME: kusama
27-
28-
short-benchmark-westend:
29-
<<: *short-bench
30-
variables:
31-
RUNTIME: westend
32-
3323
# run short-benchmarks for system parachain runtimes from cumulus
3424

3525
.short-benchmark-cumulus: &short-bench-cumulus

Cargo.lock

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

cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/hrmp_channels.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,6 @@ fn force_open_hrmp_channel_for_system_para_works() {
159159
// Parachain A init values
160160
let para_a_id = PenpalKusamaA::para_id();
161161

162-
let fund_amount = KUSAMA_ED * 1000_000_000;
163-
164-
// Fund Parachain's Sovereign accounts to be able to reserve the deposit
165-
let para_a_sovereign_account = Kusama::fund_para_sovereign(fund_amount, para_a_id);
166-
let system_para_sovereign_account = Kusama::fund_para_sovereign(fund_amount, system_para_id);
167-
168162
Kusama::execute_with(|| {
169163
assert_ok!(<Kusama as KusamaPallet>::Hrmp::force_open_hrmp_channel(
170164
relay_root_origin,
@@ -179,14 +173,6 @@ fn force_open_hrmp_channel_for_system_para_works() {
179173
assert_expected_events!(
180174
Kusama,
181175
vec![
182-
// Sender deposit is reserved for System Parachain's Sovereign account
183-
RuntimeEvent::Balances(pallet_balances::Event::Reserved { who, .. }) =>{
184-
who: *who == system_para_sovereign_account,
185-
},
186-
// Recipient deposit is reserved for Parachain's Sovereign account
187-
RuntimeEvent::Balances(pallet_balances::Event::Reserved { who, .. }) =>{
188-
who: *who == para_a_sovereign_account,
189-
},
190176
// HRMP channel forced opened
191177
RuntimeEvent::Hrmp(
192178
polkadot_runtime_parachains::hrmp::Event::HrmpChannelForceOpened(

cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/hrmp_channels.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,6 @@ fn force_open_hrmp_channel_for_system_para_works() {
159159
// Parachain A init values
160160
let para_a_id = PenpalPolkadotA::para_id();
161161

162-
let fund_amount = POLKADOT_ED * 1000_000_000;
163-
164-
// Fund Parachain's Sovereign accounts to be able to reserve the deposit
165-
let system_para_sovereign_account = Polkadot::fund_para_sovereign(fund_amount, system_para_id);
166-
let para_a_sovereign_account = Polkadot::fund_para_sovereign(fund_amount, para_a_id);
167-
168162
Polkadot::execute_with(|| {
169163
assert_ok!(<Polkadot as PolkadotPallet>::Hrmp::force_open_hrmp_channel(
170164
relay_root_origin,
@@ -179,14 +173,6 @@ fn force_open_hrmp_channel_for_system_para_works() {
179173
assert_expected_events!(
180174
Polkadot,
181175
vec![
182-
// Sender deposit is reserved for System Parachain's Sovereign account
183-
RuntimeEvent::Balances(pallet_balances::Event::Reserved { who, .. }) =>{
184-
who: *who == system_para_sovereign_account,
185-
},
186-
// Recipient deposit is reserved for Parachain's Sovereign account
187-
RuntimeEvent::Balances(pallet_balances::Event::Reserved { who, .. }) =>{
188-
who: *who == para_a_sovereign_account,
189-
},
190176
// HRMP channel forced opened
191177
RuntimeEvent::Hrmp(
192178
polkadot_runtime_parachains::hrmp::Event::HrmpChannelForceOpened(

polkadot/Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ color-eyre = { version = "0.6.1", default-features = false }
2626
tikv-jemallocator = { version = "0.5.0", optional = true }
2727

2828
# Crates in our workspace, defined as dependencies so we can pass them feature flags.
29-
polkadot-cli = { path = "cli", features = [
30-
"kusama-native",
31-
"westend-native",
32-
"rococo-native",
33-
] }
29+
polkadot-cli = { path = "cli", features = [ "westend-native", "rococo-native" ] }
3430
polkadot-node-core-pvf = { path = "node/core/pvf" }
3531
polkadot-node-core-pvf-prepare-worker = { path = "node/core/pvf/prepare-worker" }
3632
polkadot-overseer = { path = "node/overseer" }

polkadot/cli/Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ fast-runtime = [ "service/fast-runtime" ]
6767
pyroscope = [ "pyro", "pyroscope_pprofrs" ]
6868
hostperfcheck = [ "polkadot-performance-test" ]
6969

70-
# Configure the native runtimes to use. Polkadot is enabled by default.
71-
#
72-
# Validators require the native runtime currently
73-
polkadot-native = [ "service/polkadot-native" ]
74-
kusama-native = [ "service/kusama-native" ]
70+
# Configure the native runtimes to use.
7571
westend-native = [ "service/westend-native" ]
7672
rococo-native = [ "service/rococo-native" ]
7773

polkadot/cli/src/command.rs

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ pub use polkadot_performance_test::PerfCheckError;
3434
#[cfg(feature = "pyroscope")]
3535
use pyroscope_pprofrs::{pprof_backend, PprofConfig};
3636

37-
impl From<String> for Error {
38-
fn from(s: String) -> Self {
39-
Self::Other(s)
40-
}
41-
}
42-
4337
type Result<T> = std::result::Result<T, Error>;
4438

4539
fn get_exec_name() -> Option<String> {
@@ -92,29 +86,20 @@ impl SubstrateCli for Cli {
9286
};
9387
Ok(match id {
9488
"kusama" => Box::new(service::chain_spec::kusama_config()?),
95-
#[cfg(feature = "kusama-native")]
96-
"kusama-dev" => Box::new(service::chain_spec::kusama_development_config()?),
97-
#[cfg(feature = "kusama-native")]
98-
"kusama-local" => Box::new(service::chain_spec::kusama_local_testnet_config()?),
99-
#[cfg(feature = "kusama-native")]
100-
"kusama-staging" => Box::new(service::chain_spec::kusama_staging_testnet_config()?),
101-
#[cfg(not(feature = "kusama-native"))]
10289
name if name.starts_with("kusama-") && !name.ends_with(".json") =>
103-
Err(format!("`{}` only supported with `kusama-native` feature enabled.", name))?,
90+
Err(format!("`{name}` is not supported anymore as the kusama native runtime no longer part of the node."))?,
10491
"polkadot" => Box::new(service::chain_spec::polkadot_config()?),
105-
#[cfg(feature = "polkadot-native")]
106-
"polkadot-dev" | "dev" => Box::new(service::chain_spec::polkadot_development_config()?),
107-
#[cfg(feature = "polkadot-native")]
108-
"polkadot-local" => Box::new(service::chain_spec::polkadot_local_testnet_config()?),
92+
name if name.starts_with("polkadot-") && !name.ends_with(".json") =>
93+
Err(format!("`{name}` is not supported anymore as the polkadot native runtime no longer part of the node."))?,
10994
"rococo" => Box::new(service::chain_spec::rococo_config()?),
11095
#[cfg(feature = "rococo-native")]
111-
"rococo-dev" => Box::new(service::chain_spec::rococo_development_config()?),
96+
"dev" | "rococo-dev" => Box::new(service::chain_spec::rococo_development_config()?),
11297
#[cfg(feature = "rococo-native")]
11398
"rococo-local" => Box::new(service::chain_spec::rococo_local_testnet_config()?),
11499
#[cfg(feature = "rococo-native")]
115100
"rococo-staging" => Box::new(service::chain_spec::rococo_staging_testnet_config()?),
116101
#[cfg(not(feature = "rococo-native"))]
117-
name if name.starts_with("rococo-") && !name.ends_with(".json") =>
102+
name if name.starts_with("rococo-") && !name.ends_with(".json") || name == "dev" =>
118103
Err(format!("`{}` only supported with `rococo-native` feature enabled.", name))?,
119104
"westend" => Box::new(service::chain_spec::westend_config()?),
120105
#[cfg(feature = "westend-native")]
@@ -146,7 +131,7 @@ impl SubstrateCli for Cli {
146131
path => {
147132
let path = std::path::PathBuf::from(path);
148133

149-
let chain_spec = Box::new(service::PolkadotChainSpec::from_json_file(path.clone())?)
134+
let chain_spec = Box::new(service::GenericChainSpec::from_json_file(path.clone())?)
150135
as Box<dyn service::ChainSpec>;
151136

152137
// When `force_*` is given or the file name starts with the name of one of the known
@@ -158,7 +143,7 @@ impl SubstrateCli for Cli {
158143
{
159144
Box::new(service::RococoChainSpec::from_json_file(path)?)
160145
} else if self.run.force_kusama || chain_spec.is_kusama() {
161-
Box::new(service::KusamaChainSpec::from_json_file(path)?)
146+
Box::new(service::GenericChainSpec::from_json_file(path)?)
162147
} else if self.run.force_westend || chain_spec.is_westend() {
163148
Box::new(service::WestendChainSpec::from_json_file(path)?)
164149
} else {
@@ -182,17 +167,6 @@ fn set_default_ss58_version(spec: &Box<dyn service::ChainSpec>) {
182167
sp_core::crypto::set_default_ss58_version(ss58_version);
183168
}
184169

185-
const DEV_ONLY_ERROR_PATTERN: &'static str =
186-
"can only use subcommand with --chain [polkadot-dev, kusama-dev, westend-dev, rococo-dev, wococo-dev], got ";
187-
188-
fn ensure_dev(spec: &Box<dyn service::ChainSpec>) -> std::result::Result<(), String> {
189-
if spec.is_dev() {
190-
Ok(())
191-
} else {
192-
Err(format!("{}{}", DEV_ONLY_ERROR_PATTERN, spec.id()))
193-
}
194-
}
195-
196170
/// Runs performance checks.
197171
/// Should only be used in release build since the check would take too much time otherwise.
198172
fn host_perf_check() -> Result<()> {
@@ -471,8 +445,7 @@ pub fn run() -> Result<()> {
471445
cmd.run(client.clone()).map_err(Error::SubstrateCli)
472446
}),
473447
// These commands are very similar and can be handled in nearly the same way.
474-
BenchmarkCmd::Extrinsic(_) | BenchmarkCmd::Overhead(_) => {
475-
ensure_dev(chain_spec).map_err(Error::Other)?;
448+
BenchmarkCmd::Extrinsic(_) | BenchmarkCmd::Overhead(_) =>
476449
runner.sync_run(|mut config| {
477450
let (client, _, _, _) = service::new_chain_ops(&mut config, None)?;
478451
let header = client.header(client.info().genesis_hash).unwrap().unwrap();
@@ -508,11 +481,9 @@ pub fn run() -> Result<()> {
508481
.map_err(Error::SubstrateCli),
509482
_ => unreachable!("Ensured by the outside match; qed"),
510483
}
511-
})
512-
},
484+
}),
513485
BenchmarkCmd::Pallet(cmd) => {
514486
set_default_ss58_version(chain_spec);
515-
ensure_dev(chain_spec).map_err(Error::Other)?;
516487

517488
if cfg!(feature = "runtime-benchmarks") {
518489
runner.sync_run(|config| {

polkadot/cli/src/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,9 @@ pub enum Error {
5858
#[error("This subcommand is only available when compiled with `{feature}`")]
5959
FeatureNotEnabled { feature: &'static str },
6060
}
61+
62+
impl From<String> for Error {
63+
fn from(s: String) -> Self {
64+
Self::Other(s)
65+
}
66+
}

polkadot/node/malus/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ path = "../../src/bin/prepare-worker.rs"
2626
doc = false
2727

2828
[dependencies]
29-
polkadot-cli = { path = "../../cli", features = [ "malus", "rococo-native", "kusama-native", "westend-native", "polkadot-native" ] }
29+
polkadot-cli = { path = "../../cli", features = [ "malus", "rococo-native", "westend-native" ] }
3030
polkadot-node-subsystem = { path = "../subsystem" }
3131
polkadot-node-subsystem-util = { path = "../subsystem-util" }
3232
polkadot-node-subsystem-types = { path = "../subsystem-types" }

polkadot/node/service/Cargo.toml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,12 @@ polkadot-node-subsystem-util = { path = "../subsystem-util" }
103103
polkadot-node-subsystem-types = { path = "../subsystem-types" }
104104
polkadot-runtime-parachains = { path = "../../runtime/parachains" }
105105
polkadot-node-network-protocol = { path = "../network/protocol" }
106-
polkadot-runtime-common = { path = "../../runtime/common" }
107106

108107
# Polkadot Runtime Constants
109-
polkadot-runtime-constants = { path = "../../runtime/polkadot/constants", optional = true }
110-
kusama-runtime-constants = { path = "../../runtime/kusama/constants", optional = true }
111108
rococo-runtime-constants = { path = "../../runtime/rococo/constants", optional = true }
112109
westend-runtime-constants = { path = "../../runtime/westend/constants", optional = true }
113110

114111
# Polkadot Runtimes
115-
polkadot-runtime = { path = "../../runtime/polkadot", optional = true }
116-
kusama-runtime = { package = "staging-kusama-runtime", path = "../../runtime/kusama", optional = true }
117112
westend-runtime = { path = "../../runtime/westend", optional = true }
118113
rococo-runtime = { path = "../../runtime/rococo", optional = true }
119114

@@ -183,11 +178,7 @@ full-node = [
183178
"polkadot-statement-distribution",
184179
]
185180

186-
# Configure the native runtimes to use. Polkadot is enabled by default.
187-
#
188-
# Validators require the native runtime currently
189-
polkadot-native = [ "polkadot-runtime", "polkadot-runtime-constants" ]
190-
kusama-native = [ "kusama-runtime", "kusama-runtime-constants" ]
181+
# Configure the native runtimes to use.
191182
westend-native = [ "westend-runtime", "westend-runtime-constants" ]
192183
rococo-native = [ "rococo-runtime", "rococo-runtime-constants" ]
193184

@@ -196,15 +187,12 @@ runtime-benchmarks = [
196187
"frame-benchmarking/runtime-benchmarks",
197188
"frame-support/runtime-benchmarks",
198189
"frame-system/runtime-benchmarks",
199-
"kusama-runtime?/runtime-benchmarks",
200190
"pallet-babe/runtime-benchmarks",
201191
"pallet-im-online/runtime-benchmarks",
202192
"pallet-staking/runtime-benchmarks",
203193
"polkadot-parachain-primitives/runtime-benchmarks",
204194
"polkadot-primitives/runtime-benchmarks",
205-
"polkadot-runtime-common/runtime-benchmarks",
206195
"polkadot-runtime-parachains/runtime-benchmarks",
207-
"polkadot-runtime?/runtime-benchmarks",
208196
"polkadot-test-client/runtime-benchmarks",
209197
"rococo-runtime?/runtime-benchmarks",
210198
"sc-client-db/runtime-benchmarks",
@@ -215,30 +203,23 @@ runtime-benchmarks = [
215203
try-runtime = [
216204
"frame-support/try-runtime",
217205
"frame-system/try-runtime",
218-
"kusama-runtime?/try-runtime",
219206
"pallet-babe/try-runtime",
220207
"pallet-im-online/try-runtime",
221208
"pallet-staking/try-runtime",
222209
"pallet-transaction-payment/try-runtime",
223-
"polkadot-runtime-common/try-runtime",
224210
"polkadot-runtime-parachains/try-runtime",
225-
"polkadot-runtime?/try-runtime",
226211
"rococo-runtime?/try-runtime",
227212
"sp-runtime/try-runtime",
228213
"westend-runtime?/try-runtime",
229214
]
230215
fast-runtime = [
231-
"kusama-runtime?/fast-runtime",
232-
"polkadot-runtime?/fast-runtime",
233216
"rococo-runtime?/fast-runtime",
234217
"westend-runtime?/fast-runtime",
235218
]
236219

237220
malus = [ "full-node" ]
238221
runtime-metrics = [
239-
"kusama-runtime?/runtime-metrics",
240222
"polkadot-runtime-parachains/runtime-metrics",
241-
"polkadot-runtime?/runtime-metrics",
242223
"rococo-runtime?/runtime-metrics",
243224
"westend-runtime?/runtime-metrics",
244225
]

0 commit comments

Comments
 (0)