-
Notifications
You must be signed in to change notification settings - Fork 741
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
[Snowbridge]: Ensure source always from AH for exported message #6838
base: master
Are you sure you want to change the base?
Conversation
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.
I think it's wrong to enforce this rule at the router level:
- maybe some other chain wants to use this router primitive with another bridge (unlikely)
- maybe we change the router in the AH runtime and the new one doesn't validate this bridge-specific rule (likely)
- XCM goes to bridge on Bridge Hub through another path than this router and this rule is not enforced (potentially dangerous)
This rule should definitely be enforced by the bridge itself on Bridge Hub. We can have the router also enforce it in order to fail early, fail at AH instead of failing on the next hop on BH. If this is the case, then the impl details comments below apply.
@@ -20,6 +20,8 @@ use sp_std::{iter::Peekable, marker::PhantomData, prelude::*}; | |||
use xcm::prelude::*; | |||
use xcm_executor::traits::{ConvertLocation, ExportXcm}; | |||
|
|||
pub const ASSET_HUB_PARA_ID:u32 = 1000; |
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.
It is an anti-pattern to hardcode para-id constants in these types of primitives that could be in theory reused in other scenarios.
In practice this is fine, but the used pattern is to make this a generic parameter so it can be customized by the runtime.
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.
Thanks. Yeah, just a workaround before getting some feedback.
Fixed in 277d51b
Co-authored-by: Adrian Catangiu <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
IIUC |
…ot-sdk into check-souce-from-ah
> | ||
where | ||
UniversalLocation: Get<InteriorLocation>, | ||
EthereumNetwork: Get<NetworkId>, | ||
OutboundQueue: SendMessage<Balance = u128>, | ||
AgentHashedDescription: ConvertLocation<H256>, | ||
ConvertAssetId: MaybeEquivalence<TokenId, Location>, | ||
AssetHubParaId: Get<ParaId>, |
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.
AssetHubParaId: Get<ParaId>, | |
WhitelistedParaId: Get<ParaId>, |
Resolves:
https://linear.app/snowfork/issue/SNO-1243
https://linear.app/snowfork/issue/SNO-1242