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

Update Substrate/Polkadot/Cumulus/Frontier dependency to 0.9.38 #2145

Merged
merged 67 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
1fca7f5
Init
tgmichel Mar 1, 2023
9b2f1b6
update precompile xcm utils
tgmichel Mar 3, 2023
6382c5c
update precompile xcm utils tests
tgmichel Mar 3, 2023
00da331
update `pallet-erc20-xcm-bridge`
tgmichel Mar 3, 2023
e0225e9
update `pallet-erc20-xcm-bridge` tests
tgmichel Mar 3, 2023
1ac2411
update `xcm-primitives`
tgmichel Mar 6, 2023
4fdaf4c
update `xcm-primitives` tests
tgmichel Mar 6, 2023
abf5e01
update `pallet-xcm-transactor` + tests
tgmichel Mar 7, 2023
11df242
update `moonbeam-xcm-benchmarks` + tests
tgmichel Mar 7, 2023
33b949c
update `pallet-evm-precompile-xtokens` + tests
tgmichel Mar 7, 2023
3cedc28
update `pallet-evm-precompile-xcm-transactor` + tests
tgmichel Mar 7, 2023
fd62fe2
update `pallet-evm-precompile-xcm-utils` + tests
tgmichel Mar 8, 2023
bf62cf7
update `moonbase-runtime` + tests
tgmichel Mar 13, 2023
c983650
cleanup
tgmichel Mar 13, 2023
995e2a3
update `moonriver-runtime` + tests
tgmichel Mar 13, 2023
bbc3aef
update `moonbeam-runtime` + tests
tgmichel Mar 13, 2023
07b10c4
update `moonbeam-rpc-debug` and `moonbeam-rpc-trace`
tgmichel Mar 13, 2023
b0040ce
update `moonbeam-service`
tgmichel Mar 13, 2023
54f2280
some additional fixes, cargo check green
tgmichel Mar 13, 2023
3b4cc03
cleanup warnings
tgmichel Mar 13, 2023
a6f99cd
fmt
tgmichel Mar 13, 2023
679ffe4
Merge branch 'master' into update-0.9.38
tgmichel Mar 13, 2023
a328cfd
remove `XcmExecutorWrapper`
tgmichel Mar 13, 2023
abb7d40
editorconfig
tgmichel Mar 13, 2023
e8bd567
Update polkadot pin
tgmichel Mar 14, 2023
21e0e7d
Fix test build
tgmichel Mar 14, 2023
a2ceb1f
Update `DEFAULT_PROOF_SIZE` in preocmpiles
tgmichel Mar 14, 2023
b8edb9c
Update `pallet-evm-precompileset-assets-erc20` test weights
tgmichel Mar 14, 2023
4610e57
Update `transact_through_signed_precompile_works_v1` test weight
tgmichel Mar 14, 2023
c1da0f7
update `RemoveItemsLimit`
tgmichel Mar 14, 2023
3030eec
wip fix ts tests
tgmichel Mar 14, 2023
36ed3f1
update `RemoveItemsLimit` 2
tgmichel Mar 14, 2023
dd78f71
wip update benchmarks
tgmichel Mar 14, 2023
624b824
remove comment
tgmichel Mar 14, 2023
91b6964
update benchmarks
tgmichel Mar 14, 2023
6c74c50
update `manual-xcm-rpc`
tgmichel Mar 15, 2023
f5f773d
fix remaining dep version updates
tgmichel Mar 15, 2023
baa8201
wip fix ts tests
tgmichel Mar 15, 2023
f0cb8f4
remove `XcmExecuteFilterWrapper`
tgmichel Mar 16, 2023
b4fe003
comment on destroy accounts magic number
tgmichel Mar 16, 2023
6cea27f
use `DEFAULT_PROOF_SIZE` const
tgmichel Mar 16, 2023
79ed78a
comment on TODO handle proof size payment
tgmichel Mar 16, 2023
df7996c
fix `test-mock-hrmp-queue`
tgmichel Mar 16, 2023
3145de2
repin orml
tgmichel Mar 16, 2023
08d5c2f
repin cumulus
tgmichel Mar 17, 2023
5edd919
fix `test-mock-dmp-queue` test
tgmichel Mar 17, 2023
7cf55fd
wip `pallet-asset-manager` migration
tgmichel Mar 21, 2023
2acbfe8
`pallet-asset-manager` migration tests
tgmichel Mar 21, 2023
7d907fa
wip `pallet-xcm-transactor` migration
tgmichel Mar 22, 2023
6651bba
`pallet-xcm-transactor` migration tests
tgmichel Mar 22, 2023
a8987ab
fmt
tgmichel Mar 22, 2023
207d0d4
toml-sort
tgmichel Mar 22, 2023
7b4837b
editorconfig
tgmichel Mar 22, 2023
4cd0695
remove unused
tgmichel Mar 22, 2023
26d3be1
prettier
tgmichel Mar 22, 2023
ef15dbb
missing import
tgmichel Mar 22, 2023
3ffee6f
repin polkadot
tgmichel Mar 23, 2023
cd46360
migrate `RemoteTransactInfoWithMaxWeight`
tgmichel Mar 27, 2023
65e723c
set 0.75 `MAX_POV_SIZE` moonbase only
tgmichel Mar 27, 2023
ec440a3
`pallet-asset-manager` fix pre and post upgrade tests
tgmichel Mar 28, 2023
848532d
`pallet-xcm-transactor` fix pre and post upgrade tests
tgmichel Mar 28, 2023
f90dbff
fmt
tgmichel Mar 28, 2023
891a2f7
repin substrate
tgmichel Mar 28, 2023
bd68432
Revert "set 0.75 `MAX_POV_SIZE` moonbase only"
tgmichel Mar 28, 2023
ca869ac
add defensive `transact_required_weight_at_most` value
tgmichel Mar 28, 2023
c7ce29b
Increase `DEFAULT_PROOF_SIZE` to 128kb
tgmichel Mar 28, 2023
f34bf3e
fmt
tgmichel Mar 28, 2023
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
998 changes: 577 additions & 421 deletions Cargo.lock

Large diffs are not rendered by default.

299 changes: 150 additions & 149 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/rpc-core/debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ moonbeam-rpc-core-types = { workspace = true }
serde = { workspace = true, features = [ "derive" ] }
serde_json = { workspace = true }

sp-core = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37" }
sp-core = { workspace = true, features = [ "std" ] }
1 change: 1 addition & 0 deletions client/rpc/debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ ethereum-types = { workspace = true, features = [ "std" ] }
fc-consensus = { workspace = true }
fc-db = { workspace = true }
fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] }
fc-storage = { workspace = true }
fp-rpc = { workspace = true, features = [ "std" ] }
21 changes: 8 additions & 13 deletions client/rpc/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ where
frontier_backend.as_ref(),
eth_hash,
) {
Ok(Some(id)) => Ok(id),
Ok(Some(hash)) => Ok(BlockId::Hash(hash)),
Ok(_) => Err(internal_err("Block hash not found".to_string())),
Err(e) => Err(e),
}
Expand All @@ -331,16 +331,13 @@ where
// Get parent blockid.
let parent_block_id = BlockId::Hash(*header.parent_hash());

let schema = frontier_backend_client::onchain_storage_schema::<B, C, BE>(
client.as_ref(),
reference_id,
);
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(&reference_id)
.current_transaction_statuses(hash)
.unwrap_or_default(),
_ => {
return Err(internal_err(format!(
Expand Down Expand Up @@ -446,7 +443,7 @@ where
frontier_backend.as_ref(),
hash,
) {
Ok(Some(hash)) => hash,
Ok(Some(hash)) => BlockId::Hash(hash),
Ok(_) => return Err(internal_err("Block hash not found".to_string())),
Err(e) => return Err(e),
};
Expand Down Expand Up @@ -482,19 +479,17 @@ where
));
};

let schema = frontier_backend_client::onchain_storage_schema::<B, C, BE>(
client.as_ref(),
reference_id,
);
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_id),
Some(schema) => schema.current_block(reference_hash),
_ => {
return Err(internal_err(format!(
"No storage override at {:?}",
reference_id
reference_hash
)))
}
};
Expand Down
4 changes: 1 addition & 3 deletions client/rpc/finality/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use std::{marker::PhantomData, sync::Arc};
//TODO ideally we wouldn't depend on BlockId here. Can we change frontier
// so it's load_hash helper returns an H256 instead of wrapping it in a BlockId?
use fc_db::Backend as FrontierBackend;
use sp_api::BlockId;
use sp_blockchain::HeaderBackend;
use sp_runtime::traits::Block;

Expand Down Expand Up @@ -90,8 +89,7 @@ fn is_block_finalized_inner<B: Block<Hash = H256>, C: HeaderBackend<B> + 'static
let substrate_hash =
match frontier_backend_client::load_hash::<B, C>(client, backend, raw_hash)? {
// If we find this hash in the frontier data base, we know it is an eth hash
Some(BlockId::Hash(hash)) => hash,
Some(BlockId::Number(_)) => panic!("is_canon test only works with hashes."),
Some(hash) => hash,
// Otherwise, we assume this is a Substrate hash.
None => raw_hash,
};
Expand Down
1 change: 1 addition & 0 deletions client/rpc/manual-xcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ tokio = { workspace = true, features = [ "sync", "time" ] }
xcm = { workspace = true }

cumulus-primitives-core = { workspace = true, features = [ "std" ] }
xcm-primitives = { workspace = true, features = [ "std" ] }
31 changes: 17 additions & 14 deletions client/rpc/manual-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use cumulus_primitives_core::XcmpMessageFormat;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use parity_scale_codec::Encode;
use xcm::latest::prelude::*;
use xcm::opaque::lts::Weight;
use xcm_primitives::DEFAULT_PROOF_SIZE;

/// This RPC interface is used to manually submit XCM messages that will be injected into a
/// parachain-enabled runtime. This allows testing XCM logic in a controlled way in integration
Expand Down Expand Up @@ -57,20 +59,19 @@ impl ManualXcmApiServer for ManualXcm {
let downward_message_channel = self.downward_message_channel.clone();
// If no message is supplied, inject a default one.
let msg = if msg.is_empty() {
xcm::VersionedXcm::<()>::V2(Xcm(vec![
ReserveAssetDeposited((Parent, 10000000000000).into()),
xcm::VersionedXcm::<()>::V3(Xcm(vec![
ReserveAssetDeposited((Parent, 10000000000000u128).into()),
ClearOrigin,
BuyExecution {
fees: (Parent, 10000000000000).into(),
weight_limit: Limited(4_000_000_000),
fees: (Parent, 10000000000000u128).into(),
weight_limit: Limited(Weight::from_parts(4_000_000_000u64, DEFAULT_PROOF_SIZE)),
},
DepositAsset {
assets: All.into(),
max_assets: 1,
assets: AllCounted(1).into(),
beneficiary: MultiLocation::new(
0,
X1(AccountKey20 {
network: Any,
network: None,
key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"),
}),
),
Expand Down Expand Up @@ -98,22 +99,24 @@ impl ManualXcmApiServer for ManualXcm {
let msg = if msg.is_empty() {
let mut mes = XcmpMessageFormat::ConcatenatedVersionedXcm.encode();
mes.append(
&mut (xcm::VersionedXcm::<()>::V2(Xcm(vec![
&mut (xcm::VersionedXcm::<()>::V3(Xcm(vec![
ReserveAssetDeposited(
((Parent, Parachain(sender.into())), 10000000000000).into(),
((Parent, Parachain(sender.into())), 10000000000000u128).into(),
),
ClearOrigin,
BuyExecution {
fees: ((Parent, Parachain(sender.into())), 10000000000000).into(),
weight_limit: Limited(4_000_000_000),
fees: ((Parent, Parachain(sender.into())), 10000000000000u128).into(),
weight_limit: Limited(Weight::from_parts(
4_000_000_000u64,
DEFAULT_PROOF_SIZE,
)),
},
DepositAsset {
assets: All.into(),
max_assets: 1,
assets: AllCounted(1).into(),
beneficiary: MultiLocation::new(
0,
X1(AccountKey20 {
network: Any,
network: None,
key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"),
}),
),
Expand Down
1 change: 1 addition & 0 deletions client/rpc/trace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ sp-transaction-pool = { workspace = true }
fc-consensus = { workspace = true }
fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] }
fc-rpc-core = { workspace = true }
fc-storage = { workspace = true }
fp-rpc = { workspace = true }
20 changes: 8 additions & 12 deletions client/rpc/trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use sp_blockchain::{
use sp_runtime::traits::{BlakeTwo256, Block as BlockT};

use ethereum_types::H256;
use fc_rpc::{frontier_backend_client, OverrideHandle};
use fc_rpc::OverrideHandle;
use fp_rpc::EthereumRuntimeRPCApi;

use moonbeam_client_evm_tracing::{
Expand Down Expand Up @@ -774,8 +774,6 @@ where
substrate_hash: H256,
overrides: Arc<OverrideHandle<B>>,
) -> TxsTraceRes {
let substrate_block_id = BlockId::Hash(substrate_hash);

// Get Subtrate block data.
let api = client.runtime_api();
let block_header = client
Expand All @@ -786,31 +784,29 @@ where
substrate_hash, e
)
})?
.ok_or_else(|| format!("Subtrate block {} don't exist", substrate_block_id))?;
.ok_or_else(|| format!("Subtrate block {} don't exist", substrate_hash))?;

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

let schema = frontier_backend_client::onchain_storage_schema::<B, C, BE>(
client.as_ref(),
substrate_block_id,
);
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_block_id),
schema.current_transaction_statuses(&substrate_block_id),
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_block_id
substrate_hash
))
}
},
_ => return Err(format!("No storage override at {:?}", substrate_block_id)),
_ => return Err(format!("No storage override at {:?}", substrate_hash)),
};

let eth_block_hash = eth_block.header.hash();
Expand Down
4 changes: 2 additions & 2 deletions node/service/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>,
) -> sp_blockchain::Result<
KeyIterator<'a, <crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
KeyIterator<<crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
> {
match_client!(self, storage_keys_iter(hash, prefix, start_key))
}
Expand Down Expand Up @@ -350,7 +350,7 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>,
) -> sp_blockchain::Result<
KeyIterator<'a, <crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
KeyIterator<<crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
> {
match_client!(
self,
Expand Down
2 changes: 1 addition & 1 deletion node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use cumulus_client_network::BlockAnnounceValidator;
use cumulus_client_service::{
prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams,
};
use cumulus_primitives_core::relay_chain::v2::CollatorPair;
use cumulus_primitives_core::relay_chain::CollatorPair;
use cumulus_primitives_core::ParaId;
use cumulus_primitives_parachain_inherent::{
MockValidationDataInherentDataProvider, MockXcmConfig,
Expand Down
22 changes: 9 additions & 13 deletions node/service/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,30 +121,26 @@ pub struct TracingConfig {
pub trace_filter_max_count: u32,
}

pub fn overrides_handle<C, BE>(client: Arc<C>) -> Arc<OverrideHandle<Block>>
pub fn overrides_handle<B, C, BE>(client: Arc<C>) -> Arc<OverrideHandle<B>>
where
C: ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + AuxStore,
C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,
C: Send + Sync + 'static,
C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,
BE: Backend<Block> + 'static,
BE::State: StateBackend<BlakeTwo256>,
B: BlockT,
C: ProvideRuntimeApi<B>,
C::Api: EthereumRuntimeRPCApi<B>,
C: HeaderBackend<B> + StorageProvider<B, BE> + 'static,
BE: Backend<B> + 'static,
{
let mut overrides_map = BTreeMap::new();
overrides_map.insert(
EthereumStorageSchema::V1,
Box::new(SchemaV1Override::new(client.clone()))
as Box<dyn StorageOverride<_> + Send + Sync>,
Box::new(SchemaV1Override::new(client.clone())) as Box<dyn StorageOverride<_>>,
);
overrides_map.insert(
EthereumStorageSchema::V2,
Box::new(SchemaV2Override::new(client.clone()))
as Box<dyn StorageOverride<_> + Send + Sync>,
Box::new(SchemaV2Override::new(client.clone())) as Box<dyn StorageOverride<_>>,
);
overrides_map.insert(
EthereumStorageSchema::V3,
Box::new(SchemaV3Override::new(client.clone()))
as Box<dyn StorageOverride<_> + Send + Sync>,
Box::new(SchemaV3Override::new(client.clone())) as Box<dyn StorageOverride<_>>,
);

Arc::new(OverrideHandle {
Expand Down
Loading