Skip to content

Commit af28691

Browse files
tgmichelimstar15
authored andcommitted
Update 0.9.38 (moonbeam-foundation#2145)
* Init * update precompile xcm utils * update precompile xcm utils tests * update `pallet-erc20-xcm-bridge` * update `pallet-erc20-xcm-bridge` tests * update `xcm-primitives` * update `xcm-primitives` tests * update `pallet-xcm-transactor` + tests * update `moonbeam-xcm-benchmarks` + tests * update `pallet-evm-precompile-xtokens` + tests * update `pallet-evm-precompile-xcm-transactor` + tests * update `pallet-evm-precompile-xcm-utils` + tests * update `moonbase-runtime` + tests * cleanup * update `moonriver-runtime` + tests * update `moonbeam-runtime` + tests * update `moonbeam-rpc-debug` and `moonbeam-rpc-trace` * update `moonbeam-service` * some additional fixes, cargo check green * cleanup warnings * fmt * remove `XcmExecutorWrapper` * editorconfig * Update polkadot pin * Fix test build * Update `DEFAULT_PROOF_SIZE` in preocmpiles * Update `pallet-evm-precompileset-assets-erc20` test weights * Update `transact_through_signed_precompile_works_v1` test weight * update `RemoveItemsLimit` * wip fix ts tests * update `RemoveItemsLimit` 2 * wip update benchmarks * remove comment * update benchmarks * update `manual-xcm-rpc` * fix remaining dep version updates * wip fix ts tests * remove `XcmExecuteFilterWrapper` * comment on destroy accounts magic number * use `DEFAULT_PROOF_SIZE` const * comment on TODO handle proof size payment * fix `test-mock-hrmp-queue` * repin orml * repin cumulus * fix `test-mock-dmp-queue` test * wip `pallet-asset-manager` migration * `pallet-asset-manager` migration tests * wip `pallet-xcm-transactor` migration * `pallet-xcm-transactor` migration tests * fmt * toml-sort * editorconfig * remove unused * prettier * missing import * repin polkadot * migrate `RemoteTransactInfoWithMaxWeight` * set 0.75 `MAX_POV_SIZE` moonbase only * `pallet-asset-manager` fix pre and post upgrade tests * `pallet-xcm-transactor` fix pre and post upgrade tests * fmt * repin substrate * Revert "set 0.75 `MAX_POV_SIZE` moonbase only" This reverts commit 65e723c. * add defensive `transact_required_weight_at_most` value * Increase `DEFAULT_PROOF_SIZE` to 128kb * fmt
1 parent 221a66a commit af28691

File tree

118 files changed

+4230
-2512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+4230
-2512
lines changed

Cargo.lock

Lines changed: 524 additions & 389 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 150 additions & 149 deletions
Large diffs are not rendered by default.

client/rpc/debug/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ ethereum-types = { workspace = true, features = [ "std" ] }
3535
fc-consensus = { workspace = true }
3636
fc-db = { workspace = true }
3737
fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] }
38+
fc-storage = { workspace = true }
3839
fp-rpc = { workspace = true, features = [ "std" ] }

client/rpc/debug/src/lib.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ where
308308
frontier_backend.as_ref(),
309309
eth_hash,
310310
) {
311-
Ok(Some(id)) => Ok(id),
311+
Ok(Some(hash)) => Ok(BlockId::Hash(hash)),
312312
Ok(_) => Err(internal_err("Block hash not found".to_string())),
313313
Err(e) => Err(e),
314314
}
@@ -331,16 +331,13 @@ where
331331
// Get parent blockid.
332332
let parent_block_id = BlockId::Hash(*header.parent_hash());
333333

334-
let schema = frontier_backend_client::onchain_storage_schema::<B, C, BE>(
335-
client.as_ref(),
336-
reference_id,
337-
);
334+
let schema = fc_storage::onchain_storage_schema::<B, C, BE>(client.as_ref(), hash);
338335

339336
// Using storage overrides we align with `:ethereum_schema` which will result in proper
340337
// SCALE decoding in case of migration.
341338
let statuses = match overrides.schemas.get(&schema) {
342339
Some(schema) => schema
343-
.current_transaction_statuses(&reference_id)
340+
.current_transaction_statuses(hash)
344341
.unwrap_or_default(),
345342
_ => {
346343
return Err(internal_err(format!(
@@ -446,7 +443,7 @@ where
446443
frontier_backend.as_ref(),
447444
hash,
448445
) {
449-
Ok(Some(hash)) => hash,
446+
Ok(Some(hash)) => BlockId::Hash(hash),
450447
Ok(_) => return Err(internal_err("Block hash not found".to_string())),
451448
Err(e) => return Err(e),
452449
};
@@ -482,19 +479,17 @@ where
482479
));
483480
};
484481

485-
let schema = frontier_backend_client::onchain_storage_schema::<B, C, BE>(
486-
client.as_ref(),
487-
reference_id,
488-
);
482+
let schema =
483+
fc_storage::onchain_storage_schema::<B, C, BE>(client.as_ref(), reference_hash);
489484

490485
// Get the block that contains the requested transaction. Using storage overrides we align
491486
// with `:ethereum_schema` which will result in proper SCALE decoding in case of migration.
492487
let reference_block = match overrides.schemas.get(&schema) {
493-
Some(schema) => schema.current_block(&reference_id),
488+
Some(schema) => schema.current_block(reference_hash),
494489
_ => {
495490
return Err(internal_err(format!(
496491
"No storage override at {:?}",
497-
reference_id
492+
reference_hash
498493
)))
499494
}
500495
};

client/rpc/finality/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use std::{marker::PhantomData, sync::Arc};
2020
//TODO ideally we wouldn't depend on BlockId here. Can we change frontier
2121
// so it's load_hash helper returns an H256 instead of wrapping it in a BlockId?
2222
use fc_db::Backend as FrontierBackend;
23-
use sp_api::BlockId;
2423
use sp_blockchain::HeaderBackend;
2524
use sp_runtime::traits::Block;
2625

@@ -90,8 +89,7 @@ fn is_block_finalized_inner<B: Block<Hash = H256>, C: HeaderBackend<B> + 'static
9089
let substrate_hash =
9190
match frontier_backend_client::load_hash::<B, C>(client, backend, raw_hash)? {
9291
// If we find this hash in the frontier data base, we know it is an eth hash
93-
Some(BlockId::Hash(hash)) => hash,
94-
Some(BlockId::Number(_)) => panic!("is_canon test only works with hashes."),
92+
Some(hash) => hash,
9593
// Otherwise, we assume this is a Substrate hash.
9694
None => raw_hash,
9795
};

client/rpc/manual-xcm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ tokio = { workspace = true, features = [ "sync", "time" ] }
1717
xcm = { workspace = true }
1818

1919
cumulus-primitives-core = { workspace = true, features = [ "std" ] }
20+
xcm-primitives = { workspace = true, features = [ "std" ] }

client/rpc/manual-xcm/src/lib.rs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ use cumulus_primitives_core::XcmpMessageFormat;
1818
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
1919
use parity_scale_codec::Encode;
2020
use xcm::latest::prelude::*;
21+
use xcm::opaque::lts::Weight;
22+
use xcm_primitives::DEFAULT_PROOF_SIZE;
2123

2224
/// This RPC interface is used to manually submit XCM messages that will be injected into a
2325
/// parachain-enabled runtime. This allows testing XCM logic in a controlled way in integration
@@ -57,20 +59,19 @@ impl ManualXcmApiServer for ManualXcm {
5759
let downward_message_channel = self.downward_message_channel.clone();
5860
// If no message is supplied, inject a default one.
5961
let msg = if msg.is_empty() {
60-
xcm::VersionedXcm::<()>::V2(Xcm(vec![
61-
ReserveAssetDeposited((Parent, 10000000000000).into()),
62+
xcm::VersionedXcm::<()>::V3(Xcm(vec![
63+
ReserveAssetDeposited((Parent, 10000000000000u128).into()),
6264
ClearOrigin,
6365
BuyExecution {
64-
fees: (Parent, 10000000000000).into(),
65-
weight_limit: Limited(4_000_000_000),
66+
fees: (Parent, 10000000000000u128).into(),
67+
weight_limit: Limited(Weight::from_parts(4_000_000_000u64, DEFAULT_PROOF_SIZE)),
6668
},
6769
DepositAsset {
68-
assets: All.into(),
69-
max_assets: 1,
70+
assets: AllCounted(1).into(),
7071
beneficiary: MultiLocation::new(
7172
0,
7273
X1(AccountKey20 {
73-
network: Any,
74+
network: None,
7475
key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"),
7576
}),
7677
),
@@ -98,22 +99,24 @@ impl ManualXcmApiServer for ManualXcm {
9899
let msg = if msg.is_empty() {
99100
let mut mes = XcmpMessageFormat::ConcatenatedVersionedXcm.encode();
100101
mes.append(
101-
&mut (xcm::VersionedXcm::<()>::V2(Xcm(vec![
102+
&mut (xcm::VersionedXcm::<()>::V3(Xcm(vec![
102103
ReserveAssetDeposited(
103-
((Parent, Parachain(sender.into())), 10000000000000).into(),
104+
((Parent, Parachain(sender.into())), 10000000000000u128).into(),
104105
),
105106
ClearOrigin,
106107
BuyExecution {
107-
fees: ((Parent, Parachain(sender.into())), 10000000000000).into(),
108-
weight_limit: Limited(4_000_000_000),
108+
fees: ((Parent, Parachain(sender.into())), 10000000000000u128).into(),
109+
weight_limit: Limited(Weight::from_parts(
110+
4_000_000_000u64,
111+
DEFAULT_PROOF_SIZE,
112+
)),
109113
},
110114
DepositAsset {
111-
assets: All.into(),
112-
max_assets: 1,
115+
assets: AllCounted(1).into(),
113116
beneficiary: MultiLocation::new(
114117
0,
115118
X1(AccountKey20 {
116-
network: Any,
119+
network: None,
117120
key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"),
118121
}),
119122
),

client/rpc/trace/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch
3939
fc-consensus = { workspace = true }
4040
fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] }
4141
fc-rpc-core = { workspace = true }
42+
fc-storage = { workspace = true }
4243
fp-rpc = { workspace = true }

client/rpc/trace/src/lib.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use sp_blockchain::{
4242
use sp_runtime::traits::{BlakeTwo256, Block as BlockT};
4343

4444
use ethereum_types::H256;
45-
use fc_rpc::{frontier_backend_client, OverrideHandle};
45+
use fc_rpc::OverrideHandle;
4646
use fp_rpc::EthereumRuntimeRPCApi;
4747

4848
use moonbeam_client_evm_tracing::{
@@ -774,8 +774,6 @@ where
774774
substrate_hash: H256,
775775
overrides: Arc<OverrideHandle<B>>,
776776
) -> TxsTraceRes {
777-
let substrate_block_id = BlockId::Hash(substrate_hash);
778-
779777
// Get Subtrate block data.
780778
let api = client.runtime_api();
781779
let block_header = client
@@ -786,31 +784,29 @@ where
786784
substrate_hash, e
787785
)
788786
})?
789-
.ok_or_else(|| format!("Subtrate block {} don't exist", substrate_block_id))?;
787+
.ok_or_else(|| format!("Subtrate block {} don't exist", substrate_hash))?;
790788

791789
let height = *block_header.number();
792790
let substrate_parent_id = BlockId::<B>::Hash(*block_header.parent_hash());
793791

794-
let schema = frontier_backend_client::onchain_storage_schema::<B, C, BE>(
795-
client.as_ref(),
796-
substrate_block_id,
797-
);
792+
let schema =
793+
fc_storage::onchain_storage_schema::<B, C, BE>(client.as_ref(), substrate_hash);
798794

799795
// Get Ethereum block data.
800796
let (eth_block, eth_transactions) = match overrides.schemas.get(&schema) {
801797
Some(schema) => match (
802-
schema.current_block(&substrate_block_id),
803-
schema.current_transaction_statuses(&substrate_block_id),
798+
schema.current_block(substrate_hash),
799+
schema.current_transaction_statuses(substrate_hash),
804800
) {
805801
(Some(a), Some(b)) => (a, b),
806802
_ => {
807803
return Err(format!(
808804
"Failed to get Ethereum block data for Substrate block {}",
809-
substrate_block_id
805+
substrate_hash
810806
))
811807
}
812808
},
813-
_ => return Err(format!("No storage override at {:?}", substrate_block_id)),
809+
_ => return Err(format!("No storage override at {:?}", substrate_hash)),
814810
};
815811

816812
let eth_block_hash = eth_block.header.hash();

node/service/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
320320
prefix: Option<&'a StorageKey>,
321321
start_key: Option<&StorageKey>,
322322
) -> sp_blockchain::Result<
323-
KeyIterator<'a, <crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
323+
KeyIterator<<crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
324324
> {
325325
match_client!(self, storage_keys_iter(hash, prefix, start_key))
326326
}
@@ -350,7 +350,7 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
350350
prefix: Option<&'a StorageKey>,
351351
start_key: Option<&StorageKey>,
352352
) -> sp_blockchain::Result<
353-
KeyIterator<'a, <crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
353+
KeyIterator<<crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
354354
> {
355355
match_client!(
356356
self,

0 commit comments

Comments
 (0)