-
Notifications
You must be signed in to change notification settings - Fork 740
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
[xcm-emulator] Better logs for message execution and processing #5712
Merged
Conversation
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
bkchr
reviewed
Sep 13, 2024
bkchr
approved these changes
Sep 18, 2024
acatangiu
approved these changes
Sep 19, 2024
acatangiu
added
the
A4-needs-backport
Pull request must be backported to all maintained releases.
label
Sep 19, 2024
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-5712-to-stable2407
git worktree add --checkout .worktree/backport-5712-to-stable2407 backport-5712-to-stable2407
cd .worktree/backport-5712-to-stable2407
git reset --hard HEAD^
git cherry-pick -x b230b0e32b8a12ab9b53b6a1040ba26a55704947
git push --force-with-lease |
github-actions bot
pushed a commit
that referenced
this pull request
Sep 19, 2024
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. (cherry picked from commit b230b0e)
Successfully created backport PR for |
acatangiu
pushed a commit
that referenced
this pull request
Sep 19, 2024
Backport #5712 into `stable2409` from franciscoaguirre. 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. Co-authored-by: Francisco Aguirre <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A4-needs-backport
Pull request must be backported to all maintained releases.
T6-XCM
This PR/Issue is related to XCM.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running XCM emulated tests and seeing the logs with
RUST_LOG=xcm
orRUST_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: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
, andhrmp
respectively. SoRUST_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 byxcm
. 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:
The HRMP and UMP ones are very similar.