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-sdk v1.11.0 #2838

Merged
merged 50 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
5b4f714
use polkadot-sdk v1.11.0
ahmadkaouk Jun 3, 2024
74c9277
update dependencies pinsˆ
ahmadkaouk Jun 5, 2024
bcfab1c
replace V4V3LocationConverter with WithLatestLocationConverter
ahmadkaouk Jun 5, 2024
2dd91e5
replace OverrideHandle with StorageOverrideHandler
ahmadkaouk Jun 6, 2024
75e5870
update jsonrpsee version
ahmadkaouk Jun 6, 2024
b209e6d
fix build precompile collective
ahmadkaouk Jun 6, 2024
1c738d3
fix missing weights
ahmadkaouk Jun 6, 2024
575c40a
Replace V4V3LocationConverter with WithLatestLocationConverter
ahmadkaouk Jun 6, 2024
fd8aeff
update GenesisBuilder implementation
ahmadkaouk Jun 6, 2024
8873c20
add missing frame_system::Config members
ahmadkaouk Jun 6, 2024
4956383
add missing XcmExecuterConfig params
ahmadkaouk Jun 10, 2024
c99d757
initialize_block now return ExtrinsicsInclusionMode
ahmadkaouk Jun 10, 2024
2cc6e25
fix return type of correct_and_deposit_fee
ahmadkaouk Jun 11, 2024
9a07036
Add IdleMaxServiceWeight to process enqueued messages on_idle
ahmadkaouk Jun 12, 2024
bff75e6
Add Rate limit for orml_xtokens
ahmadkaouk Jun 12, 2024
040844f
fix validation_data getter
ahmadkaouk Jun 12, 2024
38e44e8
fix return type
ahmadkaouk Jun 12, 2024
97237d1
replace OverrideHandle with StorageOverrideHandler
ahmadkaouk Jun 12, 2024
dfc42ae
Replace CallRequest with TransactionRequest
ahmadkaouk Jun 13, 2024
1e78603
fix frontier_backend use
ahmadkaouk Jun 13, 2024
18cff76
add metrics to BuildNetworkParams
ahmadkaouk Jun 13, 2024
ddf43fb
use NetworkBackend trait
ahmadkaouk Jun 14, 2024
013341a
Fix data update in TransactionRequest
ahmadkaouk Jun 14, 2024
50cb8c5
fix compilation
ahmadkaouk Jun 14, 2024
3c4f4a5
update benchmark command run
ahmadkaouk Jun 14, 2024
8bcef1f
fix
ahmadkaouk Jun 14, 2024
f23eba4
Fix runtime-benchmarks compilation
ahmadkaouk Jun 17, 2024
5075e4b
Merge branch 'master' into moonbeam-polkadot-v1.11.0
ahmadkaouk Jun 17, 2024
bfec802
fix tests compilation
ahmadkaouk Jun 17, 2024
b75d0db
make rust tests compile
ahmadkaouk Jun 17, 2024
c1c2f32
fix warnings
ahmadkaouk Jun 17, 2024
24bd266
fix test compile
ahmadkaouk Jun 17, 2024
cbdec8f
update host functions
ahmadkaouk Jun 18, 2024
9dfab29
fix
ahmadkaouk Jun 18, 2024
57f3c83
fix zombie tests
ahmadkaouk Jun 18, 2024
9523908
fix rust tests
ahmadkaouk Jun 18, 2024
3a4ddc9
fix format
ahmadkaouk Jun 19, 2024
0e13fb2
fix rust test
ahmadkaouk Jun 19, 2024
eae768a
fix(test): fix createProposal helper method
RomarQ Jun 19, 2024
ab196ff
fix(test): referenda tests
RomarQ Jun 19, 2024
b847c32
fix some xcm tests
Agusrodri Jun 19, 2024
4e15f6a
fix costs in assets-erc20 precompile tests
Agusrodri Jun 19, 2024
13a1f29
fix typescript tests
RomarQ Jun 20, 2024
6ac72a6
fix eth tracing
RomarQ Jun 20, 2024
3255080
fix tracing test
RomarQ Jun 20, 2024
7837a6c
match input field before data field
librelois Jun 24, 2024
0a30308
make field names consistent
librelois Jun 24, 2024
5e8a3b5
fix benchmarks
RomarQ Jun 24, 2024
6a8f0b4
fix formatting
RomarQ Jun 25, 2024
7a167d3
fix linting
RomarQ Jun 25, 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,299 changes: 1,495 additions & 804 deletions Cargo.lock

Large diffs are not rendered by default.

351 changes: 175 additions & 176 deletions Cargo.toml

Large diffs are not rendered by default.

42 changes: 9 additions & 33 deletions client/rpc/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ use tokio::{
};

use ethereum_types::H256;
use fc_rpc::{frontier_backend_client, internal_err, OverrideHandle};
use fc_rpc::{frontier_backend_client, internal_err};
use fc_storage::StorageOverride;
use fp_rpc::EthereumRuntimeRPCApi;
use moonbeam_client_evm_tracing::{formatters::ResponseFormatter, types::single};
use moonbeam_rpc_core_types::{RequestBlockId, RequestBlockTag};
Expand Down Expand Up @@ -178,7 +179,7 @@ where
backend: Arc<BE>,
frontier_backend: Arc<dyn fc_api::Backend<B> + Send + Sync>,
permit_pool: Arc<Semaphore>,
overrides: Arc<OverrideHandle<B>>,
overrides: Arc<dyn StorageOverride<B>>,
raw_max_memory_usage: usize,
) -> (impl Future<Output = ()>, DebugRequester) {
let (tx, mut rx): (DebugRequester, _) =
Expand Down Expand Up @@ -353,7 +354,7 @@ where
frontier_backend: Arc<dyn fc_api::Backend<B> + Send + Sync>,
request_block_id: RequestBlockId,
params: Option<TraceParams>,
overrides: Arc<OverrideHandle<B>>,
overrides: Arc<dyn StorageOverride<B>>,
) -> RpcResult<Response> {
let (tracer_input, trace_type) = Self::handle_params(params)?;

Expand Down Expand Up @@ -397,21 +398,9 @@ where
// Get parent blockid.
let parent_block_hash = *header.parent_hash();

let schema = fc_storage::onchain_storage_schema::<B, C, BE>(client.as_ref(), hash);

// Using storage overrides we align with `:ethereum_schema` which will result in proper
// SCALE decoding in case of migration.
let statuses = match overrides.schemas.get(&schema) {
Some(schema) => schema
.current_transaction_statuses(hash)
.unwrap_or_default(),
_ => {
return Err(internal_err(format!(
"No storage override at {:?}",
reference_id
)))
}
};
let statuses = overrides
.current_transaction_statuses(hash)
.unwrap_or_default();

// Known ethereum transaction hashes.
let eth_tx_hashes: Vec<_> = statuses.iter().map(|t| t.transaction_hash).collect();
Expand Down Expand Up @@ -514,7 +503,7 @@ where
frontier_backend: Arc<dyn fc_api::Backend<B> + Send + Sync>,
transaction_hash: H256,
params: Option<TraceParams>,
overrides: Arc<OverrideHandle<B>>,
overrides: Arc<dyn StorageOverride<B>>,
raw_max_memory_usage: usize,
) -> RpcResult<Response> {
let (tracer_input, trace_type) = Self::handle_params(params)?;
Expand Down Expand Up @@ -573,20 +562,7 @@ where
));
};

let schema =
fc_storage::onchain_storage_schema::<B, C, BE>(client.as_ref(), reference_hash);

// Get the block that contains the requested transaction. Using storage overrides we align
// with `:ethereum_schema` which will result in proper SCALE decoding in case of migration.
let reference_block = match overrides.schemas.get(&schema) {
Some(schema) => schema.current_block(reference_hash),
_ => {
return Err(internal_err(format!(
"No storage override at {:?}",
reference_hash
)))
}
};
let reference_block = overrides.current_block(hash);
RomarQ marked this conversation as resolved.
Show resolved Hide resolved

// Get the actual ethereum transaction.
if let Some(block) = reference_block {
Expand Down
36 changes: 15 additions & 21 deletions client/rpc/trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use substrate_prometheus_endpoint::{
};

use ethereum_types::H256;
use fc_rpc::OverrideHandle;
use fc_storage::StorageOverride;
use fp_rpc::EthereumRuntimeRPCApi;

use moonbeam_client_evm_tracing::{
Expand Down Expand Up @@ -442,7 +442,7 @@ where
backend: Arc<BE>,
cache_duration: Duration,
blocking_permits: Arc<Semaphore>,
overrides: Arc<OverrideHandle<B>>,
overrides: Arc<dyn StorageOverride<B>>,
prometheus: Option<PrometheusRegistry>,
) -> (impl Future<Output = ()>, CacheRequester) {
// Communication with the outside world :
Expand Down Expand Up @@ -535,7 +535,7 @@ where
blocking_tx: &mpsc::Sender<BlockingTaskMessage>,
sender: oneshot::Sender<CacheBatchId>,
blocks: Vec<H256>,
overrides: Arc<OverrideHandle<B>>,
overrides: Arc<dyn StorageOverride<B>>,
) {
tracing::trace!("Starting batch {}", self.next_batch_id);
self.batches.insert(self.next_batch_id, blocks.clone());
Expand Down Expand Up @@ -791,7 +791,7 @@ where
client: Arc<C>,
backend: Arc<BE>,
substrate_hash: H256,
overrides: Arc<OverrideHandle<B>>,
overrides: Arc<dyn StorageOverride<B>>,
) -> TxsTraceRes {
// Get Subtrate block data.
let api = client.runtime_api();
Expand All @@ -808,24 +808,18 @@ where
let height = *block_header.number();
let substrate_parent_hash = *block_header.parent_hash();

let schema =
fc_storage::onchain_storage_schema::<B, C, BE>(client.as_ref(), substrate_hash);

// Get Ethereum block data.
let (eth_block, eth_transactions) = match overrides.schemas.get(&schema) {
Some(schema) => match (
schema.current_block(substrate_hash),
schema.current_transaction_statuses(substrate_hash),
) {
(Some(a), Some(b)) => (a, b),
_ => {
return Err(format!(
"Failed to get Ethereum block data for Substrate block {}",
substrate_hash
))
}
},
_ => return Err(format!("No storage override at {:?}", substrate_hash)),
let (eth_block, eth_transactions) = match (
overrides.current_block(substrate_hash),
overrides.current_transaction_statuses(substrate_hash),
) {
(Some(a), Some(b)) => (a, b),
_ => {
return Err(format!(
"Failed to get Ethereum block data for Substrate block {}",
substrate_hash
))
}
};

let eth_block_hash = eth_block.header.hash();
Expand Down
19 changes: 7 additions & 12 deletions node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sc-chain-spec = { workspace = true }
sc-cli = { workspace = true }
sc-client-api = { workspace = true }
sc-consensus-grandpa = { workspace = true }
sc-network = { workspace = true }
sc-service = { workspace = true }
sc-sysinfo = { workspace = true }
sc-telemetry = { workspace = true }
Expand All @@ -29,7 +30,6 @@ sp-io = { workspace = true }
sp-runtime = { workspace = true, features = ["std"] }
sp-wasm-interface = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }
try-runtime-cli = { workspace = true, optional = true }

# Cumulus / Nimbus
cumulus-client-cli = { workspace = true }
Expand All @@ -48,10 +48,10 @@ substrate-build-script-utils = { workspace = true }

[features]
default = [
"moonbase-native",
"moonbeam-native",
"moonriver-native",
"westend-native",
"moonbase-native",
"moonbeam-native",
"moonriver-native",
"westend-native",
]

westend-native = ["polkadot-service/westend-native"]
Expand All @@ -61,13 +61,8 @@ moonbeam-native = ["moonbeam-service/moonbeam-native"]
moonriver-native = ["moonbeam-service/moonriver-native"]

runtime-benchmarks = [
"moonbeam-service/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
]
try-runtime = [
"moonbeam-service/try-runtime",
"try-runtime-cli/try-runtime",
"polkadot-service/try-runtime",
"moonbeam-service/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
]

moonbase-runtime-benchmarks = ["moonbeam-service/moonbase-runtime-benchmarks"]
30 changes: 19 additions & 11 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::BenchmarkCmd;
use log::{info, warn};
use moonbeam_cli_opt::EthApi;
use moonbeam_service::{chain_spec, frontier_database_dir, IdentifyVariant};
use moonbeam_service::{
chain_spec, frontier_database_dir, moonbase_runtime, moonbeam_runtime, moonriver_runtime,
HostFunctions, IdentifyVariant,
};
use parity_scale_codec::Encode;
#[cfg(feature = "westend-native")]
use polkadot_service::WestendChainSpec;
Expand All @@ -36,7 +39,9 @@ use sc_service::{
};
use sp_core::hexdisplay::HexDisplay;
use sp_runtime::{
traits::{AccountIdConversion, Block as BlockT, Hash as HashT, Header as HeaderT, Zero},
traits::{
AccountIdConversion, Block as BlockT, Hash as HashT, HashingFor, Header as HeaderT, Zero,
},
StateVersion,
};
use std::{io::Write, net::SocketAddr};
Expand Down Expand Up @@ -487,24 +492,24 @@ pub fn run() -> Result<()> {
#[cfg(feature = "moonriver-native")]
spec if spec.is_moonriver() => {
return runner.sync_run(|config| {
cmd.run::<moonbeam_service::moonriver_runtime::Block, moonbeam_service::HostFunctions>(
config,
cmd.run_with_spec::<HashingFor<moonriver_runtime::Block>, HostFunctions>(
Some(config.chain_spec),
)
})
}
#[cfg(feature = "moonbeam-native")]
spec if spec.is_moonbeam() => {
return runner.sync_run(|config| {
cmd.run::<moonbeam_service::moonbeam_runtime::Block, moonbeam_service::HostFunctions>(
config,
cmd.run_with_spec::<HashingFor<moonbeam_runtime::Block>, HostFunctions>(
Some(config.chain_spec),
)
})
}
#[cfg(feature = "moonbase-native")]
_ => {
return runner.sync_run(|config| {
cmd.run::<moonbeam_service::moonbase_runtime::Block, moonbeam_service::HostFunctions>(
config,
cmd.run_with_spec::<HashingFor<moonbase_runtime::Block>, HostFunctions>(
Some(config.chain_spec),
)
})
}
Expand All @@ -513,8 +518,8 @@ pub fn run() -> Result<()> {
}
} else if cfg!(feature = "moonbase-runtime-benchmarks") {
return runner.sync_run(|config| {
cmd.run::<moonbeam_service::moonbase_runtime::Block, moonbeam_service::HostFunctions>(
config,
cmd.run_with_spec::<HashingFor<moonbeam_service::moonbase_runtime::Block>, HostFunctions>(
Some(config.chain_spec),
)
});
} else {
Expand Down Expand Up @@ -728,20 +733,23 @@ pub fn run() -> Result<()> {
spec if spec.is_moonriver() => moonbeam_service::new_dev::<
moonbeam_service::moonriver_runtime::RuntimeApi,
moonbeam_service::MoonriverCustomizations,
sc_network::NetworkWorker<_, _>,
>(config, author_id, cli.run.sealing, rpc_config, hwbench)
.await
.map_err(Into::into),
#[cfg(feature = "moonbeam-native")]
spec if spec.is_moonbeam() => moonbeam_service::new_dev::<
moonbeam_service::moonbeam_runtime::RuntimeApi,
moonbeam_service::MoonbeamCustomizations,
sc_network::NetworkWorker<_, _>,
>(config, author_id, cli.run.sealing, rpc_config, hwbench)
.await
.map_err(Into::into),
#[cfg(feature = "moonbase-native")]
_ => moonbeam_service::new_dev::<
moonbeam_service::moonbase_runtime::RuntimeApi,
moonbeam_service::MoonbaseCustomizations,
sc_network::NetworkWorker<_, _>,
>(config, author_id, cli.run.sealing, rpc_config, hwbench)
.await
.map_err(Into::into),
Expand All @@ -758,7 +766,7 @@ pub fn run() -> Result<()> {
);

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

let tokio_handle = config.tokio_handle.clone();
let polkadot_config =
Expand Down
Loading
Loading