Skip to content

Commit 404a1e4

Browse files
authored
chore(upgrade): v1.10.0 to v1.11.0 (#2117)
- Upgrade Polkadot-sdk 1.10.0 to 1.11.0 - Update weights to reflect the new version. Notable Changes: - [Apply patch `run_with_spec`](paritytech/polkadot-sdk#3512) - [Genesis Presets](paritytech/polkadot-sdk#2714) - [Integrate LiteP2P](paritytech/polkadot-sdk#2944) - [Template Simplification](https://github.com/paritytech/polkadot-sdk/pull/3801/files) - [Remove try-runtime-cli](https://github.com/paritytech/polkadot-sdk/pull/4017/files#diff-3a3aa5e088741f8ab1ca38fbe314c7a150d18b7466426f4ad2569113017e8439) For more details, please refer to: [Release Notes](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.11.0) #1957
1 parent 29a85e3 commit 404a1e4

38 files changed

+2114
-1770
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 98 additions & 99 deletions
Large diffs are not rendered by default.

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ ignore = [
7373
{ id = "RUSTSEC-2020-0168", reason = "There is no suitable replacement for mach and the mach2 crate has not been vetted." },
7474
{ id = "RUSTSEC-2024-0336", reason = "Only use of [email protected] is in futures-rustls which does not use the effected code" },
7575
{ id = "RUSTSEC-2024-0344", reason = "We are only able to remove this once parity updates its dependencies. Older versions of curve25519-dalek should get replaces with >= 4.1.3" },
76+
{ id = "RUSTSEC-2022-0093", reason = "The vulnerable code is not exploitable in Frequency because the signing function is not exposed in a way that allows the use of arbitrary public keys, ensuring protection against the described vulnerability." },
7677
]
7778
# If this is true, then cargo deny will use the git executable to fetch advisory database.
7879
# If this is false, then it uses a built-in git library.

e2e/capacity/capacity_rpc.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('Capacity RPC', function () {
7070
assert.notEqual(feeDetails.inclusionFee, undefined, 'should have returned a partialFee');
7171
assert(feeDetails.inclusionFee.isSome, 'should have returned a partialFee');
7272
const { baseFee, lenFee, adjustedWeightFee } = feeDetails.inclusionFee.toJSON() as any;
73-
const baseFeeSnapshot = 177812;
73+
const baseFeeSnapshot = 124103;
7474
assert(
7575
Math.abs(baseFee - baseFeeSnapshot) < 50_000,
7676
'The base fee appears to be wrong or have changed more than expected'

node/cli/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sp-inherents = { workspace = true }
4848
sp-keyring = { workspace = true }
4949
sp-runtime = { workspace = true }
5050
sp-timestamp = { workspace = true }
51-
try-runtime-cli = { workspace = true, optional = true }
51+
5252
# Polkadot
5353
polkadot-cli = { workspace = true }
5454
polkadot-parachain-primitives = { workspace = true }
@@ -73,7 +73,6 @@ cli = [
7373
"sc-service",
7474
"frame-benchmarking-cli",
7575
"frame-benchmarking",
76-
"try-runtime-cli",
7776
]
7877
default = ["std", "cli"]
7978
runtime-benchmarks = [
@@ -85,7 +84,6 @@ runtime-benchmarks = [
8584
]
8685
try-runtime = [
8786
"frequency-service/try-runtime",
88-
"try-runtime-cli/try-runtime",
8987
"sp-runtime/try-runtime"
9088
]
9189
on-chain-release-build = ["sp-api/disable-logging"]

node/cli/src/command.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ pub fn run() -> Result<()> {
340340
BenchmarkCmd::Pallet(cmd) =>
341341
if cfg!(feature = "runtime-benchmarks") {
342342
runner.sync_run(|config| {
343-
cmd.run::<HashingFor<Block>, ReclaimHostFunctions>(config)
343+
cmd.run_with_spec::<HashingFor<Block>, ReclaimHostFunctions>(Some(
344+
config.chain_spec,
345+
))
344346
})
345347
} else {
346348
return Err("Benchmarking wasn't enabled when building the node. \

node/cli/src/run_as_localchain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use crate::cli::Cli;
2-
use frequency_service::block_sealing::frequency_dev_sealing;
2+
use frequency_service::block_sealing::start_frequency_dev_sealing_node;
33
use sc_cli::SubstrateCli;
44

55
pub fn run_as_localchain(cli: Cli) -> sc_service::Result<(), sc_cli::Error> {
66
let runner = cli.create_runner(&cli.run.normalize())?;
77

88
runner.run_node_until_exit(|config| async move {
9-
frequency_dev_sealing(
9+
start_frequency_dev_sealing_node(
1010
config,
1111
cli.sealing,
1212
u16::from(cli.sealing_interval),

node/cli/src/run_as_parachain.rs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,39 @@ use cumulus_primitives_core::ParaId;
33
use frequency_service::chain_spec;
44
use log::info;
55
use sc_cli::SubstrateCli;
6-
use sp_runtime::traits::AccountIdConversion;
76

87
pub fn run_as_parachain(cli: Cli) -> sc_service::Result<(), sc_cli::Error> {
98
let runner = cli.create_runner(&cli.run.normalize())?;
9+
let collator_options = cli.run.collator_options();
10+
1011
runner.run_node_until_exit(|config| async move {
12+
let hwbench = (!cli.no_hardware_benchmarks)
13+
.then_some(config.database.path().map(|database_path| {
14+
let _ = std::fs::create_dir_all(database_path);
15+
sc_sysinfo::gather_hwbench(Some(database_path))
16+
}))
17+
.flatten();
18+
1119
let para_id = chain_spec::Extensions::try_get(&*config.chain_spec)
12-
.map(|e| e.para_id)
20+
.map(|e: &chain_spec::Extensions| e.para_id)
1321
.ok_or("Could not find parachain ID in chain-spec.")?;
14-
let id = ParaId::from(para_id);
15-
16-
let parachain_account =
17-
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(&id);
1822

19-
info!("Parachain id: {:?}", id);
20-
info!("Parachain Account: {}", parachain_account);
21-
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });
22-
23-
let tokio_handle = config.tokio_handle.clone();
2423
let polkadot_cli = RelayChainCli::new(
2524
&config,
2625
[RelayChainCli::executable_name()].iter().chain(cli.relay_chain_args.iter()),
2726
);
27+
28+
let id = ParaId::from(para_id);
29+
30+
let tokio_handle = config.tokio_handle.clone();
31+
2832
let polkadot_config =
2933
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, tokio_handle)
3034
.map_err(|err| format!("Relay chain argument error: {}", err))?;
3135

32-
let collator_options = cli.run.collator_options();
33-
let hwbench = if !cli.no_hardware_benchmarks {
34-
config.database.path().map(|database_path| {
35-
let _ = std::fs::create_dir_all(&database_path);
36-
sc_sysinfo::gather_hwbench(Some(database_path))
37-
})
38-
} else {
39-
None
40-
};
36+
info!("Parachain id: {:?}", id);
37+
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });
38+
4139
return frequency_service::service::start_parachain_node(
4240
config,
4341
polkadot_config,

node/service/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ sp-wasm-interface = { workspace = true }
7373

7474
substrate-frame-rpc-system = { workspace = true }
7575
substrate-prometheus-endpoint = { workspace = true }
76-
try-runtime-cli = { workspace = true }
76+
7777
# Polkadot
7878
polkadot-cli = { workspace = true }
7979
polkadot-primitives = { workspace = true }

node/service/src/block_sealing.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use cli_opt::SealingMode;
33
pub use futures::stream::StreamExt;
44
use sc_consensus::block_import::BlockImport;
55

6+
use common_primitives::node::{Block, Hash};
67
use core::marker::PhantomData;
78
use futures::Stream;
89
use sc_client_api::backend::{Backend as ClientBackend, Finalizer};
@@ -11,19 +12,20 @@ use sc_consensus_manual_seal::{
1112
};
1213

1314
use futures::FutureExt;
15+
use sc_network::NetworkBackend;
1416
use sc_service::{Configuration, TaskManager};
1517
use sc_transaction_pool_api::{OffchainTransactionPoolFactory, TransactionPool};
1618
use sp_api::ProvideRuntimeApi;
1719
use sp_blockchain::HeaderBackend;
1820
use sp_consensus::{Environment, Proposer, SelectChain};
1921
use sp_inherents::CreateInherentDataProviders;
2022
use sp_runtime::traits::Block as BlockT;
21-
use std::task::Poll;
23+
use std::{sync::Arc, task::Poll};
2224

2325
/// Function to start Frequency in dev mode without a relay chain
2426
/// This function is called when --chain dev --sealing= is passed.
2527
#[allow(clippy::expect_used)]
26-
pub fn frequency_dev_sealing(
28+
pub fn start_frequency_dev_sealing_node(
2729
config: Configuration,
2830
sealing_mode: SealingMode,
2931
sealing_interval: u16,
@@ -36,8 +38,11 @@ pub fn frequency_dev_sealing(
3638
};
3739
log::info!("📎 Development mode (no relay chain) with {} sealing{}", sealing_mode, extra);
3840

39-
let net_config: sc_network::config::FullNetworkConfiguration =
40-
sc_network::config::FullNetworkConfiguration::new(&config.network);
41+
let net_config = sc_network::config::FullNetworkConfiguration::<
42+
_,
43+
_,
44+
sc_network::NetworkWorker<Block, Hash>,
45+
>::new(&config.network);
4146
let sc_service::PartialComponents {
4247
client,
4348
backend,
@@ -48,6 +53,9 @@ pub fn frequency_dev_sealing(
4853
transaction_pool,
4954
other: (_block_import, mut telemetry, _),
5055
} = new_partial(&config, true)?;
56+
let metrics = sc_network::NetworkWorker::<Block, Hash>::register_notification_metrics(
57+
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
58+
);
5159

5260
// Build the network components required for the blockchain.
5361
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
@@ -61,6 +69,7 @@ pub fn frequency_dev_sealing(
6169
block_announce_validator_builder: None,
6270
warp_sync_params: None,
6371
block_relay: None,
72+
metrics,
6473
})?;
6574

6675
// Start off-chain workers if enabled
@@ -75,7 +84,7 @@ pub fn frequency_dev_sealing(
7584
transaction_pool: Some(OffchainTransactionPoolFactory::new(
7685
transaction_pool.clone(),
7786
)),
78-
network_provider: network.clone(),
87+
network_provider: Arc::new(network.clone()),
7988
enable_http_requests: true,
8089
custom_extensions: |_| vec![],
8190
});

node/service/src/chain_spec/frequency_dev.rs

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,46 +33,11 @@ pub fn development_config() -> ChainSpec {
3333
.with_chain_type(ChainType::Development)
3434
.with_protocol_id("dev")
3535
.with_genesis_config(development_genesis(
36-
// initial collators.
37-
vec![
38-
(
39-
get_account_id_from_seed::<sr25519::Public>("Alice"),
40-
get_collator_keys_from_seed("Alice"),
41-
),
42-
(
43-
get_account_id_from_seed::<sr25519::Public>("Bob"),
44-
get_collator_keys_from_seed("Bob"),
45-
),
46-
],
47-
// Sudo
48-
Some(get_account_id_from_seed::<sr25519::Public>("Alice")),
49-
// Endowed Accounts
50-
vec![
51-
get_account_id_from_seed::<sr25519::Public>("Alice"),
52-
get_account_id_from_seed::<sr25519::Public>("Bob"),
53-
get_account_id_from_seed::<sr25519::Public>("Charlie"),
54-
get_account_id_from_seed::<sr25519::Public>("Dave"),
55-
get_account_id_from_seed::<sr25519::Public>("Eve"),
56-
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
57-
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
58-
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
59-
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
60-
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
61-
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
62-
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
63-
common_runtime::constants::TREASURY_PALLET_ID.into_account_truncating(),
64-
],
65-
// Council members
66-
vec![
67-
get_account_id_from_seed::<sr25519::Public>("Alice"),
68-
get_account_id_from_seed::<sr25519::Public>("Charlie"),
69-
get_account_id_from_seed::<sr25519::Public>("Eve"),
70-
],
71-
// Technical Committee members
72-
vec![
73-
get_account_id_from_seed::<sr25519::Public>("Bob"),
74-
get_account_id_from_seed::<sr25519::Public>("Dave"),
75-
],
36+
development_invulnerables(),
37+
development_root(),
38+
development_endowed_accounts(),
39+
development_council_members(),
40+
development_technical_committee_members(),
7641
// ParaId
7742
1000.into(),
7843
))
@@ -94,7 +59,7 @@ fn load_genesis_schemas() -> Vec<frequency_runtime::pallet_schemas::GenesisSchem
9459
#[allow(clippy::unwrap_used)]
9560
fn development_genesis(
9661
invulnerables: Vec<(AccountId, AuraId)>,
97-
root_key: Option<AccountId>,
62+
root_key: AccountId,
9863
endowed_accounts: Vec<AccountId>,
9964
council_members: Vec<AccountId>,
10065
technical_committee_members: Vec<AccountId>,
@@ -134,7 +99,7 @@ fn development_genesis(
13499
parachain_system: Default::default(),
135100
sudo: SudoConfig {
136101
// Assign network admin rights.
137-
key: root_key,
102+
key: Some(root_key),
138103
},
139104
schemas: frequency_runtime::pallet_schemas::GenesisConfig {
140105
initial_schemas: load_genesis_schemas(),
@@ -152,3 +117,50 @@ fn development_genesis(
152117

153118
serde_json::to_value(&genesis).unwrap()
154119
}
120+
121+
fn development_endowed_accounts() -> Vec<AccountId> {
122+
vec![
123+
get_account_id_from_seed::<sr25519::Public>("Alice"),
124+
get_account_id_from_seed::<sr25519::Public>("Bob"),
125+
get_account_id_from_seed::<sr25519::Public>("Charlie"),
126+
get_account_id_from_seed::<sr25519::Public>("Dave"),
127+
get_account_id_from_seed::<sr25519::Public>("Eve"),
128+
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
129+
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
130+
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
131+
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
132+
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
133+
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
134+
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
135+
common_runtime::constants::TREASURY_PALLET_ID.into_account_truncating(),
136+
]
137+
}
138+
139+
fn development_invulnerables() -> Vec<(AccountId, AuraId)> {
140+
vec![
141+
(
142+
get_account_id_from_seed::<sr25519::Public>("Alice"),
143+
get_collator_keys_from_seed("Alice"),
144+
),
145+
(get_account_id_from_seed::<sr25519::Public>("Bob"), get_collator_keys_from_seed("Bob")),
146+
]
147+
}
148+
149+
fn development_root() -> AccountId {
150+
get_account_id_from_seed::<sr25519::Public>("Alice")
151+
}
152+
153+
fn development_council_members() -> Vec<AccountId> {
154+
vec![
155+
get_account_id_from_seed::<sr25519::Public>("Alice"),
156+
get_account_id_from_seed::<sr25519::Public>("Charlie"),
157+
get_account_id_from_seed::<sr25519::Public>("Eve"),
158+
]
159+
}
160+
161+
fn development_technical_committee_members() -> Vec<AccountId> {
162+
vec![
163+
get_account_id_from_seed::<sr25519::Public>("Bob"),
164+
get_account_id_from_seed::<sr25519::Public>("Dave"),
165+
]
166+
}

0 commit comments

Comments
 (0)