osiastedian / syscoin-bridge

syscoin-bridge.vercel.app
1 stars 1 forks source link

(Stress test) Running multiple sessions in different tabs results in process misalignment & deadlock #8

Closed bstr156 closed 2 years ago

bstr156 commented 2 years ago

NEVM -> SYS

Behavior: First session is fine. Second and third sessions exhibit the following. UI is stuck on Step4 [Mint SYSX] despite those transactions having been signed by Pali Wallet and confirmed: image

In both cases, [Retry] results in the error seen above, and the same error in Pali Wallet (likely because the mint for that proof has already been confirmed, so it's rejecting it appropriately).

How to reproduce:

  1. open multiple sessions on different tabs
  2. do each step for each session in sequential order, e.g. [Freeze and Burn] on each session, followed by [Mint SYSX] on each session, etc)
  3. Sign the transactions as they show up in the wallets.

Interestingly, this did not occur with MetaMask (it accepted back-to-back submissions fine and the bridge UI was able to keep up), only when signing with Pali... I'm not sure if this stems from the logic we're using when interacting with Pali or an issue w/ the Pali API itself.

Here are the stuck sessions:

https://syscoin-bridge.vercel.app/bridge/1661374640447 Mint SYSX tx: https://blockbook.elint.services/tx/9e5337eefb24cb6ba8ee4f61a4c94674381462396337e035351873417df55d6b

https://syscoin-bridge.vercel.app/bridge/1661374526957 Mint SYSX tx: https://blockbook.elint.services/tx/91ff96643d6d3512cd50ac5cda56f752d78f3e3e57effd8ca1e48a2fa5688d13

bstr156 commented 2 years ago

Also! Here is the first session that went through fine, in case this is useful to you: https://syscoin-bridge.vercel.app/bridge/1661374403472

osiastedian commented 2 years ago

Hi @bstr156 ,

I was able to reproduce the issue as described. https://drive.google.com/file/d/1bgqpYAS_tvg62bay_2WQECH4dtUDOvva/view?usp=sharing

I think this is a PaliWallet issue on how they handle simultaneous signing request on how it translates to dapps. MetaMask once signed it immediate returns a transaction hash for it. Unlike Pali it still waits a little while then Transaction ID is given.

I've tried executing similar behavior on another Dapp, the old Bridge. Video demo here: https://drive.google.com/file/d/1ZGSbkJTKzg8F47h2LlIW5YB_bU9wE_0B/view?usp=sharing

And you'll notice PaliWallet behave the same way.

bstr156 commented 2 years ago

Will bring this to the Pali team.

osiastedian commented 2 years ago

Please re-open if new info comes up.

bstr156 commented 2 years ago

https://github.com/syscoin/pali-wallet/issues/250