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

maker failed PLG20 swap saying that tx was not found on RPC node #1630

Closed
cipig opened this issue Jan 23, 2023 · 5 comments
Closed

maker failed PLG20 swap saying that tx was not found on RPC node #1630

cipig opened this issue Jan 23, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request Good test task

Comments

@cipig
Copy link
Member

cipig commented Jan 23, 2023

maker failed a PLG20 swap because tx sent by taker was not found on the RPC node

the relevant part in maker's swap json:

      {
         "event" : {
            "type" : "TakerPaymentWaitConfirmStarted"
         },
         "timestamp" : 1674500829257
      },
      {
         "timestamp" : 1674500845249,
         "event" : {
            "type" : "TakerPaymentValidateFailed",
            "data" : {
               "error" : "maker_swap:970] !taker_coin.validate_taker_payment: eth:3457] Didn't find provided tx 0x74e4e262f31906d64b8733245062ace84250638100742e42d303214a3721d92c on ETH node"
            }
         }
      },

the console on maker showed this while it failed the swap:

23 19:07:09, maker_swap:917] INFO Taker payment tx 74e4e262f31906d64b8733245062ace84250638100742e42d303214a3721d92c
+--- 23 19:07:11 -------
| (0:49) [swap uuid=456d773b-dcec-49df-bdb2-587518ab7c1d] Taker payment wait confirm started...
| (0:01/103:10) [OCEAN-PLG20] Waiting for confirmations…
· 2023-01-23 19:07:24 +0000 [OCEAN-PLG20] Waiting for confirmations… Confirmed.
+--- 23 19:07:25 -------
| (1:03) [swap uuid=456d773b-dcec-49df-bdb2-587518ab7c1d] Taker payment wait confirm started...
+--- 23 19:07:33 -------
| (1:12) [swap uuid=456d773b-dcec-49df-bdb2-587518ab7c1d] Maker payment refund started...

the tx in question is this one: https://polygonscan.com/tx/0x74e4e262f31906d64b8733245062ace84250638100742e42d303214a3721d92c
it was mined just fine

maker was using https://polygon-rpc.com RPC node while taker was using the ones defined in https://github.com/KomodoPlatform/coins/blob/master/ethereum/MATIC, which are more

it's a bit strange that maker said that he found the tx ([OCEAN-PLG20] Waiting for confirmations… Confirmed) but failed the swap

both maker and taker were using the same mm2 from dev branch: http://195.201.0.6/dev/mm2-7201146b3-Linux-CI.zip

what can be the cause? sync issues between the different RPC nodes that taker was using? if so, can we make a change so that mm2 tries a second time couple seconds later?

@artemii235
Copy link
Member

We use eth_getTransactionReceipt RPC in wait_for_confirmations and eth_getTransactionByHash in validate_payment. It seems that RPC node(s) might have a race condition when they return the receipt, but not the transaction itself yet. It's worth to call eth_getTransactionByHash in wait_for_confirmations too to prevent the problem.

Should be easy, so it looks like a good test task.

@cipig
Copy link
Member Author

cipig commented Feb 11, 2023

i had a very similar issue and it sounds like the above solution will solve this problem too
so i was trying to swap RNDR-PLG20 for SYS as a taker
and taker "said" this during takerpayment (RNDR-PLG20)

11 07:51:50, taker_swap:1319] INFO After wait confirm
+--- 11 07:51:51 -------
| (8:28) [swap uuid=102ff55d-25df-4d8b-9a20-b5ba05b3370c] Maker payment validated and confirmed...
| (0:00) [sign-and-send] get_gas_price…
· 2023-02-11 07:51:52 +0000 [sign-and-send] get_addr_nonce…
· 2023-02-11 07:51:55 +0000 [sign-and-send] get_addr_nonce…
11 07:51:55, taker_swap:1439] INFO Taker payment tx hash 31c91001eb35c9f80e1f56ab416c4425fea87b8d59663f27c5e140361f29c6a9
+--- 11 07:52:00 -------
| (8:36) [swap uuid=102ff55d-25df-4d8b-9a20-b5ba05b3370c] Taker payment sent...
| (0:05/121:27) [RNDR-PLG20] Waiting for confirmations…

just that the tx https://polygonscan.com/tx/0x31c91001eb35c9f80e1f56ab416c4425fea87b8d59663f27c5e140361f29c6a9 is nowhere to be found
a second try at a later time completed the exact same swap successfully
maker and taker were using latest mm2 from dev: 2.1.9934_dev_60337cf46_Linux_CI

@shamardy
Copy link
Collaborator

shamardy commented Mar 13, 2023

Although this is a good issue for a test task, it's better to fix this bug as soon as possible since it leads to failed swaps. Will work on it this week.

@shamardy
Copy link
Collaborator

shamardy commented Jun 27, 2023

@cipig Did you encounter these errors again? If not, I guess this issue can be closed.

@cipig
Copy link
Member Author

cipig commented Jun 27, 2023

saw it once in the last time https://dexapi.cipig.net/public/error.php?uuid=f691a5f1-e639-47c2-8ec5-cd7bdb224d17
but idk the circumstances, so closing

@cipig cipig closed this as completed Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Good test task
Projects
None yet
Development

No branches or pull requests

3 participants