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

XCMv5: add ExecuteWithOrigin instruction #6304

Merged
merged 77 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
b01161f
feat(xcm-v5): skeleton
franciscoaguirre Jun 5, 2024
0b83e68
feat(xcm-v3): no longer use v2 types
franciscoaguirre Jun 5, 2024
e917d67
feat: remove XCMv2
franciscoaguirre Jun 5, 2024
9005e04
Merge branch 'master' into xcm-v5
franciscoaguirre Jun 19, 2024
5fc4a32
fix(xcm-v5): fix most compilation errors
franciscoaguirre Jun 19, 2024
337e26e
Merge branch 'master' into xcm-v5
franciscoaguirre Jun 26, 2024
19cc1da
fix(pallet-xcm): change V4 to V5
franciscoaguirre Jun 26, 2024
5cfd108
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 14, 2024
96b5b4b
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 14, 2024
6de7a42
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 16, 2024
126ef2f
fix(xcm-v5): change v4 to v5
franciscoaguirre Aug 16, 2024
a16e19f
fix: more v4 to v5 conversions
franciscoaguirre Aug 16, 2024
a3a09af
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 16, 2024
bbba323
fix: more v4 to v5 conversions
franciscoaguirre Aug 16, 2024
98c3906
fix: more v4 to v5 conversions
franciscoaguirre Aug 16, 2024
08a82d1
fix(xcm-builder): use previously unused function
franciscoaguirre Aug 19, 2024
1f031ec
fix(xcm-executor): change v4 to v5
franciscoaguirre Aug 19, 2024
5b423ad
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 21, 2024
1116cbb
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 21, 2024
cfa2ef4
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 27, 2024
241e992
Merge branch 'master' into xcm-v5
franciscoaguirre Sep 4, 2024
d421d3f
Merge branch 'master' into xcm-v5
franciscoaguirre Sep 4, 2024
3e85791
Merge branch 'master' into xcm-v5
franciscoaguirre Oct 1, 2024
f80c76a
fix: v4 -> v5
franciscoaguirre Oct 1, 2024
d1425bb
[XCMv5] Better fee mechanism (#5420)
franciscoaguirre Oct 17, 2024
f481f8e
Merge branch 'master' of github.com:paritytech/polkadot-sdk into xcm-v5
acatangiu Oct 17, 2024
678a379
Merge branch 'master' into xcm-v5
acatangiu Oct 17, 2024
4d9cc77
Merge branch 'master' of github.com:paritytech/polkadot-sdk into xcm-v5
acatangiu Oct 17, 2024
cdfecb7
fix merge dmg
acatangiu Oct 17, 2024
446465b
Added SetAssetClaimer Instruction to XCM v5 (#5585)
x3c41a Oct 21, 2024
4a6e85c
Merge branch 'master' into xcm-v5
acatangiu Oct 21, 2024
8fe7700
[xcm-v5] implement RFC#100: add new InitiateTransfer instruction (#5876)
acatangiu Oct 23, 2024
10d6795
Merge branch 'master' into xcm-v5
franciscoaguirre Oct 23, 2024
a1b8381
Transact without specifying weight (#6228)
franciscoaguirre Oct 29, 2024
86542d6
[xcm-v5] implement RFC#122: InitiateTransfer can alias XCM original o…
acatangiu Oct 29, 2024
e8807a3
Merge branch 'master' into xcm-v5
acatangiu Oct 29, 2024
4551714
feat(xcm): add ExecuteWithOrigin instruction
franciscoaguirre Oct 30, 2024
4c29910
Merge branch 'master' into xcm-v5
franciscoaguirre Oct 30, 2024
b2702bb
Merge branch 'xcm-v5' into execute-with-origin
franciscoaguirre Oct 30, 2024
d447db8
doc: add prdoc
franciscoaguirre Oct 31, 2024
01d9227
revert: small refactor in westend xcm config
franciscoaguirre Oct 31, 2024
30920c0
WIP
franciscoaguirre Oct 31, 2024
d2a98f4
Merge branch 'master' into xcm-v5
franciscoaguirre Oct 31, 2024
a9762d6
Merge branch 'master' into xcm-v5
franciscoaguirre Oct 31, 2024
c7f8cba
fix(xcm-executor): mock was using wrong UniversalLocation
franciscoaguirre Nov 1, 2024
8aeb508
fix: remove mention of require_weight_at_most
franciscoaguirre Nov 1, 2024
582d4c5
doc: add PRDoc
franciscoaguirre Nov 1, 2024
0eb726d
Merge branch 'master' into xcm-v5
franciscoaguirre Nov 1, 2024
e21773a
[XCMv5]Remove XCM testnet NetworkIds (#5390)
programskillforverification Nov 1, 2024
de9b7c6
fix: removing more instances of old network ids
franciscoaguirre Nov 1, 2024
f125031
Merge branch 'xcm-v5' into execute-with-origin
franciscoaguirre Nov 1, 2024
2892aac
Merge branch 'master' into xcm-v5
franciscoaguirre Nov 4, 2024
fd2d39a
Merge branch 'master' into xcm-v5
franciscoaguirre Nov 4, 2024
a503e9d
feat: modify WithComputedOrigin barrier to allow ExecuteWithOrigin
franciscoaguirre Nov 4, 2024
bd0ad18
test: add integration test for ExecuteWithOrigin
franciscoaguirre Nov 5, 2024
b160c34
fix: remove useless import
franciscoaguirre Nov 5, 2024
cfe404a
chore: add benchmark for ExecuteWithOrigin
franciscoaguirre Nov 5, 2024
00f2c0f
Merge branch 'master' into xcm-v5
franciscoaguirre Nov 5, 2024
68462d7
Merge branch 'xcm-v5' into execute-with-origin
franciscoaguirre Nov 5, 2024
ae85ee4
".git/.scripts/commands/fmt/fmt.sh"
Nov 5, 2024
355366f
".git/.scripts/commands/fmt/fmt.sh"
Nov 5, 2024
2c073ea
fix: rococo benchmarks
franciscoaguirre Nov 5, 2024
b07e2f2
Merge branch 'xcm-v5' of https://github.com/paritytech/polkadot-sdk i…
Nov 5, 2024
8163663
".git/.scripts/commands/bench/bench.sh" --subcommand=xcm --runtime=we…
Nov 5, 2024
b4eeb08
".git/.scripts/commands/bench/bench.sh" --subcommand=xcm --runtime=ro…
Nov 5, 2024
9025ee3
chore: feedback
franciscoaguirre Nov 7, 2024
6ab6a57
revert: modify WithComputedOrigin barrier
franciscoaguirre Nov 7, 2024
2734976
Merge branch 'master' into execute-with-origin
franciscoaguirre Nov 7, 2024
51244b1
fix: ci
franciscoaguirre Nov 8, 2024
1a9f4d1
fix: ci
franciscoaguirre Nov 8, 2024
808adff
fix: ci
franciscoaguirre Nov 8, 2024
2e1588a
".git/.scripts/commands/fmt/fmt.sh"
Nov 8, 2024
c385bed
Merge branch 'master' into execute-with-origin
franciscoaguirre Nov 12, 2024
37f9da7
Merge branch 'master' into execute-with-origin
franciscoaguirre Nov 12, 2024
19c6838
Update polkadot/xcm/xcm-executor/src/lib.rs
franciscoaguirre Nov 12, 2024
178805d
fix: syntax error
franciscoaguirre Nov 12, 2024
4053f11
Merge branch 'master' into execute-with-origin
franciscoaguirre Nov 12, 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
Prev Previous commit
Next Next commit
Merge branch 'master' into execute-with-origin
  • Loading branch information
franciscoaguirre committed Nov 7, 2024
commit 2734976bdc1d49f8cead410323ffb6f49c6d4628
4 changes: 2 additions & 2 deletions bridges/primitives/messages/src/lane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ impl TypeId for LegacyLaneId {
/// concatenation (separated by some binary data). I.e.:
///
/// ```nocompile
/// let endpoint1 = X2(GlobalConsensus(NetworkId::ByGenesis(ROCOCO_GENESIS_HASH)), Parachain(42));
/// let endpoint2 = X2(GlobalConsensus(NetworkId::ByGenesis(WOCOCO_GENESIS_HASH)), Parachain(777));
/// let endpoint1 = X2(GlobalConsensus(NetworkId::Polkadot), Parachain(42));
/// let endpoint2 = X2(GlobalConsensus(NetworkId::Kusama), Parachain(777));
///
/// let final_lane_key = if endpoint1 < endpoint2 {
/// (endpoint1, VALUES_SEPARATOR, endpoint2)
Expand Down
4 changes: 2 additions & 2 deletions bridges/snowbridge/pallets/inbound-queue/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ fn test_submit_happy_path() {
.into(),
nonce: 1,
message_id: [
174, 194, 98, 92, 98, 143, 193, 182, 195, 116, 216, 64, 223, 69, 20, 231, 217, 71,
255, 119, 96, 203, 117, 105, 208, 227, 39, 38, 67, 124, 223, 180,
11, 25, 133, 51, 23, 68, 111, 211, 132, 94, 254, 17, 194, 252, 198, 233, 10, 193,
156, 93, 72, 140, 65, 69, 79, 155, 154, 28, 141, 166, 171, 255,
],
fee_burned: 110000000000,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ mod imports {
pub use xcm::{
latest::{ParentThen, ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH},
prelude::{AccountId32 as AccountId32Junction, *},
v5,
};
pub use xcm_executor::traits::TransferType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ pub(crate) fn bridged_usdt_at_ah_rococo() -> Location {
Location::new(
2,
[
GlobalConsensus(ByGenesis(ROCOCO_GENESIS_HASH)),
Parachain(AssetHubRococo::para_id().into()),
GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)),
Parachain(AssetHubWestend::para_id().into()),
PalletInstance(ASSETS_PALLET_ID),
GeneralIndex(USDT_ID.into()),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ fn do_send_pens_and_wnds_from_penpal_westend_via_ahw_to_asset_hub_rococo(
);
let sov_ahr_on_ahw =
AssetHubWestend::sovereign_account_of_parachain_on_other_global_consensus(
Rococo,
ByGenesis(ROCOCO_GENESIS_HASH),
AssetHubRococo::para_id(),
);
// send message over bridge
Expand Down Expand Up @@ -711,7 +711,9 @@ fn send_pens_and_wnds_from_penpal_westend_via_ahw_to_ahr() {
pens_at_ahw
.interior()
.clone()
.pushed_front_with(Junction::GlobalConsensus(NetworkId::Westend))
.pushed_front_with(Junction::GlobalConsensus(NetworkId::ByGenesis(
WESTEND_GENESIS_HASH,
)))
.unwrap(),
);
let wnds_to_send = amount;
Expand Down Expand Up @@ -751,7 +753,7 @@ fn send_pens_and_wnds_from_penpal_westend_via_ahw_to_ahr() {
<Assets as Inspect<_>>::balance(pens_id_on_penpal, &PenpalBSender::get())
});
let sov_ahr_on_ahw = AssetHubWestend::sovereign_account_of_parachain_on_other_global_consensus(
Rococo,
ByGenesis(ROCOCO_GENESIS_HASH),
AssetHubRococo::para_id(),
);
let wnds_in_reserve_on_ahw_before =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ pub(crate) fn bridged_usdt_at_ah_rococo() -> Location {
Location::new(
2,
[
GlobalConsensus(ByGenesis(ROCOCO_GENESIS_HASH)),
Parachain(AssetHubRococo::para_id().into()),
GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)),
Parachain(AssetHubWestend::para_id().into()),
PalletInstance(ASSETS_PALLET_ID),
GeneralIndex(USDT_ID.into()),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn transfer_and_transact_in_same_xcm(
) {
let signed_origin = <BridgeHubWestend as Chain>::RuntimeOrigin::root();
let context: InteriorLocation = [
GlobalConsensus(Westend),
GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)),
Parachain(<BridgeHubWestend as Para>::ParachainInfo::get().into()),
]
.into();
Expand All @@ -47,10 +47,9 @@ fn transfer_and_transact_in_same_xcm(
let ah_fees_amount = 90_000_000_000u128; // current exact value 79_948_099_299
let fees_for_ah: Asset = (weth.id.clone(), ah_fees_amount).into();

let require_weight_at_most = Weight::from_parts(1000000000, 200000);
// xcm to be executed at dest
let xcm_on_dest = Xcm(vec![
Transact { origin_kind: OriginKind::Xcm, require_weight_at_most, call },
Transact { origin_kind: OriginKind::Xcm, call },
ExpectTransactStatus(MaybeErrorCode::Success),
// since this is the last hop, we don't need to further use any assets previously
// reserved for fees (there are no further hops to cover transport fees for); we
Expand Down
12 changes: 6 additions & 6 deletions cumulus/parachains/runtimes/assets/common/src/matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ impl<AssetsAllowedNetworks: Contains<Location>, OriginLocation: Get<Location>>
mod tests {
use super::*;
use frame_support::parameter_types;
use xcm::latest::ROCOCO_GENESIS_HASH;
use xcm::latest::{ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH};

parameter_types! {
pub UniversalLocation: InteriorLocation = [GlobalConsensus(ByGenesis(ROCOCO_GENESIS_HASH)), Parachain(1000)].into();
pub ExpectedNetworkId: NetworkId = ByGenesis(WOCOCO_GENESIS_HASH);
pub ExpectedNetworkId: NetworkId = ByGenesis(WESTEND_GENESIS_HASH);
}

#[test]
Expand All @@ -159,14 +159,14 @@ mod tests {
let asset: Location = (
Parent,
Parent,
GlobalConsensus(ByGenesis(WOCOCO_GENESIS_HASH)),
GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)),
Parachain(1000),
PalletInstance(1),
GeneralIndex(1),
)
.into();
let origin: Location =
(Parent, Parent, GlobalConsensus(ByGenesis(WOCOCO_GENESIS_HASH)), Parachain(1000))
(Parent, Parent, GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)), Parachain(1000))
.into();
assert!(FromNetwork::<UniversalLocation, ExpectedNetworkId>::contains(&asset, &origin));

Expand Down Expand Up @@ -201,15 +201,15 @@ mod tests {
)
.into();
let origin: Location =
(Parent, Parent, GlobalConsensus(ByGenesis(WOCOCO_GENESIS_HASH)), Parachain(1000))
(Parent, Parent, GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)), Parachain(1000))
.into();
assert!(!FromNetwork::<UniversalLocation, ExpectedNetworkId>::contains(&asset, &origin));

// origin from different consensus fails
let asset: Location = (
Parent,
Parent,
GlobalConsensus(ByGenesis(WOCOCO_GENESIS_HASH)),
GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)),
Parachain(1000),
PalletInstance(1),
GeneralIndex(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
pub use sp_runtime::{MultiAddress, Perbill, Permill};

#[cfg(feature = "runtime-benchmarks")]
use xcm::latest::{ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH};
use xcm::latest::WESTEND_GENESIS_HASH;
use xcm::VersionedLocation;
use xcm_config::{TreasuryAccount, XcmOriginToTransactDispatchOrigin, XcmRouter};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use sp_runtime::{
AccountId32, Perbill,
};
use testnet_parachains_constants::rococo::{consensus::*, fee::WeightToFee};
use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH};
use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH};
use xcm_runtime_apis::conversions::LocationToAccountHelper;

parameter_types! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub use sp_runtime::BuildStorage;
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};

#[cfg(feature = "runtime-benchmarks")]
use xcm::latest::{ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH};
use xcm::latest::ROCOCO_GENESIS_HASH;
use xcm::prelude::*;

use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use sp_runtime::{
AccountId32, Perbill,
};
use testnet_parachains_constants::westend::{consensus::*, fee::WeightToFee};
use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH};
use xcm::latest::{prelude::*, WESTEND_GENESIS_HASH};
use xcm_runtime_apis::conversions::LocationToAccountHelper;

// Random para id of sibling chain used in tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use frame_support::{
use pallet_message_queue::OnQueueChanged;
use scale_info::TypeInfo;
use snowbridge_core::ChannelId;
use xcm::v5::{Junction, Location};
use xcm::latest::prelude::{Junction, Location};

/// The aggregate origin of an inbound message.
/// This is specialized for BridgeHub, as the snowbridge-outbound-queue-pallet is also using
Expand Down
4 changes: 2 additions & 2 deletions cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use pallet_xcm::XcmPassthrough;
use parachains_common::{xcm_config::AssetFeeAsExistentialDepositMultiplier, TREASURY_PALLET_ID};
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::{impls::ToAuthor, xcm_sender::ExponentialPrice};
use snowbridge_router_primitives::inbound::GlobalConsensusEthereumConvertsFor;
use snowbridge_router_primitives::inbound::EthereumLocationsConverterFor;
use sp_runtime::traits::{AccountIdConversion, ConvertInto, Identity, TryConvertInto};
use xcm::latest::{prelude::*, WESTEND_GENESIS_HASH};
use xcm_builder::{
Expand Down Expand Up @@ -99,7 +99,7 @@ pub type LocationToAccountId = (
GlobalConsensusParachainConvertsFor<UniversalLocation, AccountId>,
// Ethereum contract sovereign account.
// (Used to get convert ethereum contract locations to sovereign account)
GlobalConsensusEthereumConvertsFor<AccountId>,
EthereumLocationsConverterFor<AccountId>,
);

/// Means for transacting assets on this chain.
Expand Down
2 changes: 1 addition & 1 deletion polkadot/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub struct RunCmd {

/// Disable the BEEFY gadget.
///
/// Currently enabled by default on 'Rococo' and 'Versi'.
/// Currently enabled by default.
#[arg(long)]
pub no_beefy: bool,

Expand Down
8 changes: 4 additions & 4 deletions polkadot/runtime/parachains/src/coretime/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mod v_coretime {

impl<
T: Config,
SendXcm: xcm::latest::SendXcm,
XcmSender: SendXcm,
LegacyLease: GetLegacyLease<BlockNumberFor<T>>,
const TIMESLICE_PERIOD: u32,
> MigrateToCoretime<T, XcmSender, LegacyLease, TIMESLICE_PERIOD>
Expand Down Expand Up @@ -97,7 +97,7 @@ mod v_coretime {

impl<
T: Config + crate::dmp::Config,
SendXcm: xcm::latest::SendXcm,
XcmSender: SendXcm,
LegacyLease: GetLegacyLease<BlockNumberFor<T>>,
const TIMESLICE_PERIOD: u32,
> OnRuntimeUpgrade for MigrateToCoretime<T, XcmSender, LegacyLease, TIMESLICE_PERIOD>
Expand Down Expand Up @@ -159,7 +159,7 @@ mod v_coretime {
// NOTE: Also migrates `num_cores` config value in configuration::ActiveConfig.
fn migrate_to_coretime<
T: Config,
SendXcm: xcm::latest::SendXcm,
XcmSender: SendXcm,
LegacyLease: GetLegacyLease<BlockNumberFor<T>>,
const TIMESLICE_PERIOD: u32,
>() -> Weight {
Expand Down Expand Up @@ -220,7 +220,7 @@ mod v_coretime {

fn migrate_send_assignments_to_coretime_chain<
T: Config,
SendXcm: xcm::latest::SendXcm,
XcmSender: SendXcm,
LegacyLease: GetLegacyLease<BlockNumberFor<T>>,
const TIMESLICE_PERIOD: u32,
>() -> result::Result<(), SendError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 710_000 picoseconds.
Weight::from_parts(770_000, 0)

Check failure on line 337 in polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs

View workflow job for this annotation

GitHub Actions / cargo-check-all-crate-macos

expected `;`, found `Weight`
// Minimum execution time: 798_000 picoseconds.
Weight::from_parts(845_000, 0)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use frame::{
runtime::prelude::*,
traits::{Everything, Nothing},
};
use xcm::v5::prelude::*;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin,
FrameTransactionalProcessor, FungibleAdapter, HashedDescription, IsConcrete,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use frame::{
traits::{IdentityLookup, ProcessMessage, ProcessMessageError},
};
use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId};
use xcm::v5::prelude::*;
use xcm::latest::prelude::*;

mod xcm_config;
pub use xcm_config::LocationToAccountId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use frame::{
runtime::prelude::*,
traits::{Everything, Nothing},
};
use xcm::v5::prelude::*;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin,
FrameTransactionalProcessor, FungibleAdapter, HashedDescription, IsConcrete,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ benchmarks! {

let mut executor = new_executor::<T>(Default::default());
executor.set_holding(holding);
// Set some weight to be paid for.
executor.set_message_weight(Weight::from_parts(100_000_000, 100_000));

let fee_asset = T::fee_asset().unwrap();
let fee_asset: Asset = T::fee_asset().unwrap();

let instruction = Instruction::<XcmCallOf<T>>::PayFees { asset: fee_asset };

Expand Down
7 changes: 3 additions & 4 deletions polkadot/xcm/src/v5/junction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ pub const WESTEND_GENESIS_HASH: [u8; 32] =
pub const ROCOCO_GENESIS_HASH: [u8; 32] =
hex!["6408de7737c59c238890533af25896a2c20608d8b380bb01029acb392781063e"];

// TODO: What to use here?
pub const WOCOCO_GENESIS_HASH: [u8; 32] =
hex!["0000000000000000000000000000000000000000000000000000000000000000"];
/// Dummy genesis hash used instead of defunct networks like Wococo (and soon Rococo).
pub const DUMMY_GENESIS_HASH: [u8; 32] = [0; 32];

/// A global identifier of a data structure existing within consensus.
///
Expand Down Expand Up @@ -173,7 +172,7 @@ impl From<OldNetworkId> for NetworkId {
Kusama => Self::Kusama,
Westend => Self::ByGenesis(WESTEND_GENESIS_HASH),
Rococo => Self::ByGenesis(ROCOCO_GENESIS_HASH),
Wococo => Self::ByGenesis(WOCOCO_GENESIS_HASH),
Wococo => Self::ByGenesis(DUMMY_GENESIS_HASH),
Ethereum { chain_id } => Self::Ethereum { chain_id },
BitcoinCore => Self::BitcoinCore,
BitcoinCash => Self::BitcoinCash,
Expand Down
2 changes: 1 addition & 1 deletion polkadot/xcm/src/v5/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub struct Location {

impl Default for Location {
fn default() -> Self {
Self { parents: 0, interior: Junctions::Here }
Self::here()
}
}

Expand Down
5 changes: 1 addition & 4 deletions polkadot/xcm/src/v5/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub use traits::{
SendError, SendResult, SendXcm, Weight, XcmHash,
};
// These parts of XCM v4 are unchanged in XCM v5, and are re-imported here.
pub use super::v4::{MaybeErrorCode, OriginKind, WeightLimit};
pub use super::v4::{MaxDispatchErrorLen, MaybeErrorCode, OriginKind, WeightLimit};

pub const VERSION: super::Version = 5;

Expand Down Expand Up @@ -223,9 +223,6 @@ pub mod prelude {

parameter_types! {
pub MaxPalletNameLen: u32 = 48;
/// Maximum size of the encoded error code coming from a `Dispatch` result, used for
/// `MaybeErrorCode`. This is not (yet) enforced, so it's just an indication of expectation.
pub MaxDispatchErrorLen: u32 = 128;
pub MaxPalletsInfo: u32 = 64;
}

Expand Down
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.