v17.5.1 does not show correctly XCM messages
will-yjn opened this issue · 4 comments
Description
The subscan shows there is an XCM message that deposits 1 KSM to an account: https://kusama.subscan.io/xcm_message/kusama-68882b46f2567e950457e91afcf189c2cbfbf0a1
But querying the sidecar does not return expected result. Related to this issue: #1364
Steps to Reproduce
- Running the docker image v17.5.1 locally.
docker run --rm -it --read-only --env SAS_SUBSTRATE_URL=wss://kusama-rpc.polkadot.io -p 8080:8080 parity/substrate-api-sidecar:v17.5.1
- Send the request to query block 21548602.
curl -X GET "http://0.0.0.0:8080/blocks/21548602?decodedXcmMsgs=true" -H "accept: application/json"
Expected vs. Actual Behavior
Expect to see messages in decodedXcmMsgs
. Instead see empty arrays.
Thank you for your question @will-yjn
The reason you cannot find the upward message is because:
- In Subscan, the link/block you mentioned is where this XCM message was
processed
.- block 21548602 - messagequeue (Processed)
- In Sidecar, we show the block information and the XCM messages that were
included
/sent
in this block. So to find this XCM message, you will need to query 2 blocks back (when this XCM message was actually sent) :- block 21548600 - parainherent (enter)
- corresponding endpoint would be
http://0.0.0.0:8080/blocks/21548600?decodedXcmMsgs=true
Typically, when you know the block in which an XCM message was processed, you can look back 1 or 2 blocks to find when this same XCM message was sent.
Let us know if this answer covers your question so we can close the issue.
Thank you very much! I still have two questions:
- Is it always true that XCM will be processed 1 or 2 blocks after it was sent? Not 3 or more blocks?
- Can sidecar be sure the XCM will succeed when it is sent, since it is processed 2 blocks later?
- While this is often true (1 or 2 blocks), it is not guaranteed (there might cases that it is 3 or more - I personally haven't found). You need to manually scan the next blocks to determine when it was processed.
- Sidecar does not provide such guarantees (about the success or failure of the XCM message) nor XCM itself (XCM is asymmetric).
Just to clarify, the decoded XCM messages in the blocks
endpoint of Sidecar has the sole purpose of showing the XCM messages found/included within a block.
Below sharing some resources that can be helpful to understand better XCM and its functionalities: