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: add call to prepopulate account cache when local wallet is set #1062

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

aforaleka
Copy link
Contributor

@aforaleka aforaleka commented Sep 25, 2024

  • call the prepopulate account number cache function on setting local wallet
  • so we can skip the account number fetch roundtrip when placing order

testing:
setting breakpoints and verifying that this is set (both when remember me is enabled + after connecting wallet)
image

placing a short term order right away:
image

Copy link

vercel bot commented Sep 25, 2024

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

Name Status Preview Comments Updated (UTC)
v4-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 8:48pm
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 8:48pm

@vercel vercel bot temporarily deployed to Preview – v4-staging September 25, 2024 18:40 Inactive
aforaleka added a commit to dydxprotocol/v4-clients that referenced this pull request Sep 25, 2024
motivation:
- in FE, when creating the first transaction (e.g. placing a short term
order after web app starts), we need to query account as part of the tx
to get the account number before sending the place order message.
- we can actually pre populate the account number cache earlier (i.e.
app starts / clients initialized with address) so it doesn't have to be
a blocker
- once timestamp nonce is enabled, we will no longer need to fetch
account seq number, so this will also help eliminate the round trip time
blocker when placing a stateful order first

change:
- add `populateAccountNumberCache` function

testing:
- tested locally / integration with FE app
dydxprotocol/v4-web#1062
- backwards compatible
@aforaleka aforaleka merged commit 82158b8 into main Sep 25, 2024
9 checks passed
@aforaleka aforaleka deleted the prepop-account-cache branch September 25, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants