paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.78k stars 640 forks source link

[xcm] Investigate the possibility of `ProcessXcmMessage` / `XcmExecutor` emitting an event on failure. #2780

Open bkontur opened 9 months ago

bkontur commented 9 months ago

RIght now, we can see just success = false for MesssageQueue event in case of failure.

Relates to: https://github.com/paritytech/polkadot-sdk/issues/478

ggwpez commented 8 months ago

IIRC the original idea was that the message processor can emit events to notify the outside world of why an error happened.
Currently we use a freestanding struct as processor, hence it cannot emit events.
Now there could be a pallet (or using pallet-xcm) that emits an event in the error case. Not sure if this is ideal, but it is easier than trying to have an associated and aggregated error type.

Maybe instead of returning a bool it could also return an impl ProcessingError that can be converted to a bool but also has an ToString which can then be included in the error event from the MQ pallet. Sounds a bit hacky though since it would use strings.

xlc commented 8 months ago

who is this for? devs or indexers or users? if you just want to be able to debug issues, just add bunch logs

bkchr commented 8 months ago

Yeah it was about devs and logs are being added here: https://github.com/paritytech/polkadot-sdk/pull/2799

acatangiu commented 5 months ago

@xlc @bkchr logs only help in replays (try-runtime, chopsticks), but don't really improve UX for live chains - where users/dapps can see "live" why something fails.

If adding events is unwanted for some reason, maybe we can look at improving/enhancing error types and error messages (right now a lot of failure reasons result in same generic error).

Let me know what you think so we either close it or start working on smth here.

xlc commented 5 months ago

we could have new runtime API to dry run xcm and return detailed errors