fix(globe-wallet): enforce MIN_GUARDIANS_FOR_RECOVERY in remove_guardian (#90) - #110
Open
ZacLou wants to merge 1 commit into
Open
fix(globe-wallet): enforce MIN_GUARDIANS_FOR_RECOVERY in remove_guardian (#90)#110ZacLou wants to merge 1 commit into
ZacLou wants to merge 1 commit into
Conversation
5 tasks
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
force-pushed
the
fix/remove-guardian-enforce-min-recovery
branch
from
September 2, 2026 15:25
ce4405a to
1b615fd
Compare
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.
Closes #90
remove_guardianpreviously 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 thatset_recovery_configrequires for configuring recovery in the first place.Change
When a
RecoveryConfigexists,remove_guardiannow rejects any removal that would drop the guardian count belowMIN_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.test_removed_guardian_approval_no_longer_counts_toward_quorumandtest_remove_guardian_dequorated_proposal_can_requorum_with_fresh_timelockto 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.