Skip to content

Commit 03f5577

Browse files
JuaniRiosbkontur
authored andcommitted
Add HRMP notification handlers to the xcm-executor (#3696)
Currently the xcm-executor returns an `Unimplemented` error if it receives any HRMP-related instruction. What I propose here, which is what we are currently doing in our forked executor at polimec, is to introduce a trait implemented by the executor which will handle those instructions. This way, if parachains want to keep the default behavior, they just use `()` and it will return unimplemented, but they can also implement their own logic to establish HRMP channels with other chains in an automated fashion, without requiring to go through governance. Our implementation is mentioned in the [polkadot HRMP docs](https://arc.net/l/quote/hduiivbu), and it was suggested to us to submit a PR to add these changes to polkadot-sdk. --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: command-bot <>
1 parent 867edcd commit 03f5577

36 files changed

Lines changed: 196 additions & 5 deletions

File tree

cumulus/pallets/xcmp-queue/src/mock.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ impl xcm_executor::Config for XcmConfig {
175175
type SafeCallFilter = Everything;
176176
type Aliasers = Nothing;
177177
type TransactionalProcessor = FrameTransactionalProcessor;
178+
type HrmpNewChannelOpenRequestHandler = ();
179+
type HrmpChannelAcceptedHandler = ();
180+
type HrmpChannelClosingHandler = ();
178181
}
179182

180183
pub type XcmRouter = (

cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,9 @@ impl xcm_executor::Config for XcmConfig {
628628
type SafeCallFilter = SafeCallFilter;
629629
type Aliasers = Nothing;
630630
type TransactionalProcessor = FrameTransactionalProcessor;
631+
type HrmpNewChannelOpenRequestHandler = ();
632+
type HrmpChannelAcceptedHandler = ();
633+
type HrmpChannelClosingHandler = ();
631634
}
632635

633636
/// Converts a local signed origin into an XCM location.

cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,9 @@ impl xcm_executor::Config for XcmConfig {
649649
type SafeCallFilter = SafeCallFilter;
650650
type Aliasers = Nothing;
651651
type TransactionalProcessor = FrameTransactionalProcessor;
652+
type HrmpNewChannelOpenRequestHandler = ();
653+
type HrmpChannelAcceptedHandler = ();
654+
type HrmpChannelClosingHandler = ();
652655
}
653656

654657
/// Local origins on this chain are allowed to dispatch XCM sends/executions.

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ impl xcm_executor::Config for XcmConfig {
336336
type SafeCallFilter = SafeCallFilter;
337337
type Aliasers = Nothing;
338338
type TransactionalProcessor = FrameTransactionalProcessor;
339+
type HrmpNewChannelOpenRequestHandler = ();
340+
type HrmpChannelAcceptedHandler = ();
341+
type HrmpChannelClosingHandler = ();
339342
}
340343

341344
pub type PriceForParentDelivery =

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ impl xcm_executor::Config for XcmConfig {
264264
type SafeCallFilter = SafeCallFilter;
265265
type Aliasers = Nothing;
266266
type TransactionalProcessor = FrameTransactionalProcessor;
267+
type HrmpNewChannelOpenRequestHandler = ();
268+
type HrmpChannelAcceptedHandler = ();
269+
type HrmpChannelClosingHandler = ();
267270
}
268271

269272
pub type PriceForParentDelivery =

cumulus/parachains/runtimes/collectives/collectives-westend/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ impl xcm_executor::Config for XcmConfig {
288288
type SafeCallFilter = SafeCallFilter;
289289
type Aliasers = Nothing;
290290
type TransactionalProcessor = FrameTransactionalProcessor;
291+
type HrmpNewChannelOpenRequestHandler = ();
292+
type HrmpChannelAcceptedHandler = ();
293+
type HrmpChannelClosingHandler = ();
291294
}
292295

293296
/// Converts a local signed origin into an XCM location.

cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ impl xcm_executor::Config for XcmConfig {
197197
type SafeCallFilter = Everything;
198198
type Aliasers = Nothing;
199199
type TransactionalProcessor = FrameTransactionalProcessor;
200+
type HrmpNewChannelOpenRequestHandler = ();
201+
type HrmpChannelAcceptedHandler = ();
202+
type HrmpChannelClosingHandler = ();
200203
}
201204

202205
/// Converts a local signed origin into an XCM location.

cumulus/parachains/runtimes/coretime/coretime-rococo/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ impl xcm_executor::Config for XcmConfig {
257257
type SafeCallFilter = SafeCallFilter;
258258
type Aliasers = Nothing;
259259
type TransactionalProcessor = FrameTransactionalProcessor;
260+
type HrmpNewChannelOpenRequestHandler = ();
261+
type HrmpChannelAcceptedHandler = ();
262+
type HrmpChannelClosingHandler = ();
260263
}
261264

262265
/// Converts a local signed origin into an XCM location. Forms the basis for local origins

cumulus/parachains/runtimes/coretime/coretime-westend/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ impl xcm_executor::Config for XcmConfig {
269269
type SafeCallFilter = SafeCallFilter;
270270
type Aliasers = Nothing;
271271
type TransactionalProcessor = FrameTransactionalProcessor;
272+
type HrmpNewChannelOpenRequestHandler = ();
273+
type HrmpChannelAcceptedHandler = ();
274+
type HrmpChannelClosingHandler = ();
272275
}
273276

274277
/// Converts a local signed origin into an XCM location. Forms the basis for local origins

cumulus/parachains/runtimes/glutton/glutton-westend/src/xcm_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ impl xcm_executor::Config for XcmConfig {
8888
type SafeCallFilter = Everything;
8989
type Aliasers = Nothing;
9090
type TransactionalProcessor = FrameTransactionalProcessor;
91+
type HrmpNewChannelOpenRequestHandler = ();
92+
type HrmpChannelAcceptedHandler = ();
93+
type HrmpChannelClosingHandler = ();
9194
}
9295

9396
impl cumulus_pallet_xcm::Config for Runtime {

0 commit comments

Comments
 (0)