comit-network / xmr-btc-swap

Bitcoin–Monero Cross-chain Atomic Swap
GNU General Public License v3.0
657 stars 84 forks source link

Swap fails immediately after deposit with deserialization error #661

Open sethforprivacy opened 3 years ago

sethforprivacy commented 3 years ago

Note: I am opening this for another user who isn't comfortable posting here, but will do my best to relay questions/requests and respond promptly.

A user who attempted to swap with my ASB ran into a new issue I have not seen. When the user started the swap and deposited funds, the swap tool immediately crashed with the following output:

image

After this failure they attempted to resume/cancel/refund but the swap is not in the swap tool's history/DB:

./swap history                                              
+---------+-------+
| SWAP ID | STATE |
+=================+
+---------+-------+
./swap resume --swap-id REDACTED
Error: Swap with id REDACTED not found in database
./swap cancel --swap-id REDACTED
Error: Swap with id REDACTED not found in database
./swap refund --swap-id REDACTED
Error: Swap with id REDACTED not found in database

The only other logs for the swap are:

./swap list-sellers --rendezvous-point /dnsaddr/rendezvous.coblox.tech/p2p/12D3KooWQUt9DkNZxEn2R5ymJzWj15MpG6mTW84kyd8vDaRZi46o
Parent directory does not exist, creating recursively directory=REDACTED
Connected to rendezvous point, discovering nodes in 'xmr-btc-swap-mainnet' namespace ...
Discovered peer 12D3KooWCPcfhr6e7V7NHoKWRxZ5zPRr6v5hGrVPhHdsftQk2DXW at /dnsaddr/swap.sethforprivacy.com/p2p/12D3KooWCPcfhr6e7V7NHoKWRxZ5zPRr6v5hGrVPhHdsftQk2DXW
Discovered peer 12D3KooWAPci3x4GuWDi9P86efnR1q9a7phKnPwnwQcRNMW2HDUy at /ip4/51.15.44.142/tcp/9939
+----------------+----------------+----------------+--------+-------------------------------------------------------------------------------------------+
| PRICE          | MIN_QUANTITY   | MAX_QUANTITY   | STATUS | ADDRESS                                                                                   |
+=======================================================================================================================================================+
| 0.00586950 BTC | 0.00010000 BTC | 0.00190000 BTC | Online | /ip4/51.15.44.142/tcp/9939/p2p/12D3KooWAPci3x4GuWDi9P86efnR1q9a7phKnPwnwQcRNMW2HDUy       |
|----------------+----------------+----------------+--------+-------------------------------------------------------------------------------------------|
| 0.00642850 BTC | 0.00050000 BTC | 0.00100000 BTC | Online | /dnsaddr/swap.sethforprivacy.com/p2p/12D3KooWCPcfhr6e7V7NHoKWRxZ5zPRr6v5hGrVPhHdsftQk2DXW |
+----------------+----------------+----------------+--------+-------------------------------------------------------------------------------------------+

The most pressing concern is how to help the user recover funds, but also would love to get to the bottom of this.

Will reach out to the user and try to get host/OS/arch/version info.

sethforprivacy commented 3 years ago

OS/version details:

OS = Manjaro Arch = x86_64 Swap tool = 0.8.1

thomaseizinger commented 3 years ago

What is the result of:

The most pressing concern is how to help the user recover funds, but also would love to get to the bottom of this.

Funds are safe as long as the user doesn't delete their data directory. If there isn't a swap in the database, the funds are sitting in the internal wallet and can be used for the next swap.

We may need to add some emergency recovery commands to display that balance / withdraw it.

sethforprivacy commented 3 years ago

What is the result of:

  • swap --version for the user?

swap 0.8.1

  • asb --version on your end?

ASB 0.8.1

binarybaron commented 3 years ago

I noticed that this error also occurs when the asb sets target_block=0 in its config.toml. The asb fails to estimate a proper fee and the swap cli gives an error. This is probably not what happened here, but it could be a clue as to why this error occurs.

TechnicalSuwako commented 3 years ago

Funds are safe as long as the user doesn't delete their data directory. If there isn't a swap in the database, the funds are sitting in the internal wallet and can be used for the next swap.

Can you please teach how to get funds back or complete?

thomaseizinger commented 3 years ago

Funds are safe as long as the user doesn't delete their data directory. If there isn't a swap in the database, the funds are sitting in the internal wallet and can be used for the next swap.

Can you please teach how to get funds back or complete?

If you trigger another swap, the funds should be used for that.

TechnicalSuwako commented 3 years ago

Funds are safe as long as the user doesn't delete their data directory. If there isn't a swap in the database, the funds are sitting in the internal wallet and can be used for the next swap.

Can you please teach how to get funds back or complete?

If you trigger another swap, the funds should be used for that.

Success! Thank you very much!

ElectricityMachine commented 3 years ago

I can confirm this issue is still happening on Windows 10 x64, ver 0.9.0 of swap-cli. Steps to reproduce:

  1. Run swap.exe buy-xmr --receive-address [REDACTED] --change-address [REDACTED] --seller {tested with 3 different sellers}
  2. Deposit BTC when you connect to the seller
  3. The wallet registers the transaction, outputs the error, and now you MUST do swap.exe withdraw-btc. None of the other commands to cancel or resume the swap are valid because there is no swap ID.

I lost a good chunk of change due to fees, but quickly realized I should stop using this tool until it gets fixed before I lost even more BTC, or worse, lost the full amount I wanted to swap.

ghost commented 3 years ago

but --rendezvous-point is not an option for swap buy-xmr

ElectricityMachine commented 3 years ago

but --rendezvous-point is not an option for swap buy-xmr

My bad, it should be --seller, not --rendezvous-point. Edited the command to reflect that. I had to manually type it in.