Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6128afc
feat: update deps versions
ashutoshvarma Apr 24, 2025
d635f3f
feat: update primitives
ashutoshvarma Apr 27, 2025
c90b3be
feat: update precompiles
ashutoshvarma Apr 27, 2025
cb694fe
feat: update xc-asset and ua pallet
ashutoshvarma Apr 27, 2025
0571e99
feat: update all pallets
ashutoshvarma Apr 27, 2025
8ab4211
feat: update evm tracing & replace vendor txpool impl with upstream
ashutoshvarma Apr 27, 2025
565eee6
chore: cargo fmt --all
ashutoshvarma Apr 27, 2025
5c66712
feat: update runtimes
ashutoshvarma Apr 29, 2025
7fceac2
feat: update integration tests
ashutoshvarma Apr 29, 2025
41da848
feat: update collator
ashutoshvarma Apr 29, 2025
a2eeb50
feat: update frontier
ashutoshvarma May 2, 2025
b07d0c7
feat: remove dead code
ashutoshvarma May 2, 2025
9618dbf
feat: add migrations
ashutoshvarma May 2, 2025
27d6595
feat: update weights
ashutoshvarma May 3, 2025
960f629
fix: pallet tx payment benchmarks
ashutoshvarma May 3, 2025
3a920b5
fix: benchamrks
ashutoshvarma May 4, 2025
f244606
fix: xcm precompile tests
ashutoshvarma May 4, 2025
a182174
fix: make taplo happy
ashutoshvarma May 4, 2025
5a0d222
merge master
ashutoshvarma May 4, 2025
16dacbe
feat: make clippy hapy
ashutoshvarma May 4, 2025
1c3e941
feat: cleanup xc asset migrations
ashutoshvarma May 4, 2025
820676b
feat: make zepter happy
ashutoshvarma May 4, 2025
ba89cde
feat: update weights
ashutoshvarma May 4, 2025
59fc16c
feat: add xcm trusted api
ashutoshvarma May 5, 2025
db2c66e
feat: add test for new xcm api
ashutoshvarma May 5, 2025
1aef2c5
feat: remove todo comment
ashutoshvarma May 5, 2025
de93437
feat: revert spec version change
ashutoshvarma May 5, 2025
bc4a34e
feat: apply review comments
ashutoshvarma May 8, 2025
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
6,405 changes: 3,879 additions & 2,526 deletions Cargo.lock

Large diffs are not rendered by default.

342 changes: 169 additions & 173 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ moonbeam-rpc-primitives-txpool = { workspace = true }
moonbeam-primitives-ext = { workspace = true }
moonbeam-rpc-debug = { workspace = true }
moonbeam-rpc-trace = { workspace = true }
moonbeam-rpc-txpool = { workspace = true }

[build-dependencies]
polkadot-cli = { workspace = true, optional = true }
Expand Down Expand Up @@ -188,6 +187,7 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks",
]
try-runtime = [
"local-runtime/try-runtime",
Expand Down
42 changes: 27 additions & 15 deletions bin/collator/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ use crate::{
parachain::{self, chain_spec, service::AdditionalConfig},
};
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
#[cfg(feature = "runtime-benchmarks")]
use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE};
use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory};
use log::info;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, SharedParams, SubstrateCli,
NetworkParams, Result, RpcEndpoint, SharedParams, SubstrateCli,
};
use sc_service::{
config::{BasePath, PrometheusConfig},
PartialComponents,
};
use sp_runtime::traits::AccountIdConversion;
use std::net::SocketAddr;

trait IdentifyChain {
fn is_astar(&self) -> bool;
Expand Down Expand Up @@ -74,6 +74,18 @@ impl<T: sc_service::ChainSpec + 'static> IdentifyChain for T {
}
}

/// A trait to identify the network backend based on the chain spec.
pub trait IdentifyChainNetworkBackend {
/// Returns the default network backend.
fn default_network_backend(&self) -> sc_network::config::NetworkBackendType;
}

impl IdentifyChainNetworkBackend for Box<dyn ChainSpec> {
fn default_network_backend(&self) -> sc_network::config::NetworkBackendType {
sc_network::config::NetworkBackendType::Libp2p
}
}

fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
"dev" => Box::new(development_config()),
Expand Down Expand Up @@ -383,6 +395,7 @@ pub fn run() -> Result<()> {
}
}
BenchmarkCmd::Overhead(cmd) => {
let chain_name = chain_spec.name().to_string();
if chain_spec.is_dev() {
runner.sync_run(|config| {
let params = local::new_partial(&config, &rpc_config)?;
Expand All @@ -391,11 +404,12 @@ pub fn run() -> Result<()> {
.map_err(|e| format!("generating inherent data: {:?}", e))?;

cmd.run(
config,
chain_name,
params.client,
inherent_data,
Vec::new(),
&ext_builder,
true,
)
})
} else {
Expand All @@ -407,11 +421,12 @@ pub fn run() -> Result<()> {
.map_err(|e| format!("generating inherent data: {:?}", e))?;

cmd.run(
config,
chain_name,
params.client,
inherent_data,
Vec::new(),
&ext_builder,
true,
)
})
}
Expand Down Expand Up @@ -514,7 +529,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 @@ -579,7 +597,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 @@ -593,15 +611,9 @@ impl CliConfiguration<Self> for RelayChainCli {
.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
38 changes: 20 additions & 18 deletions bin/collator/src/local/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub fn new_partial(
FullBackend,
FullSelectChain,
sc_consensus::DefaultImportQueue<Block>,
sc_transaction_pool::FullPool<Block, FullClient>,
sc_transaction_pool::TransactionPoolHandle<Block, FullClient>,
(
FrontierBlockImport<
Block,
Expand Down Expand Up @@ -99,17 +99,18 @@ pub fn new_partial(
.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 All @@ -127,13 +128,14 @@ pub fn new_partial(
telemetry
});
let select_chain = sc_consensus::LongestChain::new(backend.clone());
let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
let transaction_pool = sc_transaction_pool::Builder::new(
task_manager.spawn_essential_handle(),
client.clone(),
);
config.role.is_authority().into(),
)
.with_options(config.transaction_pool.clone())
.with_prometheus(config.prometheus_registry())
.build();
let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import(
client.clone(),
GRANDPA_JUSTIFICATION_PERIOD,
Expand Down Expand Up @@ -189,7 +191,7 @@ pub fn new_partial(
import_queue,
keystore_container,
select_chain,
transaction_pool,
transaction_pool: transaction_pool.into(),
other: (
frontier_block_import,
grandpa_link,
Expand Down Expand Up @@ -226,8 +228,10 @@ where
.expect("Genesis block exists; qed"),
&config.chain_spec,
);
let mut net_config =
sc_network::config::FullNetworkConfiguration::<_, _, N>::new(&config.network);
let mut net_config = sc_network::config::FullNetworkConfiguration::<_, _, N>::new(
&config.network,
config.prometheus_registry().cloned(),
);

let metrics = N::register_notification_metrics(
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
Expand All @@ -251,7 +255,7 @@ where
spawn_handle: task_manager.spawn_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_params: None,
warp_sync_config: None,
block_relay: None,
metrics,
})?;
Expand All @@ -271,7 +275,7 @@ where
is_validator: config.role.is_authority(),
enable_http_requests: true,
custom_extensions: move |_| vec![],
})
})?
.run(client.clone(), task_manager.spawn_handle())
.boxed(),
);
Expand Down Expand Up @@ -302,7 +306,6 @@ where
client: client.clone(),
substrate_backend: backend.clone(),
frontier_backend: frontier_backend.clone(),
filter_pool: Some(filter_pool.clone()),
storage_override: storage_override.clone(),
},
)
Expand Down Expand Up @@ -412,15 +415,14 @@ where
let sync = sync_service.clone();
let pubsub_notification_sinks = pubsub_notification_sinks.clone();

Box::new(move |deny_unsafe, subscription| {
Box::new(move |subscription| {
let deps = crate::rpc::FullDeps {
client: client.clone(),
pool: transaction_pool.clone(),
graph: transaction_pool.pool().clone(),
graph: transaction_pool.clone(),
network: network.clone(),
sync: sync.clone(),
is_authority,
deny_unsafe,
frontier_backend: match *frontier_backend {
fc_db::Backend::KeyValue(ref b) => b.clone(),
fc_db::Backend::Sql(ref b) => b.clone(),
Expand Down
5 changes: 4 additions & 1 deletion bin/collator/src/parachain/fake_runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

#![allow(missing_docs)]

#[cfg(feature = "runtime-benchmarks")]
extern crate alloc;

use astar_primitives::{AccountId, Balance, Block, Nonce};
use frame_support::weights::Weight;
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
Expand Down Expand Up @@ -285,7 +288,7 @@ impl_runtime_apis! {
unimplemented!()
}

fn dispatch_benchmark(_config: frame_benchmarking::BenchmarkConfig) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
fn dispatch_benchmark(_config: frame_benchmarking::BenchmarkConfig) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {
unimplemented!()
}
}
Expand Down
Loading
Loading