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

feat: track deposit network mismatch #879

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Conversation

dohaki
Copy link
Contributor

@dohaki dohaki commented Oct 19, 2023

Closes ACX-1617

@linear
Copy link

linear bot commented Oct 19, 2023

ACX-1617 Possible FE wallet de-sync on deposit

A user has reported a deposit "de-sync", where the deposit txn was submitted on the wrong chain. In this case there is evidence of the FE having experienced state inconsistencies internally. Since this was a USDC deposit, only a small amount of gas was lost (~.07$ in ETH). The user is not requesting any refund.

Discord ticket: https://discord.com/channels/887426921892315137/1163013198170034267

Deposit: USDC Optimism → zkSync, was submitted on the destination chain: https://explorer.zksync.io/tx/0x69b35a8fb22335e63b257bd8459a1234358152d80bba138aa265f7bce93d351b

The "Deposit Successful" screen shows a misalignment between the intended deposit chain (Optimism) and the "Track in Explorer" link (zkSync). Normally these should be equal.

image.png

For reference, the "deposit successful" page should show:

2023-10-16-135032_707x812_scrot.png

The Amplitude event records for this deposit appear to indicate that the wallet was connected to zkSync, but that the user received quotes for Optimism → zkSync:

2023-10-16-135636_1302x658_scrot.png

2023-10-16-135646_1297x658_scrot.png

2023-10-16-135657_1276x666_scrot.png

2023-10-16-135716_1367x670_scrot.png

Possible contributing factor?

One possible cause of this might be a delay in the receipt of a quote from the API endpoint, thereby potentially causing the FE to use stale values. For example, the latest quote received had a ~quoteLatencyMiliseconds~ value of 8619 ms, vs ~800 ms for the others. This might be a red herring, since it there is > 1 minute between the last and 2nd last quotes.

2023-10-16-141230_1355x262_scrot.png

2023-10-16-141242_1151x356_scrot.png

Full deposit pending page:

image.png

@vercel
Copy link

vercel bot commented Oct 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontend-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2023 0:47am
goerli-frontend-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2023 0:47am

Comment on lines +240 to +241
const signerChainId = await signer.getChainId();
if (signerChainId !== fromChain) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change needed or is it for readability?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to track the signer chain id also in the amplitude event here https://github.com/across-protocol/frontend-v2/pull/879/files#diff-5d22ab6b9a7272e68f42731b880e896d1671416cc379fcf34bf6106cc5b9658eR246. To prevent another async call, I am storing the value in this variable

Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

LGTM

@dohaki dohaki merged commit 32cce4f into master Oct 20, 2023
6 checks passed
@dohaki dohaki deleted the track-network-mismatch-ampli branch October 20, 2023 15:59
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.

2 participants