I'm trying to enforce a same native token
rule for the relay and all future parachains in my local environment. For this, I must first configure my parachain to accept teleports from a relay account to a parachain account.
I saw that natively the cumulus template parachain has teleported disabled:
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
...
type IsTeleporter = (); // Teleporting is disabled.
...
So I enabled teleports from the relay chain (0.9.20 fork) by coding the following:
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
...
type IsTeleporter = (xcm_builder::Case<DotFromPolkadot>,);
...
parameter_types! {
pub const DotLocation: MultiLocation = MultiLocation::parent();
pub const Polkadot: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(DotLocation::get()) });
pub const DotFromPolkadot: (MultiAssetFilter, MultiLocation) = (Polkadot::get(), DotLocation);
}
/// Parachain recognizes the relay chain as a teleporter.
pub type TrustedTeleporters = (xcm_builder::Case<DotFromPolkadot>,);
From what I understood the actual execution of teleporting is already implemented in the xcm pallet, and all I have to do is configure it in this xcm_config.rs inside the runtime folder.
But when running a teleport using the frontend of polkador.js.apps, it makes the runtime panic with the following message:
2022-07-28 11:22:24.026 ERROR tokio-runtime-worker runtime: [Parachain] panicked at 'assertion failed: `(left == right)`
left: `0x01992e7b9de1178b594c0a24dc30f820d61caad33f9fda514c93c9400426d1cd`,
right: `0x0000000000000000000000000000000000000000000000000000000000000000`', /Users/juan/.cargo/git/checkouts/cumulus-59522f43471fa161/4bbedb3/pallets/parachain-system/src/lib.rs:774:9
2022-07-28 11:22:24.026 WARN tokio-runtime-worker sc_basic_authorship::basic_authorship: [Parachain] ❗️ Inherent extrinsic returned unexpected error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:
0: 0x1bd944 - <unknown>!rust_begin_unwind
. Dropping.
2022-07-28 11:22:24.026 ERROR tokio-runtime-worker runtime: [Parachain] panicked at 'set_validation_data inherent needs to be present in every block!', /Users/juan/.cargo/git/checkouts/cumulus-59522f43471fa161/4bbedb3/pallets/parachain-system/src/lib.rs:143:13
2022-07-28 11:22:24.026 WARN tokio-runtime-worker aura: [Parachain] Proposing failed: Import failed: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:
0: 0x1bd944 - <unknown>!rust_begin_unwind
Is this because the actual teleporting logic is not implemented? or what do I have to do to enable this? Any help or direction would be appreciated.
Also if you know resources on how to implement having the same token shared between all parachains and relay chain it would be a big help!