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

[BUG]: Infinity loading fees #2112

Closed
tonymorony opened this issue Nov 25, 2022 · 4 comments · Fixed by #2114
Closed

[BUG]: Infinity loading fees #2112

tonymorony opened this issue Nov 25, 2022 · 4 comments · Fixed by #2114
Assignees
Labels
bug Something isn't working P0 Blocker / critical defect

Comments

@tonymorony
Copy link

tonymorony commented Nov 25, 2022

  1. select order from orderbook, press start swap button
  2. if you repeat step 1. few times on some point there will be infinity "Loading fees" state

image

[15:41:05] [error] [cpprestsdk.utilities.cpp:51] [6379677]: pplx task error: Error resolving address in log

upd: reproduction is much simplier

  1. select order from bottom part of the orderbook and press start swap
  2. select order from top part of the orderbook and press start swap
  3. see fees hanged
Screen.Recording.2022-11-25.at.15.51.58.mov
@tonymorony tonymorony added bug Something isn't working P0 Blocker / critical defect 0.5.8 labels Nov 25, 2022
@tonymorony tonymorony assigned ghost and smk762 Nov 25, 2022
@ghost
Copy link

ghost commented Nov 28, 2022

Not so sure this is related to a repetition of selecting random orders

Got the bug when the volume I wanna trade is near the 100% of my total volume.

@smk762
Copy link
Collaborator

smk762 commented Nov 28, 2022

It was related to multiple calls to trade_preimage (even on a single order), and if getting an error response which model would not parse. I removed the extra calls and made it show the error if it is returned, but need to clean up some overflow
#2114 (comment)

@smk762
Copy link
Collaborator

smk762 commented Nov 28, 2022

fwiw: Here's the trade_primage error cases: https://developers.komodoplatform.com/basic-docs/atomicdex-api-20/trade_preimage.html#error-types

  • NoSuchCoin ✔️ covered by coin selection being limited to enabled coins (excluding partial activated ZHTLC)
  • BaseEqualRel ✔️ covered in determine_fees() and combo selector filter
  • PriceTooLow ✔️ covered in determine_fees() & form validation message
  • CoinIsWalletOnly ✔️ covered in combo selector filter
  • InvalidParam ✔️ covered in back end
  • Transport 🔇 network issue.
  • InternalError 🔇 generic API error
  • NotSufficientBalance (if fees amount is unknown, this could occur)
  • NotSufficientBaseCoinBalance (if fees amount is unknown, this could occur)
  • VolumeTooLow (if fees amount is unknown, this could occur)

For some coins, we have txfee value in https://github.com/KomodoPlatform/coins/blob/master/coins#L279 (can also add too the coin_confiig.json if needed) which could be a good estimate of expected fees value prior to trade_preimage request. For somme EVM coins, we could get a quicker response for fee prediction from https://ethgasstation.info/json/ethgasAPI.json or https://gasstation-mainnet.matic.network/

Where we can, we should source info that returns faster than trade preimage to ensure none of these error cases is possible (or very rare).

@smk762
Copy link
Collaborator

smk762 commented Nov 28, 2022

I've reduced the trade_preimage triggers down to

  • on simple mode at onSelectedOrderChanged (i.e. selecting from the to dropdown list.
  • On pro mode, once "Start swap" button is pressed.

In simple mode, selection of order already has price / volume set from from and bestorders response so no validation required, and fees are calculated before "swap now" button activates. While we might be able to fit this in on the pro view order form, potential manual changes to the price / volume input would cause too many trade_preimage requests so not reeally a good option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Blocker / critical defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants