threefoldtecharchive / threefold_hub

Apache License 2.0
0 stars 2 forks source link

Threefold Hub Deleting unbatched BSC transactions #72

Open mohamedamer453 opened 2 years ago

mohamedamer453 commented 2 years ago

Tested on https://threefoldhub.test.gridtesting.xyz/

After completing a transaction from cosmos to bsc and trying to delete it while it's still unbatched i was not able to delete it even though i approved the request from keplr and the transactions was completed and i received the tokens back at my metamask wallet.

Starting with 58 TFT in my metamask wallet and 12 available TFT in keplr.

Screenshot from 2022-04-26 15-07-09

Screenshot from 2022-04-26 15-08-24

after completing the transaction with a total of 8 TFT

image

and approving the transaction from keplr

image

after navigating to pending BSC transactions then to the unbatched tab i clicked in the delete icon and approved the action from keplr

Screenshot from 2022-04-26 15-12-07

image

but after a while it was transferred to the batched tab

image

and the transaction was completed and the TFT sent to metamask.

image

Screenshot from 2022-04-26 15-17-37

OmarElawady commented 2 years ago

When the transaction is batched, it can't be cancelled. The relayer (a process running per each validator), polls the pending requests and batches them periodically. So in this case the relayer batched the request before the cancel transaction is submitted. This can't be totally prevented since it's just a race between the frontend and the relayer. It should be improved by:

OmarElawady commented 2 years ago

The error is shown here and more validations are done in https://github.com/threefoldtech/threefold_hub/pull/73, and deployed on https://threefoldhub.test.gridtesting.xyz/.

mohamedamer453 commented 2 years ago

Starting with 28 TFT on Metamask & 15.9 TFT on Keplr

image

image

I Completed a transaction with a total of 5.911728 TFT

image

then i immediately went to the pending transactions tab and then to the unbatched tab and deleted the transaction (all this in approx. < 10 seconds)

after that the after that the Balance on metamask was still 28 TFT and on Keplr 14.4 TFT

so i think the 1.5 TFT difference is cancellation fees and the transaction was cancelled ?

Also in another transaction i did the exact same steps but i waited a couple of seconds after i approved the transaction before deleting it from the unbatched tab and i got an error message.

image

so i think that it's working now but the error message needs to be simplified and the position of the message needs to be adjusted.