Skip to content

fix(treasury): reject threshold updates unreachable by signer weights - #348

Merged
misrasamuelisiguzor-oss merged 1 commit into
WHEELBACK:mainfrom
Markodiba6399:feature/224-treasury-threshold-reachability
Jul 28, 2026
Merged

fix(treasury): reject threshold updates unreachable by signer weights#348
misrasamuelisiguzor-oss merged 1 commit into
WHEELBACK:mainfrom
Markodiba6399:feature/224-treasury-threshold-reachability

Conversation

@Markodiba6399

Copy link
Copy Markdown

Summary

  • update_threshold now rejects any new threshold greater than the sum of all registered signer weights (ThresholdUnreachable), preventing an admin from permanently deadlocking settlement execution.
  • Added TreasuryError::ThresholdUnreachable (variant 18) in crates/multisig/src/lib.rs.
  • Updated admin_can_update_threshold (previously set threshold=5 with only weight=1 available, which is now correctly rejected) and added two new tests: threshold above total weight is rejected, threshold equal to total weight is accepted.

Closes #224

Validation performed

  • Reviewed change by inspection; logic mirrors the existing get_all_signers weight-sum pattern used elsewhere in the contract.
  • Could not run cargo test --all in this environment: main's committed Cargo.lock is out of sync with Cargo.toml (duplicate entries for autocfg/base16ct, causing a lockfile parse failure), and a full cargo generate-lockfile regeneration pulls in incompatible transitive dependency versions (ed25519-dalek vs rand_core/rand_chacha) that fail to compile even on a clean checkout of main with no changes from this PR. This is a pre-existing, unrelated repository issue — flagging it here rather than fixing it as part of this diff.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Markodiba6399 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@misrasamuelisiguzor-oss
misrasamuelisiguzor-oss merged commit 709bd25 into WHEELBACK:main Jul 28, 2026
0 of 8 checks passed
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.

#33: Validate threshold is reachable given total signer weight

3 participants