fix(treasury): reject threshold updates unreachable by signer weights - #348
Merged
misrasamuelisiguzor-oss merged 1 commit intoJul 28, 2026
Conversation
|
@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! 🚀 |
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.
Summary
update_thresholdnow rejects any new threshold greater than the sum of all registered signer weights (ThresholdUnreachable), preventing an admin from permanently deadlocking settlement execution.TreasuryError::ThresholdUnreachable(variant 18) incrates/multisig/src/lib.rs.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
get_all_signersweight-sum pattern used elsewhere in the contract.cargo test --allin this environment:main's committedCargo.lockis out of sync withCargo.toml(duplicate entries forautocfg/base16ct, causing a lockfile parse failure), and a fullcargo generate-lockfileregeneration pulls in incompatible transitive dependency versions (ed25519-dalekvsrand_core/rand_chacha) that fail to compile even on a clean checkout ofmainwith 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.