Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to stable2407 #234

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,247 changes: 5,808 additions & 3,439 deletions Cargo.lock

Large diffs are not rendered by default.

234 changes: 118 additions & 116 deletions Cargo.toml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ std = [
"pallet-balances/std",
"pallet-contracts/std",
"pallet-timestamp/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
Expand Down
1 change: 1 addition & 0 deletions extension/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl pallet_contracts::Config for Test {
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
type MaxDelegateDependencies = MaxDelegateDependencies;
type MaxStorageKeyLen = ConstU32<128>;
type MaxTransientStorageSize = ConstU32<{ 1024 * 1024 }>;
type Migrations = ();
// crate::migration::codegen::BenchMigrations;
type Randomness = Test;
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ runtime-benchmarks = [
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"paseo-runtime?/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-runtime-parachains/runtime-benchmarks",
"pop-runtime-common/runtime-benchmarks",
"pop-runtime-devnet/runtime-benchmarks",
"pop-runtime-mainnet/runtime-benchmarks",
Expand All @@ -82,6 +84,8 @@ runtime-benchmarks = [
std = [
"asset-hub-paseo-runtime?/std",
"asset-hub-westend-runtime?/std",
"asset-test-utils/std",
"codec/std",
"cumulus-primitives-core/std",
"frame-support/std",
"pallet-assets/std",
Expand All @@ -102,6 +106,7 @@ std = [
"sp-consensus-grandpa/std",
"sp-core/std",
"sp-runtime/std",
"tracing-subscriber/std",
"westend-runtime-constants?/std",
"westend-runtime?/std",
"xcm-executor/std",
Expand Down
1 change: 1 addition & 0 deletions integration-tests/src/chains/asset_hub/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub(crate) fn genesis() -> Storage {
)
})
.collect(),
..Default::default()
},
polkadot_xcm: PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/src/chains/asset_hub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ decl_test_parachains! {
impl_accounts_helpers_for_parachain!(AssetHub);
impl_assert_events_helpers_for_parachain!(AssetHub);
impl_assets_helpers_for_parachain!(AssetHub);
impl_foreign_assets_helpers_for_parachain!(AssetHub, xcm::v3::Location);
impl_foreign_assets_helpers_for_parachain!(AssetHub, xcm::v4::Location);
impl_xcm_helpers_for_parachain!(AssetHub);
1 change: 1 addition & 0 deletions integration-tests/src/chains/pop_network/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub(crate) fn genesis() -> Storage {
)
})
.collect(),
..Default::default()
},
polkadot_xcm: runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
Expand Down
1 change: 1 addition & 0 deletions integration-tests/src/chains/relay/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub(crate) fn genesis() -> Storage {
)
})
.collect::<Vec<_>>(),
..Default::default()
},
babe: BabeConfig {
authorities: Default::default(),
Expand Down
29 changes: 29 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ version = "0.2.0-alpha"
[dependencies]
clap.workspace = true
codec.workspace = true
docify.workspace = true
futures.workspace = true
jsonrpsee = { workspace = true, features = [ "server" ] }
log.workspace = true
Expand Down Expand Up @@ -51,6 +52,7 @@ sp-block-builder.workspace = true
sp-blockchain.workspace = true
sp-consensus-aura.workspace = true
sp-core.workspace = true
sp-genesis-builder = { workspace = true, default-features = true }
sp-io.workspace = true
sp-keystore.workspace = true
sp-offchain.workspace = true
Expand Down Expand Up @@ -92,6 +94,7 @@ substrate-build-script-utils.workspace = true
pallet-multisig.workspace = true

[features]
default = [ "std" ]
runtime-benchmarks = [
"cumulus-primitives-core/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
Expand All @@ -105,6 +108,32 @@ runtime-benchmarks = [
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
std = [
"codec/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"frame-benchmarking/std",
"ismp-parachain-runtime-api/std",
"ismp-parachain/std",
"log/std",
"pallet-ismp-runtime-api/std",
"pallet-multisig/std",
"polkadot-primitives/std",
"pop-runtime-common/std",
"pop-runtime-devnet/std",
"pop-runtime-mainnet/std",
"pop-runtime-testnet/std",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-io/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-transaction-pool/std",
"xcm/std",
]
try-runtime = [
"polkadot-cli/try-runtime",
"pop-runtime-devnet/try-runtime",
Expand Down
21 changes: 9 additions & 12 deletions node/src/command.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{net::SocketAddr, path::PathBuf};
use std::path::PathBuf;

use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
use cumulus_primitives_core::ParaId;
Expand All @@ -7,7 +7,7 @@ use log::info;
use pop_runtime_common::Block;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, SharedParams, SubstrateCli,
NetworkParams, Result, RpcEndpoint, SharedParams, SubstrateCli,
};
use sc_service::config::{BasePath, PrometheusConfig};
use sp_runtime::traits::HashingFor;
Expand Down Expand Up @@ -348,7 +348,10 @@ pub fn run() -> Result<()> {
let hwbench = (!cli.no_hardware_benchmarks)
.then_some(config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
sc_sysinfo::gather_hwbench(
Some(database_path),
&SUBSTRATE_REFERENCE_HARDWARE,
)
}))
.flatten();

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

fn rpc_addr(&self, default_listen_port: u16) -> Result<Option<SocketAddr>> {
fn rpc_addr(&self, default_listen_port: u16) -> Result<Option<Vec<RpcEndpoint>>> {
self.base.base.rpc_addr(default_listen_port)
}

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

fn init<F>(
&self,
_support_url: &String,
_impl_version: &String,
_logger_hook: F,
_config: &sc_service::Configuration,
) -> Result<()>
fn init<F>(&self, _support_url: &String, _impl_version: &String, _logger_hook: F) -> Result<()>
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
F: FnOnce(&mut sc_cli::LoggerBuilder),
{
unreachable!("PolkadotCli is never initialized; qed");
}
Expand Down
11 changes: 4 additions & 7 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use pop_runtime_common::{AccountId, Balance, Block, Nonce};
use sc_client_api::{AuxStore, BlockBackend, ProofProvider};
pub use sc_rpc::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
Expand All @@ -28,10 +27,8 @@
pub client: Arc<C>,
/// Transaction pool instance.
pub pool: Arc<P>,
/// Whether to deny unsafe calls
pub deny_unsafe: DenyUnsafe,
/// Backend used by the node.
pub backend: Arc<B>,

Check warning on line 31 in node/src/rpc.rs

View workflow job for this annotation

GitHub Actions / clippy

field `backend` is never read

warning: field `backend` is never read --> node/src/rpc.rs:31:6 | 25 | pub struct FullDeps<C, P, B> { | -------- field in this struct ... 31 | pub backend: Arc<B>, | ^^^^^^^ | = note: `#[warn(dead_code)]` on by default
}

/// Instantiate all RPC extensions.
Expand All @@ -57,9 +54,9 @@
B::State: sc_client_api::StateBackend<sp_runtime::traits::HashingFor<Block>>,
{
let mut module = RpcExtension::new(());
let FullDeps { client, pool, deny_unsafe, backend: _ } = deps;
let FullDeps { client, pool, backend: _ } = deps;

module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(System::new(client.clone(), pool).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;

Ok(module)
Expand Down Expand Up @@ -89,9 +86,9 @@
B::State: sc_client_api::StateBackend<sp_runtime::traits::HashingFor<Block>>,
{
let mut module = RpcExtension::new(());
let FullDeps { client, pool, deny_unsafe, backend } = deps;
let FullDeps { client, pool, backend } = deps;

module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(System::new(client.clone(), pool).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;

use pallet_ismp_rpc::{IsmpApiServer, IsmpRpcHandler};
Expand Down
31 changes: 14 additions & 17 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ use std::{sync::Arc, time::Duration};
use cumulus_client_cli::CollatorOptions;
// Cumulus Imports
use cumulus_client_collator::service::CollatorService;
#[docify::export(lookahead_collator)]
use cumulus_client_consensus_aura::collators::lookahead::{self as aura, Params as AuraParams};
use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport;
use cumulus_client_consensus_proposer::Proposer;
use cumulus_client_service::{
build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks,
BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, StartRelayChainTasksParams,
};
#[docify::export(cumulus_primitives)]
use cumulus_primitives_core::{
relay_chain::{CollatorPair, ValidationCode},
ParaId,
Expand All @@ -27,7 +29,6 @@ use sc_client_api::Backend;
use sc_consensus::ImportQueue;
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
use sc_network::NetworkBlock;
use sc_network_sync::SyncingService;
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
Expand Down Expand Up @@ -88,15 +89,16 @@ where
.transpose()?;

let heap_pages = config
.executor
.default_heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });

let executor = ParachainExecutor::builder()
.with_execution_method(config.wasm_method)
.with_execution_method(config.executor.wasm_method)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.with_max_runtime_instances(config.max_runtime_instances)
.with_runtime_cache_size(config.runtime_cache_size)
.with_max_runtime_instances(config.executor.max_runtime_instances)
.with_runtime_cache_size(config.executor.runtime_cache_size)
.build();

let (client, backend, keystore_container, task_manager) =
Expand Down Expand Up @@ -169,7 +171,6 @@ where
&TaskManager,
Arc<dyn RelayChainInterface>,
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
Arc<SyncingService<Block>>,
KeystorePtr,
Duration,
ParaId,
Expand All @@ -182,11 +183,13 @@ where

let params = new_partial::<RuntimeApi>(&parachain_config)?;
let (block_import, mut telemetry, telemetry_worker_handle) = params.other;

let prometheus_registry = parachain_config.prometheus_registry().cloned();
let net_config = sc_network::config::FullNetworkConfiguration::<
_,
_,
sc_network::NetworkWorker<Block, Hash>,
>::new(&parachain_config.network);
>::new(&parachain_config.network, prometheus_registry.clone());

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

let validator = parachain_config.role.is_authority();
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let transaction_pool = params.transaction_pool.clone();
let import_queue_service = params.import_queue.service();

Expand Down Expand Up @@ -250,12 +252,11 @@ where
let backend = backend.clone();
let transaction_pool = transaction_pool.clone();

Box::new(move |deny_unsafe, _| {
Box::new(move |_| {
let deps = crate::rpc::FullDeps {
client: client.clone(),
pool: transaction_pool.clone(),
backend: backend.clone(),
deny_unsafe,
};

crate::rpc::create_full(deps).map_err(Into::into)
Expand All @@ -282,7 +283,7 @@ where
// Here you can check whether the hardware meets your chains' requirements. Putting a link
// in there and swapping out the requirements for your own are probably a good idea. The
// requirements for a para-chain are dictated by its relay-chain.
if SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench).is_err() && validator {
if SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench, false).is_err() && validator {
log::warn!(
"⚠️ The hardware does not meet the minimal requirements for role 'Authority'."
);
Expand Down Expand Up @@ -336,7 +337,6 @@ where
&task_manager,
relay_chain_interface,
transaction_pool,
sync_service,
params.keystore_container.keystore(),
relay_chain_slot_duration,
para_id,
Expand Down Expand Up @@ -393,7 +393,6 @@ fn start_consensus<RuntimeApi>(
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
sync_oracle: Arc<SyncingService<Block>>,
keystore: KeystorePtr,
relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand Down Expand Up @@ -455,7 +454,6 @@ where
code_hash_provider: move |block_hash| {
client.code_at(block_hash).ok().map(|c| ValidationCode::from(c).hash())
},
sync_oracle,
keystore,
collator_key,
para_id,
Expand All @@ -467,10 +465,9 @@ where
reinitialize: false,
};

let fut =
aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _, _, _, _>(
params,
);
let fut = aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _, _, _>(
params,
);
task_manager.spawn_essential_handle().spawn("aura", None, fut);

Ok(())
Expand Down
1 change: 1 addition & 0 deletions pallets/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ std = [
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-assets/std",
"pallet-balances/std",
"pop-chain-extension/std",
Expand Down
4 changes: 2 additions & 2 deletions pallets/api/src/fungibles/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use codec::Encode;
use frame_support::{
assert_noop, assert_ok,
dispatch::WithPostDispatchInfo,
sp_runtime::{traits::Zero, DispatchError::BadOrigin},
sp_runtime::{traits::Zero, DispatchError::BadOrigin, TokenError},
traits::fungibles::{
approvals::Inspect as ApprovalInspect, metadata::Inspect as MetadataInspect, Inspect,
},
Expand Down Expand Up @@ -341,7 +341,7 @@ fn start_destroy_works() {
// Check that the token is not live after starting the destroy process.
assert_noop!(
Assets::mint(signed(ALICE), token, ALICE, 10 * UNIT),
AssetsError::AssetNotLive
TokenError::UnknownAsset
);
});
}
Expand Down
2 changes: 1 addition & 1 deletion pop-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "0.0.0"
[dependencies]
ink = { version = "5.0.0", default-features = false }
pop-primitives = { path = "../primitives", default-features = false }
sp-io = { version = "37.0.0", default-features = false, features = [
sp-io = { version = "38.0.0", default-features = false, features = [
"disable_allocator",
"disable_oom",
"disable_panic_handler",
Expand Down
Loading
Loading