-
Notifications
You must be signed in to change notification settings - Fork 808
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 "Sent" event when a message is sent via execute #6851
Comments
Can we make the executor emit events? I believe there are multiple places in the executor where we should emit events for visibility and traceability - ideally executor would emit these directly. Otherwise, we can go with your first suggestion and add config |
Events are a FRAME concept. The executor uses the config for accessing these functionalities so I think we should use that mechanism for events. A single config for emitting all events might be a good compromise. However, this would be a breaking change. We could do that for |
I would go with the proper change even if it is braking and thus cannot be backported. I would prefer to avoid technical debt where we can, and this issue doesn't look urgent enough to warrant taking on temporary workarounds. So, I ultimately support your option 1: add config |
Working on this one |
Hi @jpserrat. Thanks for wanting to work on this! Don't forget to reach out if you need any more pointers. We should add this |
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: