-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[xcm-emulator] Better logs for message execution and processing (#5712)
When running XCM emulated tests and seeing the logs with `RUST_LOG=xcm` or `RUST_LOG=xcm=trace`, it's sometimes a bit hard to figure out the chain where the logs are coming from. I added a log whenever `execute_with` is called, to know the chain which makes the following logs. Looks like so: <img width="1499" alt="Screenshot 2024-09-13 at 20 14 13" src="https://github.com/user-attachments/assets/a31d7aa4-11d1-4d3e-9a65-86f38347c880"> There are already log targets for when UMP, DMP and HRMP messages are being processed. To see them, you have to use the log targets `ump`, `dmp`, and `hrmp` respectively. So `RUST_LOG=xcm,ump,dmp,hrmp` would let you see every log. I prefixed the targets with `xcm::` so you can get all the relevant logs just by filtering by `xcm`. You can always use the whole target to see just the messages being processed. These logs showed the message as an array of bytes, I made them show a hexadecimal string instead since that's easier to copy in case you want to decode it or use it in another tool. They look like this now: <img width="1499" alt="Screenshot 2024-09-13 at 20 17 15" src="https://github.com/user-attachments/assets/5abf4a97-1ea7-4832-b3b0-d54c54905d1a"> The HRMP and UMP ones are very similar.
- Loading branch information
1 parent
69b02a3
commit b230b0e
Showing
4 changed files
with
44 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: Better logs for XCM emulator | ||
|
||
doc: | ||
- audience: Runtime Dev | ||
description: | | ||
Now the XCM emulator has a log every time `execute_with` is called, to know | ||
which chain is being used. | ||
Also, the logs for UMP, DMP, HRMP processing were included in the `xcm` log filter | ||
and changed from showing the message as an array of bytes to a hex string. | ||
This means running the tests with `RUST_LOG=xcm` should give you everything you need, | ||
you can always filter by `RUST_LOG=xcm::hrmp` or any other if you need it. | ||
|
||
crates: | ||
- name: xcm-emulator | ||
bump: patch |