feat(contract): implement M-of-N multi-sig service authorization - #26
Merged
Inkman007 merged 4 commits intoJun 17, 2026
Merged
Conversation
Replaces the single-service authorization model for score submission with a configurable M-of-N threshold signature scheme, closing the single point of key-compromise risk identified in issue Ledger-Lenz#9. Changes: - constants.rs: add MAX_SERVICE_SIGNERS = 10 - types.rs: add ServiceSet and ServiceThreshold DataKey variants - errors.rs: add InsufficientSigners(14), UnauthorizedSigner(15), InvalidThreshold(16), ServiceSetFull(17), SignerAlreadyInSet(18), SignerNotInSet(19) - storage.rs: add get/set_service_set, get/set_service_threshold helpers - lib.rs: update submit_score to accept a signers: Vec<Address> first param; add add_service_signer, remove_service_signer, set_service_threshold, get_service_signers, get_service_threshold; deprecate set_service / get_service with rustdoc migration notes; add #![allow(deprecated)] to suppress contractimpl macro-internal spec_xdr calls to deprecated methods - events.rs: add signer_added, signer_removed, service_threshold_updated - test.rs: prepend empty Vec signers to all existing submit_score calls (legacy single-service path unchanged); add all 11 acceptance-criteria multisig tests - test_interface.rs: prepend empty Vec signers to existing submit_score calls; add Vec to imports All 78 tests pass (67 pre-existing + 11 new). Closes Ledger-Lenz#9
- types.rs: add ServiceSet and ServiceThreshold DataKey variants (lost in merge from main's upgrade-timelock PR) - constants.rs: add MAX_SERVICE_SIGNERS = 10 (same) - storage.rs: re-add get/set_service_set and get/set_service_threshold helpers (same) - errors.rs: add UpgradeAlreadyPending(12), NoPendingUpgrade(13), UpgradeNotReady(20), InvalidUpgradeDelay(21) from upgrade-timelock PR - events.rs: add upgrade_proposed, upgrade_executed, upgrade_vetoed (referenced by lib.rs upgrade functions, missing after merge) - lib.rs: remove spurious blank line inside doc comment block (clippy::empty_line_after_outer_attr)
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 #9
Replaces the single-service authorization model for score submission with a configurable M-of-N threshold signature scheme, closing the single point of key-compromise risk identified.
Changes: