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: Stop validating JSON for stored state #2845

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Oct 17, 2024

Removes some validation checks when storing and retrieving state from snap_manageState. Since we have input sanitization on the Snap side, we can improve performance significantly when retrieving state by parsing it without additional validation.

Also improves performance slightly by not using isVaultUpdated as the sole check for caching (as that function can be somewhat expensive to call).

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.46%. Comparing base (2c5a1e5) to head (81776df).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2845   +/-   ##
=======================================
  Coverage   94.46%   94.46%           
=======================================
  Files         486      486           
  Lines       10358    10360    +2     
  Branches     1579     1582    +3     
=======================================
+ Hits         9785     9787    +2     
  Misses        573      573           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FrederikBolding FrederikBolding changed the title perf: Stop validating JSON for encrypted state perf: Stop validating JSON for stored state Oct 21, 2024
@FrederikBolding FrederikBolding marked this pull request as ready for review October 22, 2024 12:48
@FrederikBolding FrederikBolding requested a review from a team as a code owner October 22, 2024 12:48
hmalik88
hmalik88 previously approved these changes Oct 22, 2024
@FrederikBolding FrederikBolding merged commit ec811b7 into main Oct 22, 2024
166 checks passed
@FrederikBolding FrederikBolding deleted the fb/state-encryption-perf branch October 22, 2024 14:30
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.

3 participants