-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add pallet-omni-bridge #3223
Add pallet-omni-bridge #3223
Conversation
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] | ||
pub enum ChainType { | ||
Heima, // this chain | ||
Ethereum(u32), // with chain id |
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.
If adding new variant here is the only change needed to be made in order to support new chain type I would suggest using something more generic
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] | ||
pub struct ChainAsset<AssetKind> { | ||
pub chain: ChainType, | ||
pub asset: AssetKind, |
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 we are currently using different pallets to register/create assets, it would be great to streamline creating assets for bridging via this bridge such that it's easier to create and manage assets accordingly.
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.
This might require another pallet - something like asset manager/registry.
I intentionally decouple it from this bridge pallet (initially I have something like create_local_asset
and then removed it), this pallet handles bridging only but not creation/deletion of assets.
It only cares if an asset exists and can be mutated.
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.
So far we are good with Balances
and Assets
- I can imagine if we have XCM assets we might need a dedicated pallet to manage them all
Context
fixes P-1261
It's a rewriting/refactoring of the old bridge pallet for chainsafe, it tries to be as chainsafe-friendly as possible as we are still going to use chainsafe contracts on eth side (due to time pressure), main changes:
(*) please check the code logic - theoretically it might happen that the cleanup takes too much time (as it would go through too many loops), but in practice, there's very low chance that it would happen, it would imply the majority of relayers malfunctions.
Still, we could add some improvements later to bound the execution time.