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

perf: remove argon bench on boot, use sane defaults across the board #654

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

woodenfurniture
Copy link
Member

@woodenfurniture woodenfurniture commented Nov 21, 2023

Overview

Hardcodes sensible defaults for argon encryption parameters, skipping the benchmark to reduce initial app boot time by >4s on both desktop and mobile devices, when connecting to native wallet for the first time.

The default parameters remain the same, with only the iterations changing from 23 to 16. Noting that reasonably modern mobile devices achieve ~11 iterations within the 1s target, the default was set to a conservative 16 iterations as a balance between performance and security.

Testing

This should be tested locally with shapeshift web via local npm registry (e.g verdaccio)

  • can open native wallet with existing local state (existing parameters set in IndexedDB with prior benchmark on prior version version). This should prove backwards compatibility so users don't have to re-import their wallets
  • can open native wallet starting from empty local state (clear IndexedDB)

Issue

Will close #5557 after bumping version in web.

Benchmark parameters

Mobile - Pixel 4a
Note overall duration of the bench was 4.1s
image

Desktop - Mac M2
Note overall duration of the bench was 4.6s
image

Performance results (on Desktop - Mac M2)

Before changes
4s benchmark runs on first open of native wallet:
image

After changes
4s benchmark no longer run:
image

Note the defaults get stored as intended:
image

Copy link

vercel bot commented Nov 21, 2023

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

Name Status Preview Comments Updated (UTC)
hdwallet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2023 10:01am

Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

Tested locally, LGTM pending security green light on this:

  • Existing state - unlock native wallet
existing.wallet.mov
  • Cleared state - Import wallet
import.mov
  • Cleared state - new wallet creation
new.wallet.mov

Copy link
Contributor

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link
Contributor

@0xApotheosis 0xApotheosis left a comment

Choose a reason for hiding this comment

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

Solid big wood

Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

Stamping as previously reviewed/tested, implementation didn't change and this has ops green light 🥇

@gomesalexandre gomesalexandre merged commit a820a1f into master Dec 4, 2023
7 checks passed
@gomesalexandre gomesalexandre deleted the remove-argon-bench branch December 4, 2023 19:57
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.

Remove device-dependent encryption parameters
3 participants