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

Slurp refactoring #914 #1119

Merged
merged 4 commits into from
Nov 1, 2021
Merged

Slurp refactoring #914 #1119

merged 4 commits into from
Nov 1, 2021

Conversation

sergeyboyko0791
Copy link

  • Add SlurpError
  • Refactor slurp_req, slurp_url so they return SlurpResult
  • Replace slurp functions into native/wasm common::transport
  • Replace native executor mod into native_executor.rs
  • Rename executor.rs into wasm_executor.rs
  • Replace wio mod from common.rs into wio.rs

* Add SlurpError
* Refactor slurp_req, slurp_url so they return SlurpResult
* Replace slurp functions into native/wasm common::transport
* Replace native executor mod into native_executor.rs
* Rename executor.rs into wasm_executor.rs
* Replace wio mod from common.rs into wio.rs
@sergeyboyko0791
Copy link
Author

@cipig could you please check if mm2 returns/logs addresses of slow RPC nodes?

* Return fetch_json, post_json to transport.rs
* Add slurp_post_json in WASM and native
@artemii235 artemii235 requested a review from cipig October 27, 2021 09:33
artemii235
artemii235 previously approved these changes Oct 27, 2021
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Milerius
Milerius previously approved these changes Oct 27, 2021
@cipig
Copy link
Member

cipig commented Oct 27, 2021

updated 2 nodes to this branch and waiting for timeouts
in the meantime i found this too rpc:239] ERROR RPC error response: rpc:174] dispatcher_legacy:155] lp_ordermatch:3825] maker_swap:1600] result:1897] eth:2422] Transport error: RPC error: Error { code: ServerError(-32000), message: "insufficient funds for transfer", data: None }
looks like it is related to one of the RPC nodes returning 0 balance (or something totally weird) for the coin, although my_balance shows 10.3199111365536
should the PR cover this too?
EDIT: happens on setpricecall

@artemii235
Copy link
Member

should the PR cover this too?

It's hard to understand what node's result we should consider as "truth" in this case. I think it's out of this PR scope - switching between addresses should happen in case of network errors.

@cipig
Copy link
Member

cipig commented Oct 27, 2021

ok, catched first errors, they now show up like this

27 11:10:53, wio:72] drive03 receiver is dropped
27 11:10:55, wio:72] drive03 receiver is dropped
27 11:10:55, wio:72] drive03 receiver is dropped
27 11:10:59, wio:72] drive03 receiver is dropped

i know it's related to Polygon coins and to which of them, but not which server it is

@cipig
Copy link
Member

cipig commented Oct 27, 2021

maybe it's related to my own timeouts (how long the bot waits for response from mm2 on certain calls)
i recently reduced those to 10s... now set them back to 30s
what is the timeout on mm2 side for requests to RPC nodes? if i use a lower timeout then that, i will never catch the errors from mm2 i guess

@cipig
Copy link
Member

cipig commented Oct 27, 2021

saw this error to gas_station_url

27 14:12:40, rpc:239] ERROR RPC error response: rpc:174] dispatcher_legacy:155] lp_ordermatch:3825] maker_swap:1600] result:1897] result:1897] eth:317] Transport error: Transport 'https://gasstation-mainnet.matic.network' error: Gas price request failed with status code 502 Bad Gateway
27 14:12:41, rpc:239] ERROR RPC error response: rpc:174] dispatcher_legacy:155] lp_ordermatch:3825] maker_swap:1600] result:1897] result:1897] result:1897] Transport error: invalid type: null, expected f64 at line 1 column 31

it contains the URL
what about the second line with invalid type?

@sergeyboyko0791
Copy link
Author

27 11:10:53, wio:72] drive03 receiver is dropped

Hmm, since a request to some RPC node has not been timed out, you didn't get an error from mm2. I'll try to add a log message on the timeout.

what is the timeout on mm2 side for requests to RPC nodes?

60 seconds. As you said before, you may not receive an error from mm2 due to your own timeouts. I'll add a log message anyway to catch the error.

@cipig
Copy link
Member

cipig commented Oct 31, 2021

lgtm
i had some internet problems and the console showed me this

31 09:22:07, coins:web3_transport:135] WARN web3_transport:134] Error requesting 'https://matic-mainnet.chainstacklabs.com/': 60s timeout expired
31 09:22:08, coins:web3_transport:135] WARN web3_transport:134] Error requesting 'http://bsc2.cipig.net:8655/': 60s timeout expired
31 09:22:10, wio:72] drive03 receiver is dropped
31 09:22:11, coins:web3_transport:135] WARN web3_transport:134] Error requesting 'https://polygon-rpc.com/': 60s timeout expired
31 09:22:11, atomicdex_gossipsub:behaviour:1205] INFO HEARTBEAT: relays low. Contains: 1 needs: 2
31 09:22:12, wio:72] drive03 receiver is dropped
31 09:22:12, wio:72] drive03 receiver is dropped
31 09:22:12, wio:72] drive03 receiver is dropped

or from setprice:

rpc:174] dispatcher_legacy:155] lp_ordermatch:3825] maker_swap:1605] eth:2945] eth:481] Transport error: Transport error: request MethodCall(MethodCall { jsonrpc: Some(V2), method: "eth_gasPrice", params: Some(Array([])), id: Num(373) }) failed: native_http:41] Transport 'https://rpc.ftm.tools/' error: connection error: broken pipe
rpc:174] dispatcher_legacy:155] lp_ordermatch:3825] maker_swap:1605] eth:2945] eth:3140] eth:314] native_http:41] Transport error: Transport 'https://gasstation-mainnet.matic.network/' error: Transport 'https://gasstation-mainnet.matic.network/' error: error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution

Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reapproving

@artemii235 artemii235 merged commit 05e80b1 into dev Nov 1, 2021
@artemii235 artemii235 deleted the mm2.1-slurp-refactoring branch November 1, 2021 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add hostname or IP to error message from RPC nodes
4 participants