3

I am testing transferring ROC between AssetHub and a Parachain. The HRMP channels are already open but when I submit try the following XCM Message: enter image description here

I get this error:

    [
      {
        type: "docs",
        value: "Execution of an XCM message was attempted."
      },
      {
        type: "xcm:v3:traits:Outcome",
        type_name: "xcm::latest::Outcome",
        value: {
          Incomplete: {
            col0: {
              proof_size: 6196,
              ref_time: 683414000
            },
            col1: {
              Unroutable: "NULL"
            }
          }
        },
        name: "outcome"
      }
    ]

The current XCM configuration for the runtime is: (link to code: here)

        // Means for transacting assets on this chain.
    pub type LocalAssetTransactor = CurrencyAdapter<
        // Use this currency:
        Balances,
        // Use this currency when it is a fungible asset matching the given location or name:
        IsConcrete<SelfLocation>,
        // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:
        LocationToAccountId,
        // Our chain's account ID type (we can't get away without mentioning it explicitly):
        AccountId,
        // We don't track any teleports.
        (),
    >;
    
    pub type TrustBackedAssetsConvertedConcreteId =
        assets_common::TrustBackedAssetsConvertedConcreteId<AssetsPalletLocation, Balance>;
    
    /// Means for transacting assets besides the native currency on this chain.
    pub type FungiblesTransactor = FungiblesAdapter<
        // Use this fungibles implementation:
        Assets,
        // Use the asset registry for lookups
        TrustBackedAssetsConvertedConcreteId,
        //ConvertedConcreteAssetId<AssetIdForTrustBackedAssets, Balance, AssetRegistry, JustTry>,
        // Convert an XCM MultiLocation into a local account id:
        LocationToAccountId,
        // Our chain's account ID type (we can't get away without mentioning it explicitly):
        AccountId,
        // We only want to allow teleports of known assets. We use non-zero issuance as an indication
        // that this asset is known.
        LocalMint<parachains_common::impls::NonZeroIssuance<AccountId, Assets>>,
        // The account to use for tracking teleports.
        CheckingAccount,
    >;
    pub type AssetTransactors = (LocalAssetTransactor, FungiblesTransactor);

    pub type Barrier = (
       TakeWeightCredit,
       AllowKnownQueryResponses<PolkadotXcm>,
       AllowTopLevelPaidExecutionFrom<Everything>,
       AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
       AllowSubscriptionsFrom<ParentOrSiblings>,
    );

    impl xcm_executor::Config for XcmConfig {
        type Aliasers = Nothing;
        type AssetClaims = PolkadotXcm;
        type AssetExchanger = ();
        type AssetLocker = ();
        type AssetTransactor = AssetTransactors;
        type AssetTrap = PolkadotXcm;
        type Barrier = Barrier;
        type CallDispatcher = RuntimeCall;
        type FeeManager = ();
        type IsReserve = NativeAsset;
        type IsTeleporter = (
            NativeAsset,
            // IsForeignConcreteAsset<FromSiblingParachain<parachain_info::Pallet<Runtime>>>,
        );
        type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
        type MessageExporter = ();
        type OriginConverter = XcmOriginToTransactDispatchOrigin;
        type PalletInstancesInfo = AllPalletsWithSystem;
        type ResponseHandler = PolkadotXcm;
        type RuntimeCall = RuntimeCall;
        type SafeCallFilter = Everything;
        type SubscriptionService = PolkadotXcm;
        type Trader = UsingComponents<WeightToFee, RelayLocation, AccountId, Balances, ()>;
        type UniversalAliases = Nothing;
        type UniversalLocation = UniversalLocation;
        type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
        type XcmSender = XcmRouter;
     }
    
    #[cfg(feature = "runtime-benchmarks")]
        parameter_types! {
        pub ReachableDest: Option<MultiLocation> = Some(Parent.into());
    }
    
    impl pallet_xcm::Config for Runtime {
        type AdminOrigin = EnsureRoot<crate::AccountId>;
        // type AdminOrigin = EnsureRoot<AccountId>;
        type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
        type Currency = Balances;
        type CurrencyMatcher = ();
        // We support local origins dispatching XCM executions in principle...
        type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
        type MaxLockers = ConstU32<8>;
        type MaxRemoteLockConsumers = frame_support::traits::ConstU32<0>;
        // type MaxRemoteLockConsumers = ConstU32<0>;
        #[cfg(feature = "runtime-benchmarks")]
        type ReachableDest = ReachableDest;
        type RemoteLockConsumerIdentifier = ();
        // type RemoteLockConsumerIdentifier = ();
        type RuntimeCall = RuntimeCall;
        type RuntimeEvent = RuntimeEvent;
        type RuntimeOrigin = RuntimeOrigin;
        // We want to disallow users sending (arbitrary) XCMs from this chain.
        type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, ()>;
        type SovereignAccountOf = LocationToAccountId;
        type TrustedLockers = ();
        type UniversalLocation = UniversalLocation;
        type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
        // FIXME: Replace with benchmarked weight info
        type WeightInfo = pallet_xcm::TestWeightInfo;
        // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are allowed.
        type XcmExecuteFilter = Nothing;
        type XcmExecutor = XcmExecutor<XcmConfig>;
        type XcmReserveTransferFilter = Everything;
        type XcmRouter = XcmRouter;
        type XcmTeleportFilter = Everything;
    
        const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
    }

Any guidance on what causes the error and how I can make it work?

2
  • The error you get in PolkadotJS UI is Unroutable?
    – Alex Bean
    Commented Sep 14, 2023 at 16:44
  • Yup, that's the one! @AlexBean
    – chexware
    Commented Sep 14, 2023 at 16:51

2 Answers 2

0

It's because the missing xcm version in Rococo AssetHub.

Please check this issue: https://github.com/paritytech/polkadot-sdk/issues/1640

You can ask Rococo for help.

0

The problem seems to be fixed after updating the configuration of the following:

FungiblesTransactor

pub type FungiblesTransactor = FungiblesAdapter<
Assets,
ConvertedRegisteredAssetId<
    AssetIdForTrustBackedAssets,
    Balance,
    AsAssetMultiLocation<AssetIdForTrustBackedAssets, AssetRegistry>,
    JustTry,
>,
LocationToAccountId,
AccountId,
PlaceholderAccount,>;

Barrier

 pub type Barrier = TrailingSetTopicAsId<(
    TakeWeightCredit,
    AllowKnownQueryResponses<PolkadotXcm>,
    WithComputedOrigin<
        (
            AllowTopLevelPaidExecutionFrom<Everything>,
            AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
            AllowSubscriptionsFrom<ParentOrSiblings>,
        ),
        UniversalLocation,
        ConstU32<8>,
    >,
)>

IsReserve

pub type Reserves = (NativeAsset, ReserveAssetsFrom<AssetHubLocation>);

ROC will appear on the parachain if the asset MultiLocation is registered with an asset

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.