Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Commit 370394b

Browse files
rtb-12claude
andcommitted
fix(context-config): clean up visibility/allowlist on unregister and fix migration schemas
- Add context_visibility and context_allowlists cleanup to both unregister_context_from_group and proxy_unregister_from_group to prevent storage leaks and stale data on re-registration - Remove nonexistent context_count field from OldOnChainGroupMeta in migrations 04-06 to match the actual on-chain schema and prevent borsh deserialization corruption Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 5833948 commit 370394b

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

contracts/near/context-config/src/mutate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,9 @@ impl ContextConfigs {
872872
.collect();
873873
for signer in &all_signers {
874874
let _ignored = group.member_contexts.remove(&(signer.clone(), *context_id));
875+
let _ignored = group.context_allowlists.remove(&(*context_id, signer.clone()));
875876
}
877+
let _ignored = group.context_visibility.remove(&context_id);
876878

877879
let _ignored = self.context_group_refs.remove(&context_id);
878880

@@ -1309,7 +1311,9 @@ impl ContextConfigs {
13091311
.collect();
13101312
for signer in &all_signers {
13111313
let _ignored = group.member_contexts.remove(&(signer.clone(), *context_id));
1314+
let _ignored = group.context_allowlists.remove(&(*context_id, signer.clone()));
13121315
}
1316+
let _ignored = group.context_visibility.remove(&context_id);
13131317

13141318
let _ignored = self.context_group_refs.remove(&context_id);
13151319

contracts/near/context-config/src/sys/migrations/04_group_invitations.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ struct OldOnChainGroupMeta {
4848
pub members: IterableSet<SignerId>,
4949
pub approved_registrations: IterableSet<ContextId>,
5050
pub context_ids: IterableSet<ContextId>,
51-
pub context_count: u64,
5251
}
5352

5453
pub fn migrate() {

contracts/near/context-config/src/sys/migrations/05_group_migration_method.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ struct OldOnChainGroupMeta {
4848
pub members: IterableSet<SignerId>,
4949
pub approved_registrations: IterableSet<ContextId>,
5050
pub context_ids: IterableSet<ContextId>,
51-
pub context_count: u64,
5251
pub invitation_commitments: IterableMap<CryptoHash, BlockHeight>,
5352
pub used_invitations: IterableSet<CryptoHash>,
5453
pub member_contexts: IterableMap<(SignerId, ContextId), ContextIdentity>,

contracts/near/context-config/src/sys/migrations/06_group_permissions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ struct OldOnChainGroupMeta {
4949
pub members: IterableSet<SignerId>,
5050
pub approved_registrations: IterableSet<ContextId>,
5151
pub context_ids: IterableSet<ContextId>,
52-
pub context_count: u64,
5352
pub invitation_commitments: IterableMap<CryptoHash, BlockHeight>,
5453
pub used_invitations: IterableSet<CryptoHash>,
5554
pub member_contexts: IterableMap<(SignerId, ContextId), ContextIdentity>,

0 commit comments

Comments
 (0)