-
Notifications
You must be signed in to change notification settings - Fork 129
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
Make pallets XCM compatible + less configuration overhead #2457
Comments
Also see this comment: #1657 (comment) |
Future #[pallet::config]
pub trait Config<I: 'static = ()>: frame_system::Config {
// General types
/// The overarching event type.
type RuntimeEvent: From<Event<Self, I>>
+ IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// Benchmarks results from runtime we're plugged into.
type WeightInfo: WeightInfoExt;
/// This chain type.
type ThisChain: ChainWithMessages;
/// Bridged chain type.
type BridgedChain: ChainWithMessages;
/// Bridged chain headers provider.
type BridgedHeaderChain: HeaderChain<Self::BridgedChain>;
/// Get all active outbound lanes that the message pallet is serving.
type ActiveOutboundLanes: Get<&'static [LaneId]>;
/// Payload type of outbound messages. This payload is dispatched on the bridged chain.
type OutboundPayload: Parameter + Size;
/// Payload type of inbound messages. This payload is dispatched on this chain.
type InboundPayload: Decode;
/// Handler for relayer payments that happen during message delivery transaction.
type DeliveryPayments: DeliveryPayments<Self::AccountId>;
/// Handler for relayer payments that happen during message delivery confirmation
/// transaction.
type DeliveryConfirmationPayments: DeliveryConfirmationPayments<Self::AccountId>;
/// Message dispatch handler.
type MessageDispatch: MessageDispatch<DispatchPayload = Self::InboundPayload>;
}
} |
The main part of this issue is fixed. I've decided to leave Regarding the first point (merging |
Working on #2213, I think the best way would be to:
|
We've removed a lot of code (#1638) because the architecture has been changed significantly. And now we have some options to make pallets configuration easier. That's a task for the future (after initial deployment), but I'm gonna leave some ideas here:
MultiLocation
,ChainId
andLaneId
. The idea is that we'll have two bridge hubs, which will be used to build bridges between different parachains. Every bridge now (not at the code, but in plans) uses types in following matter: every parachain (bridge hubs, Statemin?, ...) all have XCM "addresses" (MultiLocations
), bridge hubs also haveChainId
s and every bridge will be assigned a single lane (e.g. Statimine <> Statemint will be using lane0x00000000
). We may removeChainId
andLaneId
types and instead use pair ofMultiLocation
s (or whatever is used to identify chains in global consensus);bridge-runtime-common
code to the messaging pallet and then we'll be able to replace most of configuration options and glue code by adding singletype BridgedChain = SomeBridgedChain;
. This would also allow us to implement things like Signed extension to refund relayer at the target chain #1657 easier;Things to do after refactoring:
VerificationError
and move all variants to the pallet errors?The text was updated successfully, but these errors were encountered: