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

polkadot-sdk v1.11.0 uplift #1314

Merged
merged 34 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c8f3723
Update deps - init commit
Dinonard Aug 1, 2024
47be5b6
Local uplift WIP
Dinonard Aug 2, 2024
2e7ff59
Shibuya progress
Dinonard Aug 2, 2024
df1ccc1
mend
Dinonard Aug 2, 2024
6f994c2
Shibuya compiles
Dinonard Aug 2, 2024
b31e299
Changes
Dinonard Aug 5, 2024
3bbb593
Basic compilation
Dinonard Aug 5, 2024
803c3f7
All features compile
Dinonard Aug 5, 2024
d6cbddf
Tests passing
Dinonard Aug 5, 2024
e1a80f2
Integration tests
Dinonard Aug 5, 2024
a091a95
Fix evm-tracing init block code
Dinonard Aug 5, 2024
32b5a6f
Rename to make it consistent with frontier
Dinonard Aug 5, 2024
8288ea1
Remove getters
Dinonard Aug 5, 2024
3ccb618
Fix tests
Dinonard Aug 5, 2024
f5aea69
Resolve issues
Dinonard Aug 5, 2024
d78dd3e
Review comments
Dinonard Aug 6, 2024
dd43285
Minor changes
Dinonard Aug 6, 2024
8f34b00
tracing integration test update
Dinonard Aug 6, 2024
b16f05b
xcm api integration tests wip
Dinonard Aug 6, 2024
59404f0
Finish integration tests
Dinonard Aug 6, 2024
f472e80
Weights
Dinonard Aug 7, 2024
b247cc9
Merge remote-tracking branch 'origin/master' into feat/polkadot-sdk-v…
Dinonard Aug 7, 2024
55a103b
Fixes
Dinonard Aug 7, 2024
37d1e17
Benchmark fixes
Dinonard Aug 7, 2024
bcb5ce0
fixes
Dinonard Aug 7, 2024
2dca9d9
Revert some changes
Dinonard Aug 7, 2024
16aa6eb
Missing migrations, dead code removal
Dinonard Aug 8, 2024
caae7ac
Fix for broken benchmarks
Dinonard Aug 8, 2024
0351ea5
Comments
Dinonard Aug 8, 2024
0cf39aa
Fixes
Dinonard Aug 8, 2024
0aadb7a
Minor fix for xcm-simulator
Dinonard Aug 8, 2024
bbfaff4
weight updates
Dinonard Aug 8, 2024
b3e589a
remove NativeElseWasmExecutor
ermalkaleci Aug 8, 2024
edde0ad
fix benchmarking
ermalkaleci Aug 8, 2024
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
2,235 changes: 1,281 additions & 954 deletions Cargo.lock

Large diffs are not rendered by default.

308 changes: 154 additions & 154 deletions Cargo.toml

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ cumulus-test-relay-sproof-builder = { workspace = true }

# polkadot dependencies
polkadot-cli = { workspace = true, optional = true }
polkadot-core-primitives = { workspace = true }
polkadot-parachain = { workspace = true, features = ["std"] }
polkadot-primitives = { workspace = true, features = ["std"] }
polkadot-service = { workspace = true }
Expand All @@ -139,7 +140,6 @@ polkadot-runtime-common = { workspace = true, features = ["std"], optional = tru

# try-runtime
frame-try-runtime = { workspace = true, features = ["std"], optional = true }
try-runtime-cli = { workspace = true, optional = true }

# evm-tracing
moonbeam-rpc-primitives-debug = { workspace = true, features = ["std"], optional = true }
Expand Down Expand Up @@ -182,10 +182,8 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
]
cli = ["try-runtime-cli"]
try-runtime = [
"local-runtime/try-runtime",
"try-runtime-cli/try-runtime",
"astar-primitives/try-runtime",
"astar-runtime/try-runtime",
"frame-system/try-runtime",
Expand Down
4 changes: 0 additions & 4 deletions bin/collator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ pub enum Subcommand {
#[clap(name = "benchmark", about = "Benchmark runtime pallets.")]
#[clap(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some command against runtime state.
/// No moved to separte cli and just a placeholder command here
TryRuntime,
}

#[derive(Debug)]
Expand Down
23 changes: 9 additions & 14 deletions bin/collator/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,26 +492,26 @@ pub fn run() -> Result<()> {
BenchmarkCmd::Pallet(cmd) => {
if chain_spec.is_astar() {
runner.sync_run(|config| {
cmd.run::<HashingFor<astar_runtime::Block>, parachain::HostFunctions>(
config,
cmd.run_with_spec::<HashingFor<astar_runtime::Block>, parachain::HostFunctions>(
Some(config.chain_spec),
)
})
} else if chain_spec.is_shiden() {
runner.sync_run(|config| {
cmd.run::<HashingFor<shiden_runtime::Block>, parachain::HostFunctions>(
config,
cmd.run_with_spec::<HashingFor<shiden_runtime::Block>, parachain::HostFunctions>(
Some(config.chain_spec),
)
})
} else if chain_spec.is_shibuya() {
runner.sync_run(|config| {
cmd.run::<HashingFor<shibuya_runtime::Block>, parachain::HostFunctions>(
config,
cmd.run_with_spec::<HashingFor<shibuya_runtime::Block>, parachain::HostFunctions>(
Some(config.chain_spec),
)
})
} else {
runner.sync_run(|config| {
cmd.run::<HashingFor<local_runtime::Block>, local::HostFunctions>(
config,
cmd.run_with_spec::<HashingFor<local_runtime::Block>, local::HostFunctions>(
Some(config.chain_spec),
)
})
}
Expand Down Expand Up @@ -775,11 +775,6 @@ pub fn run() -> Result<()> {
}
}
}
Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a \
standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer \
being maintained here and will be removed entirely some time after January 2024. \
Please remove this subcommand from your runtime and use the standalone CLI."
.into()),
None => {
let runner = cli.create_runner(&cli.run.normalize())?;
let collator_options = cli.run.collator_options();
Expand All @@ -798,7 +793,7 @@ pub fn run() -> Result<()> {

runner.run_node_until_exit(|config| async move {
if config.chain_spec.is_dev() {
return local::start_node(config, #[cfg(feature = "evm-tracing")] evm_tracing_config).map_err(Into::into);
return local::start_node::<sc_network::NetworkWorker<_, _>>(config, #[cfg(feature = "evm-tracing")] evm_tracing_config).map_err(Into::into);
}

let polkadot_cli = RelayChainCli::new(
Expand Down
44 changes: 29 additions & 15 deletions bin/collator/src/local/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@

use fc_consensus::FrontierBlockImport;
use fc_rpc_core::types::{FeeHistoryCache, FilterPool};
use fc_storage::StorageOverrideHandler;
use futures::{FutureExt, StreamExt};
use sc_client_api::{Backend, BlockBackend, BlockchainEvents};
use sc_consensus_grandpa::SharedVoterState;
use sc_executor::NativeElseWasmExecutor;
use sc_network::NetworkBackend;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
use sc_telemetry::{Telemetry, TelemetryWorker};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_runtime::traits::Block as BlockT;
use std::{collections::BTreeMap, sync::Arc, time::Duration};

#[cfg(not(feature = "manual-seal"))]
Expand All @@ -46,19 +49,16 @@ const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512;
/// Extra host functions
#[cfg(feature = "runtime-benchmarks")]
pub type HostFunctions = (
// benchmarking host functions
frame_benchmarking::benchmarking::HostFunctions,
// evm tracing host functions
moonbeam_primitives_ext::moonbeam_ext::HostFunctions,
cumulus_client_service::storage_proof_size::HostFunctions,
);

/// Extra host functions
#[cfg(not(feature = "runtime-benchmarks"))]
pub type HostFunctions = (
// evm tracing host functions
moonbeam_primitives_ext::moonbeam_ext::HostFunctions,
cumulus_client_service::storage_proof_size::HostFunctions,
);

/// Local runtime native executor.
Expand Down Expand Up @@ -103,7 +103,7 @@ pub fn new_partial(
>,
sc_consensus_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
Option<Telemetry>,
Arc<fc_db::kv::Backend<Block>>,
Arc<fc_db::kv::Backend<Block, FullClient>>,
),
>,
ServiceError,
Expand Down Expand Up @@ -205,10 +205,13 @@ pub fn new_partial(
}

/// Builds a new service.
pub fn start_node(
pub fn start_node<N>(
config: Configuration,
#[cfg(feature = "evm-tracing")] evm_tracing_config: crate::evm_tracing_types::EvmTracingConfig,
) -> Result<TaskManager, ServiceError> {
) -> Result<TaskManager, ServiceError>
where
N: NetworkBackend<Block, <Block as BlockT>::Hash>,
{
let sc_service::PartialComponents {
client,
backend,
Expand All @@ -228,10 +231,20 @@ pub fn start_node(
.expect("Genesis block exists; qed"),
&config.chain_spec,
);
let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
let mut net_config =
sc_network::config::FullNetworkConfiguration::<_, _, N>::new(&config.network);

let metrics = N::register_notification_metrics(
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
);
let peer_store_handle = net_config.peer_store_handle();

let (grandpa_protocol_config, grandpa_notification_service) =
sc_consensus_grandpa::grandpa_peers_set_config(protocol_name.clone());
sc_consensus_grandpa::grandpa_peers_set_config::<_, N>(
protocol_name.clone(),
metrics.clone(),
Arc::clone(&peer_store_handle),
);
net_config.add_notification_protocol(grandpa_protocol_config);

let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
Expand All @@ -245,6 +258,7 @@ pub fn start_node(
block_announce_validator_builder: None,
warp_sync_params: None,
block_relay: None,
metrics,
})?;

if config.offchain_worker.enabled {
Expand All @@ -258,7 +272,7 @@ pub fn start_node(
transaction_pool: Some(OffchainTransactionPoolFactory::new(
transaction_pool.clone(),
)),
network_provider: network.clone(),
network_provider: Arc::new(network.clone()),
is_validator: config.role.is_authority(),
enable_http_requests: true,
custom_extensions: move |_| vec![],
Expand All @@ -270,7 +284,7 @@ pub fn start_node(

let filter_pool: FilterPool = Arc::new(std::sync::Mutex::new(BTreeMap::new()));
let fee_history_cache: FeeHistoryCache = Arc::new(std::sync::Mutex::new(BTreeMap::new()));
let overrides = fc_storage::overrides_handle(client.clone());
let storage_override = Arc::new(StorageOverrideHandler::new(client.clone()));

// Sinks for pubsub notifications.
// Everytime a new subscription is created, a new mpsc channel is added to the sink pool.
Expand All @@ -296,7 +310,7 @@ pub fn start_node(
substrate_backend: backend.clone(),
frontier_backend: frontier_backend.clone(),
filter_pool: Some(filter_pool.clone()),
overrides: overrides.clone(),
storage_override: storage_override.clone(),
},
)
} else {
Expand All @@ -316,7 +330,7 @@ pub fn start_node(
Duration::new(6, 0),
client.clone(),
backend.clone(),
overrides.clone(),
storage_override.clone(),
frontier_backend.clone(),
3,
0,
Expand Down Expand Up @@ -346,7 +360,7 @@ pub fn start_node(
Some("frontier"),
fc_rpc::EthTask::fee_history_task(
client.clone(),
overrides.clone(),
storage_override.clone(),
fee_history_cache.clone(),
FEE_HISTORY_LIMIT,
),
Expand All @@ -365,7 +379,7 @@ pub fn start_node(

let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new(
task_manager.spawn_handle(),
overrides.clone(),
storage_override.clone(),
50,
50,
prometheus_registry.clone(),
Expand Down Expand Up @@ -396,7 +410,7 @@ pub fn start_node(
fee_history_limit: FEE_HISTORY_LIMIT,
fee_history_cache: fee_history_cache.clone(),
block_data_cache: block_data_cache.clone(),
overrides: overrides.clone(),
storage_override: storage_override.clone(),
enable_evm_rpc: true, // enable EVM RPC for dev node by default
#[cfg(feature = "manual-seal")]
command_sink: Some(command_sink.clone()),
Expand Down
Loading
Loading