Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Dec 17, 2025

Since verifying and updating the registry can be expensive on slower devices, we can store the current signature and only re-verify when the signature changes.


Note

Stores and persists the registry signature to skip verification and database updates when unchanged, updating controller logic and tests.

  • Snaps Registry Controller (json.ts):
    • Add signature to SnapsRegistryState and controller metadata (persisted, logged; not exposed to UI).
    • Update flow: fetch registry.json and signature.json, parse signature; if signature matches state, skip verification/update and only refresh lastUpdated/databaseUnavailable.
    • On change, verify using parsed SignatureStruct and persist new database and signature.
    • Adjust #verifySignature to accept SignatureStruct (using @metamask/superstruct Infer).
  • Tests (json.test.ts):
    • Add test ensuring update is skipped when signature unchanged; update metadata snapshots to include signature.
  • Dependencies:
    • Add @metamask/superstruct.

Written by Cursor Bugbot for commit 8ff96dd. This will update automatically on new commits. Configure here.

@FrederikBolding FrederikBolding requested a review from a team as a code owner December 17, 2025 13:03
@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.33%. Comparing base (24b87d3) to head (8ff96dd).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3779   +/-   ##
=======================================
  Coverage   98.33%   98.33%           
=======================================
  Files         420      420           
  Lines       12019    12032   +13     
  Branches     1872     1874    +2     
=======================================
+ Hits        11819    11832   +13     
  Misses        200      200           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding added this pull request to the merge queue Dec 17, 2025
Merged via the queue into main with commit 075eda3 Dec 17, 2025
121 checks passed
@FrederikBolding FrederikBolding deleted the fb/compare-sig branch December 17, 2025 14:58
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