Skip to content

feat(contract): implement M-of-N multi-sig service authorization - #26

Merged
Inkman007 merged 4 commits into
Ledger-Lenz:mainfrom
Meshmulla:feature/9-multisig-service-auth
Jun 17, 2026
Merged

feat(contract): implement M-of-N multi-sig service authorization#26
Inkman007 merged 4 commits into
Ledger-Lenz:mainfrom
Meshmulla:feature/9-multisig-service-auth

Conversation

@Meshmulla

Copy link
Copy Markdown
Contributor

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:

  • 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 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

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)
@Inkman007
Inkman007 merged commit 816a9b3 into Ledger-Lenz:main Jun 17, 2026
5 checks passed
@Meshmulla
Meshmulla deleted the feature/9-multisig-service-auth branch June 17, 2026 15:01
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.

Implement M-of-N multi-signature service authorization for score submission

2 participants