Tool to dry run XCM transactions

I implemented the system_dryRun RPC in Substrate to allow dry run a transaction to detect if it is going to fail, in the hope that we could use it in frontend to warn user when they are sending a transaction that’s going to fail.

However, due to number of reasons the current form is not very useful and not used much.

But even it is fully functional, it still won’t help the case of a failing XCM transaction. We had a bug report that, someone XCM send 1.004 DOT from Acala to Polkadot. The transaction is successful on Acala side. However due to increased tx fee on Polkadot side, the deposit amount become less than 1 DOT, and therefore failed in this case due to the dest account is an empty account.

While it is possible to improve the frontend to more accurately estimate the tx fees, it is simply not scalable. Every parachain and different tx fee amount and ED amount. It is simply infeasible to require the bridge UI to understand all those rules, which can change from time to time.

I think the proper way to handle such case is allow the frontend to dry run the transaction, both on source chain and receiving chain. Then it is possible to present to user with a changed storages with human readable names for confirmation.

This could be just another use case of Chopsticks.

4 Likes