-
Notifications
You must be signed in to change notification settings - Fork 163
chore: Switch to unbounded anchor memory #3571
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
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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.
sea-snake
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Motivation
Lift the 4KB restriction per anchor.
Changes
Storage.readnow 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.