Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MESH-2209 multisig improvements part 4 #1697

Conversation

Neopallium
Copy link
Contributor

@Neopallium Neopallium commented Aug 2, 2024

changelog

new features

  • Limit the total number of signers per multisig to 50.
  • Split multisig CreatorDid into AdminDid and PayingDid.
  • A multisig can add an admin DID to enable the *_via_admin controls.
  • A multisig can remove it's admin to disable the *_via_admin controls. The admin DID can also remove itself as the admin of a multisig.
  • A multisig can remove it's paying DID to pay for its own transaction/protocol fees.
  • A multisig unlinked from an identity (via identity.leave_identity_as_key) and join a new identity using multisig.approve_join_identity and the transaction fees will be paid by the primary key of the joining identity.
  • A multisig can't be a signer on another multisig.

modified external API

  • Remove Multisig extrinsics *_via_creator to *_via_admin.
  • Multisig storage CreatorDid renamed to AdminDid.
  • Added Multisig storage PayingDid to hold the identity that pays transaction fees.
  • When creating a new MultiSig the calling DID is set as the PayingDid by default, but doesn't have admin controls.
  • create_multisig now adds the new multisig to the caller's identity as a secondary key. By default the multisig will have no permissions unless the caller is the primary key and has provided custom permissions.
  • Removed multisig make_multisig_primary, make_multisig_secondary and remove_creator_controls extrinsics.
  • Replaced remove_creator_controls with remove_admin_via_admin extrinsic.

new external API

  • multisig.add_admin(identity) callable by the multisig to add an identity as admin.
  • multisig.remove_admin_via_admin(multisig) callable by the admin to remove itself as admin of a multisig.
  • multisig.remove_payer() callable by the multisig to remove the paying identity. The multisig will need to pay for its own transaction/protocol fees.
  • multisig.remove_payer_via_payer(multisig) callable by the paying identity to remove itself as the payer of fees for the multisig.
  • multisig.approve_join_identity(auth_id) callable by multisig signers to approve joining a new identity. The primary key of the joining identity will pay for transaction fees.
  • multisig.join_identity(auth_id) this is called by the proposal created in approve_join_identity to accept a join identity authorization.
  • Added storage AuthToProposalId used by multisig.approve_join_identity to map an auth_id to proposal_id.

modified events

  • The caller_did is now optional for multisig events: ProposalAdded, ProposalExecuted, MultiSigSignersRequiredChanged, ProposalApprovalVote, ProposalRejectionVote, ProposalApproved, and ProposalRejected. Since the multisig could be unlinked from an identity when those events are emitted.

new events

  • New multisig events: MultiSigAddedAdmin, MultiSigRemovedAdmin, and MultiSigRemovedPayingDid.

data migration

  • Removed storage Multisig.LostCreatorPrivileges.
  • Migrate Multisig.CreatorDid to Multisig.PayingDid and Multisig.AdminDid (only if LostCreatorPrivileges hasn't been set).

@Neopallium Neopallium changed the base branch from develop to MESH-1955-multisig-improvements-part-3 August 2, 2024 11:56
@Neopallium Neopallium changed the title [WIP] MESH-2209 multisig improvements part 4 MESH-2209 multisig improvements part 4 Aug 6, 2024
Base automatically changed from MESH-1955-multisig-improvements-part-3 to remove_bridge_part_1 August 13, 2024 13:49
Base automatically changed from remove_bridge_part_1 to MESH-1955-multisig-improvements August 13, 2024 14:14
@Neopallium Neopallium force-pushed the MESH-2209-multisig-improvements-part-4 branch from 65165cc to e92962c Compare August 13, 2024 14:19
@Neopallium Neopallium force-pushed the MESH-1955-multisig-improvements branch from 72d94dd to 1c76b51 Compare August 14, 2024 14:32
@Neopallium Neopallium force-pushed the MESH-2209-multisig-improvements-part-4 branch from e92962c to 2f60962 Compare August 14, 2024 14:34
* Remove use of Context::current_identity

* Add some more TODOs.

* Remove Context::set_current_identity() calls from unit tests.

* Remove some more current_identity from unit tests.

* Use controller not stash for Unbonded event.

* Fix remove_authorization for unlinked keys.

* Use GC_DID in treasury event.

* Lint fix.

* Finish TODOs.

* Remove all Context::current_identity code.

* Remove identity CurrentDid storage.
@Neopallium Neopallium merged commit 401e40a into MESH-1955-multisig-improvements Aug 15, 2024
1 of 10 checks passed
@Neopallium Neopallium deleted the MESH-2209-multisig-improvements-part-4 branch August 15, 2024 14:08
Neopallium added a commit that referenced this pull request Aug 15, 2024
* Remove old _as_identity extrinsics.

* Fix multisig benchmarks.

* Remove use of Signatory type from MultiSig pallet.

* Fix JS integration tests.

* Add migration for MultiSig Signatory storage.

* Don't use scheduler to execute MS proposals.

* Add MultiSig secondary key permissions tests.

* Rust integration tests needs more memory.

* Remove auto_close flag from MultiSig and always close proposals when they have been rejected.

* Fix Rust integration test build.

* Rename MultiSigToIdentity to CreatorDid.

* Disable CI cache for Rust integration tests.

* Don't migrate the Votes storage, it will be cleared.

* MESH-2006 multisig improvements part 2 (#1690)

* Refactor ProposalDetails and ProposalStatus.

* Convert multisig pallet to frame v2.

* Refactor Multisig events.

* Don't use Concat based hashing on the Proposal in storage map ProposalIds.

* Don't use Context::current_identity in multisig pallet.  Use the MS's linked DID or it's creator DID.

* Fix bridge controller's CreatorDID.

* Allow a primary key to use custom permissions when making a multisig a secondary key.

* Add tests for 'make_multisig_secondary'.

* Support adding/removing multiple MS signers.

* Emit one event when adding/removing many signers.

* Add execution reentry guard to multisig proposal execution.

* Fix benchmark for approve and create_proposal.

* Use bounded vec for multisig signers.

* Fix multisig unit tests.

* Make MaxSigners a constant in the metadata.

* Remove bridge part 1 (#1691)

* Remove Bridge extrinsics, events, errors.  Only keep the storage.

* MESH-2006 multisig improvements part 3 (#1693)

* Remove multisig.create_or_approve_proposal extrinsic and multisig.ProposalIds storage.

* Prune multisig proposal when it is executed/rejected.

* Rename MultiSigTxDone to NextProposalId.

* MESH-2209 multisig improvements part 4 (#1697)

* Rename MS creator to admin and add paying DID support.

* Split a long running test into smaller tests.

* Restrict the total number of signers on a multisig.

* Always use the Multisig's DID for adding new signers.

* Multisig nesting is not allowed.

* Fix test build.

* Allow a multisig to remove it's paying DID to pay their own fees.

* Add join identity support to MultiSig.

* The approve_join_identity call is paid by the joining DIDs primary key.

* Add some missing events.

* Use wasm based weights.

* Add tests for remove_payer.

* Remove use of Context::current_identity (#1698)

* Remove use of Context::current_identity

* Add some more TODOs.

* Remove Context::set_current_identity() calls from unit tests.

* Remove some more current_identity from unit tests.

* Use controller not stash for Unbonded event.

* Fix remove_authorization for unlinked keys.

* Use GC_DID in treasury event.

* Lint fix.

* Finish TODOs.

* Remove all Context::current_identity code.

* Remove identity CurrentDid storage.
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.

3 participants