# Tool to dry run XCM transactions

**URL:** https://forum.polkadot.network/t/tool-to-dry-run-xcm-transactions/1075
**Category:** Tech Talk
**Tags:** xcm
**Created:** [November 15, 2022, 2:45am UTC](https://forum.polkadot.network/t/tool-to-dry-run-xcm-transactions/1075 "2022-11-15T02:45:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xlc](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/xlc/32/690_2.png) [@xlc](https://forum.polkadot.network/u/xlc)
#### Post date: [November 15, 2022, 2:45am UTC](https://forum.polkadot.network/t/tool-to-dry-run-xcm-transactions/1075/1 "2022-11-15T02:45:05Z")

</div>

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](http://github.com/AcalaNetwork/chopsticks).

---

<div class="post-metadata">

### Author: ![acatangiu](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/acatangiu/32/540_2.png) [@acatangiu](https://forum.polkadot.network/u/acatangiu)
#### Post date: [May 10, 2024, 11:01am UTC](https://forum.polkadot.network/t/tool-to-dry-run-xcm-transactions/1075/2 "2024-05-10T11:01:40Z")

</div>

This is now fully possible (and easy) with [Chopsticks](https://github.com/AcalaNetwork/chopsticks).

It is also available as [Runtime APIs](https://github.com/paritytech/polkadot-sdk/pull/3872) (which can be used to build nice UIs or by wallets directly).
