Skip to content

Conversation

@aterga
Copy link
Contributor

@aterga aterga commented Jan 12, 2026

Motivation

Lift the 4KB restriction per anchor.

Changes

Storage.read now attempts to read anchors from the new, unbounded stable memory, falling back to legacy memory (for now).

Tests

Added comprehensive migration test with 18 test cases covering device types, metadata preservation, and edge cases.

@aterga aterga marked this pull request as ready for review January 13, 2026 17:26
@aterga aterga requested review from Copilot, roelstorms and sea-snake and removed request for sea-snake January 13, 2026 17:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR switches Internet Identity to use unbounded anchor memory, lifting the previous 4KB restriction per anchor. The changes enable the system to read anchors from the new unbounded stable memory structure, with a fallback mechanism to legacy memory for backward compatibility.

Changes:

  • Modified Storage.read() to attempt reading from unbounded stable memory first, falling back to legacy memory if not found
  • Added comprehensive migration test suite covering 18 test cases for various device types and edge cases
  • Made Anchor struct fields pub(crate) to enable direct construction in migration tests
  • Uncommented metadata assertion test that expects metadata to be None in the new storage

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/internet_identity/src/storage.rs Refactored read logic to create read_legacy() method and updated read() to attempt new storage first with fallback
src/internet_identity/src/storage/anchor.rs Changed Anchor struct field visibility from private to pub(crate) to support test construction
src/internet_identity/src/storage/tests.rs Added comprehensive migration test with 18 test cases covering device types, metadata preservation, and edge cases
src/internet_identity/tests/integration/anchor_management/device_management.rs Removed TODO and uncommented metadata assertion expecting None

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@sea-snake sea-snake left a comment

Choose a reason for hiding this comment

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

LGTM

@aterga aterga added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 1c93091 Jan 16, 2026
78 checks passed
@aterga aterga deleted the arshavir/switch-anchor-storage branch January 16, 2026 17:28
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