Skip to content

fix(globe-wallet): enforce MIN_GUARDIANS_FOR_RECOVERY in remove_guardian (#90) - #110

Open
ZacLou wants to merge 1 commit into
Orbit-Wal:mainfrom
ZacLou:fix/remove-guardian-enforce-min-recovery
Open

fix(globe-wallet): enforce MIN_GUARDIANS_FOR_RECOVERY in remove_guardian (#90)#110
ZacLou wants to merge 1 commit into
Orbit-Wal:mainfrom
ZacLou:fix/remove-guardian-enforce-min-recovery

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 2, 2026

Copy link
Copy Markdown

Closes #90

remove_guardian previously only validated the configured recovery threshold, so a wallet configured with 3 guardians and threshold 2 could be walked down to 2 guardians — below the 3-guardian minimum that set_recovery_config requires for configuring recovery in the first place.

Change

When a RecoveryConfig exists, remove_guardian now rejects any removal that would drop the guardian count below MIN_GUARDIANS_FOR_RECOVERY, in addition to the existing threshold check.

Tests

  • test_remove_guardian_degrades_below_min_guardians_for_recovery_fails — reproduction from issue [Bug]: MIN_GUARDIANS_FOR_RECOVERY is enforced only when set_recovery_config is called — remove_guardian can silently degrade below it #90 now rejected.
  • test_remove_guardian_down_to_min_guardians_for_recovery_succeeds — boundary at exactly 3 still succeeds.
  • test_remove_guardian_without_recovery_not_bound_by_min_guardians — no regression when recovery is not configured.
  • Updated test_removed_guardian_approval_no_longer_counts_toward_quorum and test_remove_guardian_dequorated_proposal_can_requorum_with_fresh_timelock to use 4 guardians so removal leaves ≥ MIN_GUARDIANS_FOR_RECOVERY; their original intent is preserved.

Verification

  • cargo test -p globe-wallet → 91 unit tests + 1 integration test passed.
  • cargo clippy -p globe-wallet -- -A deprecated → clean.

Closes Orbit-Wal#90.

`remove_guardian` previously only checked the configured recovery
threshold, so a wallet configured with 3 guardians and threshold 2 could
be walked down to 2 guardians -- below the 3-guardian minimum that
`set_recovery_config` requires for configuring recovery in the first
place.

Now, whenever a recovery config exists, removal is rejected if it would
take the guardian count below MIN_GUARDIANS_FOR_RECOVERY.

Adds regression tests and updates two existing tests to use 4 guardians
so their original intent (removed guardian's approval no longer counts)
remains valid under the new floor.
@ZacLou
ZacLou force-pushed the fix/remove-guardian-enforce-min-recovery branch from ce4405a to 1b615fd Compare September 2, 2026 15:25
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.

[Bug]: MIN_GUARDIANS_FOR_RECOVERY is enforced only when set_recovery_config is called — remove_guardian can silently degrade below it

2 participants