Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MM2 doesn't retry querying electrums on failed RPC requests #1126

Open
artemii235 opened this issue Nov 8, 2021 · 8 comments · May be fixed by #2280
Open

MM2 doesn't retry querying electrums on failed RPC requests #1126

artemii235 opened this issue Nov 8, 2021 · 8 comments · May be fixed by #2280
Labels

Comments

@artemii235
Copy link
Member

More info in Discord DM.

@sergeyboyko0791
Copy link

@artemii235 did the user get in touch?

@artemii235
Copy link
Member Author

@sergeyboyko0791 Could you please DM cipi on Discord in regards to it?

@artemii235
Copy link
Member Author

@sergeyboyko0791 Any updates? 🙂

@sergeyboyko0791
Copy link

If I'm not mistaken, the user has refunded his payment.
@cipig could you please confirm this?

@cipig
Copy link
Member

cipig commented Jun 21, 2022

user (taker) has spent makerpayment one week later
https://kmdexplorer.io/address/bJ8tZio1PZZEhdw4CJxauEWYtdHqESNsQm is the KMD address from that swap, maker RB8yufv3YTfdzYnwz5paNnnDynGJG6WsqD sent makerpayment, user RT3WtuEPyxPojQHsQPPP7HWviXA23DLr43 spent it one week later
this is the initial sequence on taker side

      {
         "timestamp" : 1636051505007,
         "event" : {
            "type" : "TakerPaymentWaitForSpendFailed",
            "data" : {
               "error" : "swap:319] swap:756] history:679] JsonRpcError { client_info: \"coin: QC\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"24798\", method: \"blockchain.contract.event.get_history\", params: [String(\"1462c3dd3f936d595c9af55978003b27c250441f\"), String(\"f2033ede578e17fa6231047265010445bca8cf1c\"), String(\"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\")] }, error: Transport(\"rpc_clients:1258] rpc_clients:1260] [\\\"rpc_clients:2097] rpc_clients:2095] 20s timed out waiting for the future to complete\\\", \\\"rpc_clients:2097] rpc_clients:2095] 20s timed out waiting for the future to complete\\\", \\\"rpc_clients:2097] rpc_clients:2095] 20s timed out waiting for the future to complete\\\"]\") }"
            }
         }
      },
      {
         "event" : {
            "type" : "TakerPaymentWaitRefundStarted",
            "data" : {
               "wait_until" : 1636079813
            }
         },
         "timestamp" : 1636051505008
      },
      {
         "event" : {
            "type" : "TakerPaymentRefundFailed",
            "data" : {
               "error" : "taker_swap:1219] swap:99] Payment state is not PAYMENT_STATE_SENT, got 2"
            }
         },
         "timestamp" : 1636076114083
      },

the TakerPaymentWaitForSpendFailed error was because of timeouts on the electrums, but the tx was sent and later spent by the maker https://qtum.info/tx/e49635badde717d97179672ef6d077f659ab3d5c305ae1368f4de2fd5aa0512f
swap uuid was 7426a8af-bb9b-4ee1-85f7-f04f4e2bd6ac btw, but it does not contain infos on how the taker was able to finally spend the makerpayment

@artemii235
Copy link
Member Author

@cipig @sergeyboyko0791 Can we close this?

@sergeyboyko0791
Copy link

I rechecked it, and this issue is not related to QRC20 protocol.

The only problem is that we stop the swap and try to refund payments if an RPC request fails (in this case Electrum timeout).
Probably we need to try multiple times to execute Electrum/HTTP requests during the swap.

@artemii235
Copy link
Member Author

The only problem is that we stop the swap and try to refund payments if an RPC request fails (in this case Electrum timeout).

Yeah, if it's transport error, then we should retry (maybe unlimited times before timeout). This can even be a good test task.

@mariocynicys mariocynicys changed the title MM2 failed to detect QRC20 payment spend on swap. Recovery attempts also fail. MM2 doesn't retry querying electrums on failed RPC requests Dec 4, 2024
@onur-ozkan onur-ozkan added bug: RPC and removed bug labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants