feat(be): reap applications no anchor references any more - #4237
Closed
sea-snake wants to merge 1 commit into
Closed
feat(be): reap applications no anchor references any more#4237sea-snake wants to merge 1 commit into
sea-snake wants to merge 1 commit into
Conversation
Nothing has ever been removed from the application registry, so it grows for the lifetime of the canister, and tracking every sign-in makes it grow faster. The predicate is the existing `StorableApplication.stored_account_references`, which is an accurate live count today because every insert is counted and nothing has ever been removed: it only needed decrementing, which the single write path made a property of one function. Reaching zero removes the application row, and the origin-index entry when it still points at that number. The number is retired rather than reissued, so an origin signed into again allocates a fresh one. Applications created before this change reap on the same rule, with no migration. Implements docs/ongoing/tracked-default-accounts.md §8 (D15, D18). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
✅ No security or compliance issues detected. Reviewed everything up to dcb9613. Security Overview
Detected Code Changes
|
Contributor
Author
|
Folded into #4235. These three cannot be deployed separately: tracking makes every sign-in at a new origin mint an application row from an operation with no per-anchor cap, eviction is what bounds that and the only thing that makes an application's reference count fall, and reaping is dead code without it. Verified rather than assumed — with tracking alone, one anchor signing in at 2 000 origins creates 2 000 reference rows and 2 000 application rows. Shipping a prefix would mean unbounded, attacker-drivable stable-memory growth, so they are now one PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Changes
Tests
Design: #4222 (
docs/ongoing/tracked-default-accounts.md). Overview: #4230.