Skip to content

Commit 545a095

Browse files
chore: upgrade to stable2409 (and stable2407) (#234)
Co-authored-by: Daanvdplas <[email protected]> Co-authored-by: Daan van der Plas <[email protected]>
1 parent c6ad126 commit 545a095

File tree

34 files changed

+6209
-3699
lines changed

34 files changed

+6209
-3699
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 118 additions & 116 deletions
Large diffs are not rendered by default.

extension/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ std = [
5353
"pallet-balances/std",
5454
"pallet-contracts/std",
5555
"pallet-timestamp/std",
56+
"scale-info/std",
5657
"sp-core/std",
5758
"sp-io/std",
5859
"sp-runtime/std",

extension/src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ impl pallet_contracts::Config for Test {
101101
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
102102
type MaxDelegateDependencies = MaxDelegateDependencies;
103103
type MaxStorageKeyLen = ConstU32<128>;
104+
type MaxTransientStorageSize = ConstU32<{ 1024 * 1024 }>;
104105
type Migrations = ();
105106
// crate::migration::codegen::BenchMigrations;
106107
type Randomness = Test;

integration-tests/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ runtime-benchmarks = [
7070
"pallet-assets/runtime-benchmarks",
7171
"pallet-balances/runtime-benchmarks",
7272
"pallet-message-queue/runtime-benchmarks",
73+
"pallet-xcm/runtime-benchmarks",
7374
"paseo-runtime?/runtime-benchmarks",
7475
"polkadot-primitives/runtime-benchmarks",
76+
"polkadot-runtime-parachains/runtime-benchmarks",
7577
"pop-runtime-common/runtime-benchmarks",
7678
"pop-runtime-devnet/runtime-benchmarks",
7779
"pop-runtime-mainnet/runtime-benchmarks",
@@ -82,6 +84,8 @@ runtime-benchmarks = [
8284
std = [
8385
"asset-hub-paseo-runtime?/std",
8486
"asset-hub-westend-runtime?/std",
87+
"asset-test-utils/std",
88+
"codec/std",
8589
"cumulus-primitives-core/std",
8690
"frame-support/std",
8791
"pallet-assets/std",
@@ -102,6 +106,7 @@ std = [
102106
"sp-consensus-grandpa/std",
103107
"sp-core/std",
104108
"sp-runtime/std",
109+
"tracing-subscriber/std",
105110
"westend-runtime-constants?/std",
106111
"westend-runtime?/std",
107112
"xcm-executor/std",

integration-tests/src/chains/asset_hub/genesis.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pub(crate) fn genesis() -> Storage {
4242
)
4343
})
4444
.collect(),
45+
..Default::default()
4546
},
4647
polkadot_xcm: PolkadotXcmConfig {
4748
safe_xcm_version: Some(SAFE_XCM_VERSION),

integration-tests/src/chains/asset_hub/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ decl_test_parachains! {
3838
impl_accounts_helpers_for_parachain!(AssetHub);
3939
impl_assert_events_helpers_for_parachain!(AssetHub);
4040
impl_assets_helpers_for_parachain!(AssetHub);
41-
impl_foreign_assets_helpers_for_parachain!(AssetHub, xcm::v3::Location);
41+
impl_foreign_assets_helpers_for_parachain!(AssetHub, xcm::v4::Location);
4242
impl_xcm_helpers_for_parachain!(AssetHub);

integration-tests/src/chains/pop_network/genesis.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub(crate) fn genesis() -> Storage {
3131
)
3232
})
3333
.collect(),
34+
..Default::default()
3435
},
3536
polkadot_xcm: runtime::PolkadotXcmConfig {
3637
safe_xcm_version: Some(SAFE_XCM_VERSION),

integration-tests/src/chains/relay/genesis.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub(crate) fn genesis() -> Storage {
4343
)
4444
})
4545
.collect::<Vec<_>>(),
46+
..Default::default()
4647
},
4748
babe: BabeConfig {
4849
authorities: Default::default(),

node/Cargo.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ version = "0.2.0-alpha"
1313
[dependencies]
1414
clap.workspace = true
1515
codec.workspace = true
16+
docify.workspace = true
1617
futures.workspace = true
1718
jsonrpsee = { workspace = true, features = [ "server" ] }
1819
log.workspace = true
@@ -51,6 +52,7 @@ sp-block-builder.workspace = true
5152
sp-blockchain.workspace = true
5253
sp-consensus-aura.workspace = true
5354
sp-core.workspace = true
55+
sp-genesis-builder = { workspace = true, default-features = true }
5456
sp-io.workspace = true
5557
sp-keystore.workspace = true
5658
sp-offchain.workspace = true
@@ -92,6 +94,7 @@ substrate-build-script-utils.workspace = true
9294
pallet-multisig.workspace = true
9395

9496
[features]
97+
default = [ "std" ]
9598
runtime-benchmarks = [
9699
"cumulus-primitives-core/runtime-benchmarks",
97100
"frame-benchmarking-cli/runtime-benchmarks",
@@ -105,6 +108,32 @@ runtime-benchmarks = [
105108
"sc-service/runtime-benchmarks",
106109
"sp-runtime/runtime-benchmarks",
107110
]
111+
std = [
112+
"codec/std",
113+
"cumulus-primitives-aura/std",
114+
"cumulus-primitives-core/std",
115+
"frame-benchmarking/std",
116+
"ismp-parachain-runtime-api/std",
117+
"ismp-parachain/std",
118+
"log/std",
119+
"pallet-ismp-runtime-api/std",
120+
"pallet-multisig/std",
121+
"polkadot-primitives/std",
122+
"pop-runtime-common/std",
123+
"pop-runtime-devnet/std",
124+
"pop-runtime-mainnet/std",
125+
"pop-runtime-testnet/std",
126+
"sp-api/std",
127+
"sp-block-builder/std",
128+
"sp-consensus-aura/std",
129+
"sp-core/std",
130+
"sp-io/std",
131+
"sp-offchain/std",
132+
"sp-runtime/std",
133+
"sp-session/std",
134+
"sp-transaction-pool/std",
135+
"xcm/std",
136+
]
108137
try-runtime = [
109138
"polkadot-cli/try-runtime",
110139
"pop-runtime-devnet/try-runtime",

node/src/command.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{net::SocketAddr, path::PathBuf};
1+
use std::path::PathBuf;
22

33
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
44
use cumulus_primitives_core::ParaId;
@@ -7,7 +7,7 @@ use log::info;
77
use pop_runtime_common::Block;
88
use sc_cli::{
99
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
10-
NetworkParams, Result, SharedParams, SubstrateCli,
10+
NetworkParams, Result, RpcEndpoint, SharedParams, SubstrateCli,
1111
};
1212
use sc_service::config::{BasePath, PrometheusConfig};
1313
use sp_runtime::traits::HashingFor;
@@ -348,7 +348,10 @@ pub fn run() -> Result<()> {
348348
let hwbench = (!cli.no_hardware_benchmarks)
349349
.then_some(config.database.path().map(|database_path| {
350350
let _ = std::fs::create_dir_all(database_path);
351-
sc_sysinfo::gather_hwbench(Some(database_path))
351+
sc_sysinfo::gather_hwbench(
352+
Some(database_path),
353+
&SUBSTRATE_REFERENCE_HARDWARE,
354+
)
352355
}))
353356
.flatten();
354357

@@ -470,7 +473,7 @@ impl CliConfiguration<Self> for RelayChainCli {
470473
.or_else(|| self.base_path.clone().map(Into::into)))
471474
}
472475

473-
fn rpc_addr(&self, default_listen_port: u16) -> Result<Option<SocketAddr>> {
476+
fn rpc_addr(&self, default_listen_port: u16) -> Result<Option<Vec<RpcEndpoint>>> {
474477
self.base.base.rpc_addr(default_listen_port)
475478
}
476479

@@ -482,15 +485,9 @@ impl CliConfiguration<Self> for RelayChainCli {
482485
self.base.base.prometheus_config(default_listen_port, chain_spec)
483486
}
484487

485-
fn init<F>(
486-
&self,
487-
_support_url: &String,
488-
_impl_version: &String,
489-
_logger_hook: F,
490-
_config: &sc_service::Configuration,
491-
) -> Result<()>
488+
fn init<F>(&self, _support_url: &String, _impl_version: &String, _logger_hook: F) -> Result<()>
492489
where
493-
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
490+
F: FnOnce(&mut sc_cli::LoggerBuilder),
494491
{
495492
unreachable!("PolkadotCli is never initialized; qed");
496493
}

node/src/rpc.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::sync::Arc;
1010
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
1111
use pop_runtime_common::{AccountId, Balance, Block, Nonce};
1212
use sc_client_api::{AuxStore, BlockBackend, ProofProvider};
13-
pub use sc_rpc::DenyUnsafe;
1413
use sc_transaction_pool_api::TransactionPool;
1514
use sp_api::ProvideRuntimeApi;
1615
use sp_block_builder::BlockBuilder;
@@ -28,8 +27,6 @@ pub struct FullDeps<C, P, B> {
2827
pub client: Arc<C>,
2928
/// Transaction pool instance.
3029
pub pool: Arc<P>,
31-
/// Whether to deny unsafe calls
32-
pub deny_unsafe: DenyUnsafe,
3330
/// Backend used by the node.
3431
pub backend: Arc<B>,
3532
}
@@ -57,9 +54,9 @@ where
5754
B::State: sc_client_api::StateBackend<sp_runtime::traits::HashingFor<Block>>,
5855
{
5956
let mut module = RpcExtension::new(());
60-
let FullDeps { client, pool, deny_unsafe, backend: _ } = deps;
57+
let FullDeps { client, pool, backend: _ } = deps;
6158

62-
module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
59+
module.merge(System::new(client.clone(), pool).into_rpc())?;
6360
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
6461

6562
Ok(module)
@@ -89,9 +86,9 @@ where
8986
B::State: sc_client_api::StateBackend<sp_runtime::traits::HashingFor<Block>>,
9087
{
9188
let mut module = RpcExtension::new(());
92-
let FullDeps { client, pool, deny_unsafe, backend } = deps;
89+
let FullDeps { client, pool, backend } = deps;
9390

94-
module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
91+
module.merge(System::new(client.clone(), pool).into_rpc())?;
9592
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
9693

9794
use pallet_ismp_rpc::{IsmpApiServer, IsmpRpcHandler};

node/src/service.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ use std::{sync::Arc, time::Duration};
66
use cumulus_client_cli::CollatorOptions;
77
// Cumulus Imports
88
use cumulus_client_collator::service::CollatorService;
9+
#[docify::export(lookahead_collator)]
910
use cumulus_client_consensus_aura::collators::lookahead::{self as aura, Params as AuraParams};
1011
use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport;
1112
use cumulus_client_consensus_proposer::Proposer;
1213
use cumulus_client_service::{
1314
build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks,
1415
BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, StartRelayChainTasksParams,
1516
};
17+
#[docify::export(cumulus_primitives)]
1618
use cumulus_primitives_core::{
1719
relay_chain::{CollatorPair, ValidationCode},
1820
ParaId,
@@ -27,7 +29,6 @@ use sc_client_api::Backend;
2729
use sc_consensus::ImportQueue;
2830
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
2931
use sc_network::NetworkBlock;
30-
use sc_network_sync::SyncingService;
3132
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
3233
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
3334
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
@@ -88,15 +89,16 @@ where
8889
.transpose()?;
8990

9091
let heap_pages = config
92+
.executor
9193
.default_heap_pages
9294
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
9395

9496
let executor = ParachainExecutor::builder()
95-
.with_execution_method(config.wasm_method)
97+
.with_execution_method(config.executor.wasm_method)
9698
.with_onchain_heap_alloc_strategy(heap_pages)
9799
.with_offchain_heap_alloc_strategy(heap_pages)
98-
.with_max_runtime_instances(config.max_runtime_instances)
99-
.with_runtime_cache_size(config.runtime_cache_size)
100+
.with_max_runtime_instances(config.executor.max_runtime_instances)
101+
.with_runtime_cache_size(config.executor.runtime_cache_size)
100102
.build();
101103

102104
let (client, backend, keystore_container, task_manager) =
@@ -169,7 +171,6 @@ where
169171
&TaskManager,
170172
Arc<dyn RelayChainInterface>,
171173
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
172-
Arc<SyncingService<Block>>,
173174
KeystorePtr,
174175
Duration,
175176
ParaId,
@@ -182,11 +183,13 @@ where
182183

183184
let params = new_partial::<RuntimeApi>(&parachain_config)?;
184185
let (block_import, mut telemetry, telemetry_worker_handle) = params.other;
186+
187+
let prometheus_registry = parachain_config.prometheus_registry().cloned();
185188
let net_config = sc_network::config::FullNetworkConfiguration::<
186189
_,
187190
_,
188191
sc_network::NetworkWorker<Block, Hash>,
189-
>::new(&parachain_config.network);
192+
>::new(&parachain_config.network, prometheus_registry.clone());
190193

191194
let client = params.client.clone();
192195
let backend = params.backend.clone();
@@ -204,7 +207,6 @@ where
204207
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
205208

206209
let validator = parachain_config.role.is_authority();
207-
let prometheus_registry = parachain_config.prometheus_registry().cloned();
208210
let transaction_pool = params.transaction_pool.clone();
209211
let import_queue_service = params.import_queue.service();
210212

@@ -250,12 +252,11 @@ where
250252
let backend = backend.clone();
251253
let transaction_pool = transaction_pool.clone();
252254

253-
Box::new(move |deny_unsafe, _| {
255+
Box::new(move |_| {
254256
let deps = crate::rpc::FullDeps {
255257
client: client.clone(),
256258
pool: transaction_pool.clone(),
257259
backend: backend.clone(),
258-
deny_unsafe,
259260
};
260261

261262
crate::rpc::create_full(deps).map_err(Into::into)
@@ -282,7 +283,7 @@ where
282283
// Here you can check whether the hardware meets your chains' requirements. Putting a link
283284
// in there and swapping out the requirements for your own are probably a good idea. The
284285
// requirements for a para-chain are dictated by its relay-chain.
285-
if SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench).is_err() && validator {
286+
if SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench, false).is_err() && validator {
286287
log::warn!(
287288
"⚠️ The hardware does not meet the minimal requirements for role 'Authority'."
288289
);
@@ -336,7 +337,6 @@ where
336337
&task_manager,
337338
relay_chain_interface,
338339
transaction_pool,
339-
sync_service,
340340
params.keystore_container.keystore(),
341341
relay_chain_slot_duration,
342342
para_id,
@@ -393,7 +393,6 @@ fn start_consensus<RuntimeApi>(
393393
task_manager: &TaskManager,
394394
relay_chain_interface: Arc<dyn RelayChainInterface>,
395395
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
396-
sync_oracle: Arc<SyncingService<Block>>,
397396
keystore: KeystorePtr,
398397
relay_chain_slot_duration: Duration,
399398
para_id: ParaId,
@@ -455,7 +454,6 @@ where
455454
code_hash_provider: move |block_hash| {
456455
client.code_at(block_hash).ok().map(|c| ValidationCode::from(c).hash())
457456
},
458-
sync_oracle,
459457
keystore,
460458
collator_key,
461459
para_id,
@@ -467,10 +465,9 @@ where
467465
reinitialize: false,
468466
};
469467

470-
let fut =
471-
aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _, _, _, _>(
472-
params,
473-
);
468+
let fut = aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _, _, _>(
469+
params,
470+
);
474471
task_manager.spawn_essential_handle().spawn("aura", None, fut);
475472

476473
Ok(())

pallets/api/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ std = [
4545
"frame-benchmarking/std",
4646
"frame-support/std",
4747
"frame-system/std",
48+
"log/std",
4849
"pallet-assets/std",
4950
"pallet-balances/std",
5051
"pop-chain-extension/std",

pallets/api/src/fungibles/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use codec::Encode;
22
use frame_support::{
33
assert_noop, assert_ok,
44
dispatch::WithPostDispatchInfo,
5-
sp_runtime::{traits::Zero, DispatchError::BadOrigin},
5+
sp_runtime::{traits::Zero, DispatchError::BadOrigin, TokenError},
66
traits::fungibles::{
77
approvals::Inspect as ApprovalInspect, metadata::Inspect as MetadataInspect, Inspect,
88
},
@@ -341,7 +341,7 @@ fn start_destroy_works() {
341341
// Check that the token is not live after starting the destroy process.
342342
assert_noop!(
343343
Assets::mint(signed(ALICE), token, ALICE, 10 * UNIT),
344-
AssetsError::AssetNotLive
344+
TokenError::UnknownAsset
345345
);
346346
});
347347
}

pop-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version = "0.0.0"
88
[dependencies]
99
ink = { version = "5.1.0", default-features = false }
1010
pop-primitives = { path = "../primitives", default-features = false }
11-
sp-io = { version = "37.0.0", default-features = false, features = [
11+
sp-io = { version = "38.0.0", default-features = false, features = [
1212
"disable_allocator",
1313
"disable_oom",
1414
"disable_panic_handler",

0 commit comments

Comments
 (0)