Add HOLLAR routes between Hydration and AssetHub#343
Open
hitchho wants to merge 3 commits into
Open
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds XCM support for HOLLAR (Hydration asset 222 / AssetHub foreign asset
{Parachain(2034), GeneralIndex(222)}) between Hydration and AssetHub, both directions.hollarasset + registration on both chains (18 decimals, 0.02 ED/minBalance, verified on-chain)0x531a654d1696ED52e7275A8cede955E82620f99a) viabalanceId+evm().erc20()DestinationReserve(burns the hub derivative, withdraws from AssetHub's sovereign on Hydration), dest fee 0.02 HOLLARLocalReservefor the asset with the destination fee paid in DOT viaDestinationReserve— HOLLAR has no fee-payment pool on AssetHub (BuyExecutionin HOLLAR failsTooExpensive, verified viaDryRunApi.dry_run_xcm). This required a small builder extension: optionalfeesTransferTypeonpolkadotXcm().transferAssetsUsingTypeAndThen()(maps to the pallet's nativefees_transfer_typearg)Bug fixes surfaced along the way
transferAssetsUsingTypeAndThenemitted unsortedAssetsvectors. The runtime only decodesAssetssorted by canonicalLocationorder, and the builder unconditionally placed the fee first. Any fee/asset pair ordered the wrong way (e.g. DOTparents:1fee with aparents:0local asset) produced an extrinsic the runtime rejects with an opaque wasm trap (Bad input data) in bothDryRunApiandvalidate_transaction. Added a canonical location comparator (parents → interior arity → junction variant/value, mirroring the runtime's derivedOrd) and order the pair accordingly. This was originally misdiagnosed as a runtime issue — see Not a bug: unsorted XCM v4 Assets vector fails SCALE decode, surfaces as opaque wasm trap (client-side, fixed in sdk#343) hydration-node#1491 (closed with the analysis)HydrationEvmResolver.toH160was wrong for native substrate accounts: it unconditionally unwrapped bytes4..-8, which is only correct forETH\0-prefixed EVM accounts; native accounts must truncate to the first 20 bytes (mirrorspallet-evm-accounts::evm_address). Needed for erc20 balance reads of substrate-held HOLLARVerification (mainnet dry runs)
assethub → hydration:dry_run_callon AssetHub succeeds (ForeignAssets burn) and the forwarded XCM executesCompleteon Hydration viadry_run_xcm. AssetHub's sovereign on Hydration backs the hub supply 1:1 (~417k HOLLAR)hydration → assethub:dry_run_callon Hydration succeeds (DOT fee + erc20 HOLLAR withdrawn to AH sovereign,WithdrawAsset(DOT) → BuyExecution(DOT) → ReserveAssetDeposited(HOLLAR) → DepositAssetforwarded) and the forwarded XCM executesCompleteon AssetHub viadry_run_xcm