Skip to content

feat: enforce multisig threshold bounds validation#409

Merged
Baskarayelu merged 3 commits intoRemitwise-Org:mainfrom
uzochukwuV:feature/family-wallet-multisig-threshold-bounds
Mar 28, 2026
Merged

feat: enforce multisig threshold bounds validation#409
Baskarayelu merged 3 commits intoRemitwise-Org:mainfrom
uzochukwuV:feature/family-wallet-multisig-threshold-bounds

Conversation

@uzochukwuV
Copy link
Copy Markdown
Contributor

#289

  • Add MIN_THRESHOLD (1), MAX_THRESHOLD (100), MAX_SIGNERS (100) constants
  • Implement comprehensive bounds validation in configure_multisig:
    • Reject empty signers list
    • Enforce threshold >= MIN_THRESHOLD
    • Enforce threshold <= MAX_THRESHOLD
    • Ensure threshold <= signer count
    • Validate all signers are family members
    • Verify spending limit >= 0
  • Add 14 new tests for threshold validation edge cases
  • Update documentation with error codes and security notes
  • Fix duplicate constant in remitwise-common

- Add MIN_THRESHOLD (1), MAX_THRESHOLD (100), MAX_SIGNERS (100) constants
- Implement comprehensive bounds validation in configure_multisig:
  - Reject empty signers list
  - Enforce threshold >= MIN_THRESHOLD
  - Enforce threshold <= MAX_THRESHOLD
  - Ensure threshold <= signer count
  - Validate all signers are family members
  - Verify spending limit >= 0
- Add 14 new tests for threshold validation edge cases
- Update documentation with error codes and security notes
- Fix duplicate constant in remitwise-common
Copy link
Copy Markdown
Contributor Author

@uzochukwuV uzochukwuV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#289 pr submitted

…ate signer detection

- Change configure_multisig return type from bool to Result<bool, Error>
- Replace panic! calls with typed Error returns using existing error codes
- Add DuplicateSigner and TooManySigners error variants
- Enforce MAX_SIGNERS limit (was defined but unused)
- Add duplicate signer detection in single-pass validation
- Convert error tests to use try_configure_multisig for specific error assertions
- Add 5 new tests: duplicate signer (x2), too many signers, threshold bounds
- Update documentation with validation order and security assumptions

Closes Remitwise-Org#289
@uzochukwuV
Copy link
Copy Markdown
Contributor Author

close #289

@uzochukwuV uzochukwuV closed this Mar 28, 2026
@uzochukwuV
Copy link
Copy Markdown
Contributor Author

#289

Add MIN_THRESHOLD (1), MAX_THRESHOLD (100), MAX_SIGNERS (100) constants
Implement comprehensive bounds validation in configure_multisig:
Reject empty signers list
Enforce threshold >= MIN_THRESHOLD
Enforce threshold <= MAX_THRESHOLD
Ensure threshold <= signer count
Validate all signers are family members
Verify spending limit >= 0
Add 14 new tests for threshold validation edge cases
Update documentation with error codes and security notes
Fix duplicate constant in remitwise-common

@uzochukwuV uzochukwuV reopened this Mar 28, 2026
@Baskarayelu Baskarayelu merged commit f64ba67 into Remitwise-Org:main Mar 28, 2026
2 of 3 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.

2 participants