-
Notifications
You must be signed in to change notification settings - Fork 0
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
Inbound queue v2 #3
base: outbound-queue-v2
Are you sure you want to change the base?
Conversation
Co-authored-by: Vincent Geddes <[email protected]>
…-sdk into outbound-queue-v2
Co-authored-by: Vincent Geddes <[email protected]>
ca8e226
to
0e9cca0
Compare
MAX_XCM_DECODE_DEPTH, | ||
&mut message.xcm.as_ref(), | ||
) | ||
.map_err(|_| Error::<T>::InvalidPayload)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not fail on Invalid xcm. We should rather build the xcm payload without appending anything. This will allow the assets to get trapped on assethub.
&mut message.xcm.as_ref(), | ||
) | ||
.map_err(|_| Error::<T>::InvalidPayload)?; | ||
let xcm: Xcm<()> = versioned_xcm.try_into().map_err(|_| <Error<T>>::InvalidPayload)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Any issues parsing the XCM should result in assets getting trapped on Asset Hub.
// Todo: Deposit fee(in Ether) to RewardLeger which should cover all of: | ||
// T::RewardLeger::deposit(who, envelope.fee.into())?; | ||
// a. The submit extrinsic cost on BH | ||
// b. The delivery cost to AH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The xcm can be built here without the need for XCM v5 and we can re-do later when XCM v5 is ready.
You will need to parse the Assets in the ticket and build the following XCM to send to asset hub:
ReceiveTeleportedAsset(asset_hub_fees)
BuyExecution(fees: asset_hub_fees)
DescendOrigin(PalletInstance(inbound_queue_pallet_index))
UniversalOrigin(GlobalConsensus(network))
ReserveAssetDeposited(erc20_assets) // from assets that do not have tokenId
WithdrawAsset(pna_assets) // from assets that do have tokenId
DescendOrigin(msg_sender)
You can then append the xcm from the payload to this base xcm. If the xcm payload fails to be parsed, append nothing and send to asset hub anyway, this will cause the assets to get trapped on asset hub.
fffd895
to
df137c0
Compare
No description provided.