5

What happens if an XCM is sent from blockchain A to blockchain B before finalisation, and then the block on blockchain A is reverted? Is blockchain's B block also reverted?

Is it safe to assume that there can be no inconsistencies arising from such scenario? E.g. an asset transfer reverted on chain A but still executed on chain B?

3

2 Answers 2

1

Have into account that the whole communication model around XCM is asynchronous, so from the PoV of parachain A sending a message to parachain B, most likely all its responsibility and all it should be concerned about is that this concrete message is sent, it doesn't really care about the outcomes of executing said message at destination.

XCVM allows to check the status of a certain transaction or report it, but in the above scenario how the state of parachain A advances its completely independent to what is happening on parachain B.

5
  • But I've never seen any special measures taken especially when it comes to asset transfers, which makes me think the underlying model is safe against forks and rollbacks, otherwise you could end up losing assets if they're burnt on one chain and then not really deposited into the other. Not talking about how the state is changes on either chain, but rather how those changes are reverted. Jun 1, 2023 at 6:55
  • If you read the documentation for Teleport in xcm-format it reads This is only possible if there is a bilateral trust relationship both of the STF and the validity/finality/availability between them. So, indeed, you should only go for a burn & mint approach when there is trust, otherwise this is a very bad idea. As an "example of trust" assets system chain (Statemint) and Polkadot allow teleportation of assets as they are controlled by the same governance, hence you can trust Jun 1, 2023 at 13:46
  • Yes but I am not talking about the trust between chains. I am talking about the case where you send tokens to a reserve account, so in an untrusted environment, and then for some reason the other chain where the funds have been sent is reverted. I would expect the transfer from the source chain to also be reverted. My point has nothing to do with the trust relationship between the two chains, but rather on the consequences of state rollbacks on either of them, regardless of the trust between them. Jun 2, 2023 at 14:02
  • Right, so this is taken care of directly by the protocol. When parachain B is crating a block on top of relay parent #101, can say that it has acted on all messages up to relay parent #100. Parachain B is acting on messages part of a parachain block from para A only if A's block header appeared in the relay block 100 or earlier. So, only acting on messages that are part of finalised blocks. Eventually para B creates its latest block and it will be passed to para validators to finalise it, everything that is final cannot be reverted. Jun 6, 2023 at 9:31
  • It feels your question has more to do with if parachains can revert state, and how does it look than anything XCM. Jun 6, 2023 at 9:33
1

As Alejandro said above, this is outside the scope of XCM. XCM is just a message format and it assumes that there is a transport layer to transfer the XCM messages from chain A to chain B.

I recommend you to read this article to get an idea on how messages (XCM or any arbitrary information) can be passed among parachains with no additional trust assumptions beyond the economic security of the relay chain:

https://medium.com/web3foundation/polkadots-messaging-scheme-b1ec560908b7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.