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

Upgrade to polkadot stable2409 #3031

Merged
merged 48 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
563711f
Upgrade to stable2409
TarekkMA Nov 5, 2024
77dad3d
fix(ethereum-xcm, precompiles/proxy): Compile issues
TarekkMA Nov 5, 2024
b5ef74b
fix(pallet-evm-precompile-preimage): Compile issues
TarekkMA Nov 5, 2024
9b0bf15
fix(pallet-evm-precompile-author-mapping): Compile issues
TarekkMA Nov 5, 2024
8841df9
fix(pallet-evm-precompile-collective): Compile issues
TarekkMA Nov 5, 2024
9eb2d74
fix(pallet-evm-precompile-crowdloan-rewards): Compile issues
TarekkMA Nov 5, 2024
0cc9a49
fix(pallet-evm-precompile-xtokens): Compile issues
TarekkMA Nov 5, 2024
26b5186
fix(pallet-evm-precompile-referenda): Compile issues
TarekkMA Nov 5, 2024
95417e9
fix(pallet-evm-precompile-gmp): Compile issues
TarekkMA Nov 5, 2024
ac486e4
fix(pallet-evm-precompile-conviction-voting): Compile issues
TarekkMA Nov 5, 2024
fb1e0d7
fix(pallet-evm-precompile-balances-erc20): Compile issues
TarekkMA Nov 5, 2024
0e043f1
fix(pallet-evm-precompile-xcm-transactor): Compile issues
TarekkMA Nov 5, 2024
04219a7
fix(pallet-evm-precompile-xcm-utils): Compile issues
TarekkMA Nov 5, 2024
9d32e18
fix(pallet-evm-precompileset-assets-erc20): Compile issues
TarekkMA Nov 5, 2024
065d60a
fix(pallet-evm-precompile-identity): Compile issues
TarekkMA Nov 5, 2024
54cc594
fix(pallet-evm-precompile-parachain-staking): Compile issues
TarekkMA Nov 5, 2024
c145fe0
fix(common): add a temp weight for transfer_all
TarekkMA Nov 5, 2024
b7402f6
fix(runtimes): Compile issues
TarekkMA Nov 5, 2024
e5e73ed
fix(summarize-precompile-checks): Compile issues
TarekkMA Nov 6, 2024
506ae5d
fix: jsonrpsee version
TarekkMA Nov 6, 2024
56f2b4d
fix(moonbeam-cli): Compile issues
TarekkMA Nov 6, 2024
1f441ea
fix(moonbeam-service): Compile issues
TarekkMA Nov 6, 2024
3d3a459
fix(ethereum-xcm): Compile issue
TarekkMA Nov 6, 2024
d673f69
style: cargo fmt
TarekkMA Nov 6, 2024
ea97523
refactor: remove unused imports
TarekkMA Nov 6, 2024
aca760d
fix: Compile issues in tests
TarekkMA Nov 6, 2024
47ba21c
fix: create_and_manipulate_foreign_asset test
TarekkMA Nov 8, 2024
f5c0080
fix: test_executor_send test
TarekkMA Nov 8, 2024
8eb4854
style: cargo fmt
TarekkMA Nov 8, 2024
80e48fb
fix: randomness tests
TarekkMA Nov 11, 2024
ed458ca
fix: randomness tests
TarekkMA Nov 11, 2024
d455b7c
fix: randomness tests
TarekkMA Nov 11, 2024
a8f39f9
fix: test-fees
TarekkMA Nov 15, 2024
f95be1d
fix: zombie-net
TarekkMA Nov 15, 2024
e7daf88
fix: randomness tests
TarekkMA Nov 15, 2024
cf79e2a
fix: gas issue
TarekkMA Nov 15, 2024
3aaede2
Merge branch 'master' into moonbeam-polkadot-stable2409
TarekkMA Nov 18, 2024
8f60644
update pins
TarekkMA Nov 19, 2024
6782592
Merge remote-tracking branch 'origin/master' into moonbeam-polkadot-s…
TarekkMA Nov 19, 2024
e2a9dd4
refactor: remove if_std
TarekkMA Nov 21, 2024
ac9378a
Merge branch 'master' into moonbeam-polkadot-stable2409
TarekkMA Dec 16, 2024
1929fc2
fix: merge issues
TarekkMA Dec 17, 2024
371ab5f
update cargo.lock
TarekkMA Dec 17, 2024
ea3b53a
fix: ERC20_UNPAUSE_GAS_LIMIT value
TarekkMA Dec 17, 2024
eefad0a
fix: gas values for storage growth tests
TarekkMA Dec 17, 2024
36b7843
fix: gas values for storage growth tests
TarekkMA Dec 17, 2024
38de04e
update Cargo.lock and fix import_queue usage
TarekkMA Dec 17, 2024
72784f1
style: remove empty line
TarekkMA Dec 17, 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
1,194 changes: 589 additions & 605 deletions Cargo.lock

Large diffs are not rendered by default.

360 changes: 180 additions & 180 deletions Cargo.toml

Large diffs are not rendered by default.

25 changes: 11 additions & 14 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use crate::cli::{Cli, RelayChainCli, RunCmd, Subcommand};
use cumulus_client_cli::extract_genesis_wasm;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::BenchmarkCmd;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::{info, warn};
use moonbeam_cli_opt::EthApi;

Expand All @@ -36,7 +36,7 @@ use parity_scale_codec::Encode;
use polkadot_service::WestendChainSpec;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli,
NetworkParams, Result, RpcEndpoint, RuntimeVersion, SharedParams, SubstrateCli,
};
use sc_service::{
config::{BasePath, PrometheusConfig},
Expand All @@ -49,7 +49,7 @@ use sp_runtime::{
},
StateVersion,
};
use std::{io::Write, net::SocketAddr};
use std::io::Write;

fn load_spec(
id: &str,
Expand Down Expand Up @@ -768,7 +768,10 @@ pub fn run() -> Result<()> {
let hwbench = if !cli.run.no_hardware_benchmarks {
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,
)
})
} else {
None
Expand Down Expand Up @@ -898,7 +901,7 @@ pub fn run() -> Result<()> {
let id = ParaId::from(cli.run.parachain_id.clone().or(para_id).unwrap_or(1000));

let parachain_account =
AccountIdConversion::<polkadot_primitives::v7::AccountId>::into_account_truncating(&id);
AccountIdConversion::<polkadot_primitives::v8::AccountId>::into_account_truncating(&id);

let tokio_handle = config.tokio_handle.clone();
let polkadot_config =
Expand Down Expand Up @@ -1024,7 +1027,7 @@ impl CliConfiguration<Self> for RelayChainCli {
.or_else(|| Some(self.base_path.clone().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 @@ -1038,15 +1041,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
22 changes: 12 additions & 10 deletions node/service/src/lazy_loading/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ where
ClientConfig {
offchain_worker_enabled: config.offchain_worker.enabled,
offchain_indexing_api: config.offchain_worker.indexing_enabled,
wasmtime_precompiled: config.wasmtime_precompiled.clone(),
wasmtime_precompiled: config.executor.wasmtime_precompiled.clone(),
wasm_runtime_overrides: config.wasm_runtime_overrides.clone(),
no_genesis: matches!(
config.network.sync_mode,
Expand Down Expand Up @@ -232,7 +232,7 @@ where
set_prometheus_registry(config, rpc_config.no_prometheus_prefix)?;

// Use ethereum style for subscription ids
config.rpc_id_provider = Some(Box::new(fc_rpc::EthereumSubIdProvider));
config.rpc.id_provider = Some(Box::new(fc_rpc::EthereumSubIdProvider));

let telemetry = config
.telemetry_endpoints
Expand All @@ -246,19 +246,20 @@ where
.transpose()?;

let heap_pages = config
.executor
.default_heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static {
extra_pages: h as _,
});
let mut wasm_builder = WasmExecutor::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_ignore_onchain_heap_pages(true)
.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);

if let Some(ref wasmtime_precompiled_path) = config.wasmtime_precompiled {
if let Some(ref wasmtime_precompiled_path) = config.executor.wasmtime_precompiled {
wasm_builder = wasm_builder.with_wasmtime_precompiled_path(wasmtime_precompiled_path);
}

Expand Down Expand Up @@ -444,7 +445,9 @@ where
));
};

let net_config = FullNetworkConfiguration::<_, _, Net>::new(&config.network);
let prometheus_registry = config.prometheus_registry().cloned();
let net_config =
FullNetworkConfiguration::<_, _, Net>::new(&config.network, prometheus_registry.clone());

let metrics = Net::register_notification_metrics(
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
Expand All @@ -458,7 +461,7 @@ where
spawn_handle: task_manager.spawn_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_params: None,
warp_sync_config: None,
net_config,
block_relay: None,
metrics,
Expand Down Expand Up @@ -754,12 +757,11 @@ where

let keystore = keystore_container.keystore();
let command_sink_for_task = command_sink.clone();
move |deny_unsafe, subscription_task_executor| {
move |subscription_task_executor| {
let deps = rpc::FullDeps {
backend: backend.clone(),
client: client.clone(),
command_sink: command_sink_for_task.clone(),
deny_unsafe,
ethapi_cmd: ethapi_cmd.clone(),
filter_pool: filter_pool.clone(),
frontier_backend: match *frontier_backend {
Expand Down
73 changes: 37 additions & 36 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ where
set_prometheus_registry(config, rpc_config.no_prometheus_prefix)?;

// Use ethereum style for subscription ids
config.rpc_id_provider = Some(Box::new(fc_rpc::EthereumSubIdProvider));
config.rpc.id_provider = Some(Box::new(fc_rpc::EthereumSubIdProvider));

let telemetry = config
.telemetry_endpoints
Expand All @@ -489,19 +489,20 @@ where
.transpose()?;

let heap_pages = config
.executor
.default_heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static {
extra_pages: h as _,
});
let mut wasm_builder = WasmExecutor::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_ignore_onchain_heap_pages(true)
.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);

if let Some(ref wasmtime_precompiled_path) = config.wasmtime_precompiled {
if let Some(ref wasmtime_precompiled_path) = config.executor.wasmtime_precompiled {
wasm_builder = wasm_builder.with_wasmtime_precompiled_path(wasmtime_precompiled_path);
}

Expand Down Expand Up @@ -698,7 +699,10 @@ where
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let transaction_pool = params.transaction_pool.clone();
let import_queue_service = params.import_queue.service();
let net_config = FullNetworkConfiguration::<_, _, Net>::new(&parachain_config.network);
let net_config = FullNetworkConfiguration::<_, _, Net>::new(
&parachain_config.network,
prometheus_registry.clone(),
);

let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
cumulus_client_service::build_network(cumulus_client_service::BuildNetworkParams {
Expand Down Expand Up @@ -791,7 +795,7 @@ where
let pubsub_notification_sinks = pubsub_notification_sinks.clone();

let keystore = params.keystore_container.keystore();
move |deny_unsafe, subscription_task_executor| {
move |subscription_task_executor| {
#[cfg(feature = "moonbase-native")]
let forced_parent_hashes = {
let mut forced_parent_hashes = BTreeMap::new();
Expand All @@ -816,7 +820,6 @@ where
backend: backend.clone(),
client: client.clone(),
command_sink: None,
deny_unsafe,
ethapi_cmd: ethapi_cmd.clone(),
filter_pool: filter_pool.clone(),
frontier_backend: match &*frontier_backend {
Expand Down Expand Up @@ -1218,7 +1221,9 @@ where
));
};

let net_config = FullNetworkConfiguration::<_, _, Net>::new(&config.network);
let prometheus_registry = config.prometheus_registry().cloned();
let net_config =
FullNetworkConfiguration::<_, _, Net>::new(&config.network, prometheus_registry.clone());

let metrics = Net::register_notification_metrics(
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
Expand All @@ -1232,7 +1237,7 @@ where
spawn_handle: task_manager.spawn_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_params: None,
warp_sync_config: None,
net_config,
block_relay: None,
metrics,
Expand Down Expand Up @@ -1532,12 +1537,11 @@ where
let pubsub_notification_sinks = pubsub_notification_sinks.clone();

let keystore = keystore_container.keystore();
move |deny_unsafe, subscription_task_executor| {
move |subscription_task_executor| {
let deps = rpc::FullDeps {
backend: backend.clone(),
client: client.clone(),
command_sink: command_sink.clone(),
deny_unsafe,
ethapi_cmd: ethapi_cmd.clone(),
filter_pool: filter_pool.clone(),
frontier_backend: match &*frontier_backend {
Expand Down Expand Up @@ -1623,10 +1627,13 @@ where

#[cfg(test)]
mod tests {
use crate::chain_spec::moonbase::{testnet_genesis, ChainSpec};
use crate::chain_spec::Extensions;
use jsonrpsee::server::BatchRequestConfig;
use moonbase_runtime::{currency::UNIT, AccountId};
use prometheus::{proto::LabelPair, Counter};
use sc_network::config::NetworkConfiguration;
use sc_service::config::RpcConfiguration;
use sc_service::ChainType;
use sc_service::{
config::{BasePath, DatabaseSource, KeystoreConfig},
Expand All @@ -1635,9 +1642,6 @@ mod tests {
use std::path::Path;
use std::str::FromStr;

use crate::chain_spec::moonbase::{testnet_genesis, ChainSpec};
use crate::chain_spec::Extensions;

use super::*;

#[test]
Expand Down Expand Up @@ -1768,7 +1772,7 @@ mod tests {
)
.unwrap(),
);
let mut client = TestClientBuilder::with_backend(backend).build();
let client = TestClientBuilder::with_backend(backend).build();

client
.execution_extensions()
Expand Down Expand Up @@ -1842,38 +1846,35 @@ mod tests {
state_pruning: Default::default(),
blocks_pruning: sc_service::BlocksPruning::KeepAll,
chain_spec: Box::new(spec),
wasm_method: Default::default(),
executor: Default::default(),
wasm_runtime_overrides: Default::default(),
rpc_id_provider: None,
rpc_max_connections: Default::default(),
rpc_cors: None,
rpc_methods: Default::default(),
rpc_max_request_size: Default::default(),
rpc_max_response_size: Default::default(),
rpc_max_subs_per_conn: Default::default(),
rpc_addr: None,
rpc_port: Default::default(),
rpc_message_buffer_capacity: Default::default(),
rpc: RpcConfiguration {
addr: None,
max_connections: Default::default(),
cors: None,
methods: Default::default(),
max_request_size: Default::default(),
max_response_size: Default::default(),
id_provider: None,
max_subs_per_conn: Default::default(),
port: Default::default(),
message_buffer_capacity: Default::default(),
batch_config: BatchRequestConfig::Unlimited,
rate_limit: Default::default(),
rate_limit_whitelisted_ips: vec![],
rate_limit_trust_proxy_headers: false,
},
data_path: Default::default(),
prometheus_config: None,
telemetry_endpoints: None,
default_heap_pages: None,
offchain_worker: Default::default(),
force_authoring: false,
disable_grandpa: false,
dev_key_seed: None,
tracing_targets: None,
tracing_receiver: Default::default(),
max_runtime_instances: 8,
announce_block: true,
base_path: BasePath::new(Path::new("")),
informant_output_format: Default::default(),
wasmtime_precompiled: None,
runtime_cache_size: 2,
rpc_rate_limit: Default::default(),
rpc_rate_limit_whitelisted_ips: vec![],
rpc_batch_config: BatchRequestConfig::Unlimited,
rpc_rate_limit_trust_proxy_headers: false,
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions node/service/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ use sc_consensus_manual_seal::rpc::{EngineCommand, ManualSeal, ManualSealApiServ
use sc_network::service::traits::NetworkService;
use sc_network_sync::SyncingService;
use sc_rpc::SubscriptionTaskExecutor;
use sc_rpc_api::DenyUnsafe;
use sc_service::TaskManager;
use sc_transaction_pool::{ChainApi, Pool};
use sc_transaction_pool_api::TransactionPool;
Expand Down Expand Up @@ -105,8 +104,6 @@ pub struct FullDeps<C, P, A: ChainApi, BE> {
pub pool: Arc<P>,
/// Graph pool instance.
pub graph: Arc<Pool<A>>,
/// Whether to deny unsafe calls
pub deny_unsafe: DenyUnsafe,
/// The Node authority flag
pub is_authority: bool,
/// Network service
Expand Down Expand Up @@ -190,7 +187,6 @@ where
client,
pool,
graph,
deny_unsafe,
is_authority,
network,
sync,
Expand All @@ -208,7 +204,7 @@ where
forced_parent_hashes,
} = deps;

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

// TODO: are we supporting signing?
Expand Down
5 changes: 4 additions & 1 deletion pallets/erc20-xcm-bridge/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ use crate as erc20_xcm_bridge;

use frame_support::traits::Everything;
use frame_support::{construct_runtime, pallet_prelude::*, parameter_types};
use pallet_evm::{AddressMapping, EnsureAddressTruncated, SubstrateBlockHashMapping};
use pallet_evm::{
AddressMapping, EnsureAddressTruncated, FrameSystemAccountProvider, SubstrateBlockHashMapping,
};
use sp_core::{H160, H256, U256};
use sp_runtime::traits::{BlakeTwo256, IdentityLookup};
use sp_runtime::AccountId32;
Expand Down Expand Up @@ -155,6 +157,7 @@ impl pallet_evm::Config for Test {
type GasLimitStorageGrowthRatio = GasLimitStorageGrowthRatio;
type Timestamp = Timestamp;
type WeightInfo = pallet_evm::weights::SubstrateWeight<Test>;
type AccountProvider = FrameSystemAccountProvider<Test>;
}

parameter_types! {
Expand Down
Loading
Loading