Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

User blocked at the step of Transfer and cannot proceed to Deposit #235

Open
think-in-universe opened this issue May 8, 2021 · 17 comments

Comments

@think-in-universe
Copy link

Description

One user was blocked at the step of Transfer (lockToken), when actually he has successfully locked the token (https://etherscan.io/tx/0xeae90910a492632ebc1307d4217179302de6fef3c16918a78f882bdbdb15b009) , but accidentally he click the Transfer button again and then he was blocked at the frontend (https://etherscan.io/tx/0x49285ae9cb5ccc25fd9c0135f6cb96bf13d023e8198fbed3adb4ac9231bf9d66), and cannot proceed with Deposit on NEAR.

Do we have any way to workaround this issue in frontend?

This seems to be an issue at frontend and we should take a look

image

@paouvrard
Copy link
Member

@think-in-universe The successful lock transaction hash (0xeae90910a492632ebc1307d4217179302de6fef3c16918a78f882bdbdb15b009) can be used to recover the transfer with the Missing a transfer? functionality.

Could you share more information about which wallet was being used ?

@think-in-universe
Copy link
Author

@paouvrard the user was using MetaMask.

@think-in-universe
Copy link
Author

@paouvrard @mfornet

The user tried Missing a transfer? with the hash 0xeae90910a492632ebc1307d4217179302de6fef3c16918a78f882bdbdb15b009 and is able to proceed to Deposit on NEAR. But was failed again when deposit: https://explorer.near.org/transactions/FwnTP33MT7zcMG7WvVwCfFHGvaAFbxGym5t7uvfs25cr

Any ideas how to fix this?

@think-in-universe
Copy link
Author

think-in-universe commented May 9, 2021

@paouvrard from the explorer, you could see the user called lockToken twice and the second one failed: https://etherscan.io/address/0xf0169539555437d35064f4853e67c5a8d543f92b

image

@paouvrard
Copy link
Member

@think-in-universe , @mfornet mentioned he already finalized the transfer for the user so the funds should be in the user's account. So attempting to finalize again (double spend) causes Event cannot be reused for depositing. as expected.

@IsQiao
Copy link

IsQiao commented May 10, 2021

I received the transfer, thanks.
image

but, in rainbow front end, the transfer is still failed, is it expected?
image

@paouvrard
Copy link
Member

@IsQiao Yes, you can disregard it, or clear localStorage if you wish to remove it from the transfers list.

@mfornet @djsatok This is also a good example of when we would want to check whether a proof has been used or not (contract view function) so that we can mark transfers as completed before trying to finalize a tx that was already finalized.

@mfornet
Copy link

mfornet commented May 11, 2021

This is also a good example of when we would want to check whether a proof has been used or not (contract view function) so that we can mark transfers as completed before trying to finalize a tx that was already finalized.

We can use the indexer to check on the Near side? what do you suggest to use on the ETH side?

Btw, can we close this issue already?

@paouvrard
Copy link
Member

@mfornet Couldn't we use view functions on the connectors to check if a proof has been used or not ? (NEAR and Eth side)

@IsQiao , @think-in-universe mentioned that you clicked the Transfer button again, but I don't see how that can happen since it is disabled after clicked. Maybe did you mean that you clicked Retry in which case the issue could be similar to this one: #243 ?

@mfornet
Copy link

mfornet commented May 14, 2021

Couldn't we use view functions on the connectors to check if a proof has been used or not ? (NEAR and Eth side)

We can, on NEAR it is easier than in ethereum though, since upgrading the contract in Eth side will involve moving all assets from one contract to the other. However, this gave me the idea that we can query directly for the state if we know exactly where the proof is located. Maybe @0x3bfc can help with this, we can have a call to discuss this approach.

@paouvrard
Copy link
Member

Right, we can use eth_getStorageAt / eth_getProof.

@think-in-universe
Copy link
Author

I think @IsQiao does mean he clicked Transfer button again.

@IsQiao could you please share if you have a stable way of reproducing that issue?

@paouvrard
Copy link
Member

@mfornet @0x3bfc The check for already used unlock proofs on Ethereum side using eth_getStorageAt is implemented here: aurora-is-near/rainbow-bridge-client#37.

@IsQiao
Copy link

IsQiao commented May 19, 2021

I think @IsQiao does mean he clicked Transfer button again.

@IsQiao could you please share if you have a stable way of reproducing that issue?

Steps:

  1. click 'Approve Transfer' button, using low gas fee tranfer erc20 tokens to NEAR
  2. repeat step 1 (right, they are a same bridge transaction)
  3. then gas fee increase on ethereum. so my transactions is wating long time
  4. i cancel one of the two transaction in metamask wallet. (i forget which one)
  5. increase the other transaction gas fee in metamask wallet.

@paouvrard
Copy link
Member

  1. repeat step 1 (right, they are a same bridge transaction)

Could you clarify this ? If you have confirmed the step 1 transaction in Metamask, then you would not be able to start a new transfer and you would get this error:

image

My guess is that at step 1 you didn't confirm in Metamask, so when you started the transfer again, you had 2 pending Metamask transactions to be confirmed and the frontend cannot track both.

@IsQiao
Copy link

IsQiao commented May 20, 2021

@paouvrard Yes, it should be, 2 pending transactions in Metamask wallet

@paouvrard
Copy link
Member

Ok so to be sure: you reloaded the page after step 1 and never clicked Reject or Confirm in metamask, so you have 2 pending Metamask transactions waiting to be signed i.e requests to be acknowledged as in the below screenshot:
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants