Add "Sent" event when a message is sent via execute #6851
Labels
C1-mentor
A task where a mentor is available. Please indicate in the issue who the mentor could be.
C2-good-first-issue
A task for a first time contributor to become familiar with the Polkadot-SDK.
I5-enhancement
An additional feature request.
T6-XCM
This PR/Issue is related to XCM.
With the extrinsics in pallet-xcm, we always emit the
Sent
event when a message is sent as a result of our actions:polkadot-sdk/polkadot/xcm/pallet-xcm/src/lib.rs
Line 1825 in 48c6574
We're moving towards a future where we encourage the usage of
pallet-xcm.execute()
over highly specialized extrinsics. One missing piece for this is that when calling execute, no event is emitted when a message is sent.We should emit the
Sent
event everytime execution results in sending a message:polkadot-sdk/polkadot/xcm/xcm-executor/src/lib.rs
Line 417 in 48c6574
The problem with this is that emitting events is something pallets do, not the executor, so we don't have access to it. We have access to the
XcmRouter
which delivers the message.We have to give the executor access to the pallet in some way.
Two ways that I see of doing this:
EventEmitter
, which we can plug in and use to emit the event we want. Downside of this is it's a breaking change since we add a new associated type to the config.ParentAsUmp
and then use that to emit events. With this we don't introduce a breaking change but still manage to emit events as long as our routers have this logic.The text was updated successfully, but these errors were encountered: