MESH-2006 multisig improvements part 1#1687
Merged
Neopallium merged 18 commits intodevelopfrom Aug 15, 2024
Merged
Conversation
adamdossa
approved these changes
Jul 28, 2024
HenriqueNogara
approved these changes
Jul 29, 2024
69d8dd7 to
a4740dd
Compare
Contributor
Author
|
Rebased to |
a4740dd to
c0e77f6
Compare
423e9ae to
fa4ccd8
Compare
…they have been rejected.
* 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 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.
72d94dd to
1c76b51
Compare
* 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.
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.
changelog
new features
multisig.add_multisig_signersandmultisig.remove_multisig_signers.CreatorDidintoAdminDidandPayingDid.*_via_admincontrols.*_via_admincontrols. The admin DID can also remove itself as the admin of a multisig.identity.leave_identity_as_key) and join a new identity usingmultisig.approve_join_identityand the transaction fees will be paid by the primary key of the joining identity.modified external API
Multisig.create_or_approve_proposalMultisig.ProposalIdssince we don't lookup proposal ids from the proposal call.Multisig.MultiSigTxDonetoMultisig.NextProposalId.*_as_identityMultiSig extrinsic calls._as_keyfrom all MultiSig extrinsics.MultiSigSignerstype fromSignatory<AccountId>to justAccountId.Signatory<AccountId>type withAccountIdin the MutliSig pallet's events, storage and extrinsics.auto_closefrom theProposalDetailstype (andProposalDetailstorage).ProposalDetailstorage into two storage itemsProposalVoteCountsandProposalStates.ProposalVoteCountsonly stores the approval/rejection vote counts.ProposalStatesonly store the state and expirey.Proposalvalue in double mapMultiSig.ProposalIdsfromBlake2_128ConcattoBlake2_128.multisig.make_multisig_secondarytake an optional set of permissions. Only the creator's primary key can set custom permissions.multisig.add_multisig_signerhas been replaced withmultisig.add_multisig_signersto allow adding multiple signers.multisig.remove_multisig_signerhas been replaced withmultisig.remove_multisig_signersto allow removing multiple signers.BoundedVec<AccountId, T::MaxSigners>for signers list when creating/adding/removing multisig signers. Multisigs can still have more thanT::MaxSigners, the limit is just used for a single call.*_via_creatorto*_via_admin.CreatorDidrenamed toAdminDid.PayingDidto hold the identity that pays transaction fees.PayingDidby default, but doesn't have admin controls.create_multisignow 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.make_multisig_primary,make_multisig_secondaryandremove_creator_controlsextrinsics.remove_creator_controlswithremove_admin_via_adminextrinsic.CurrentDidfrom identity pallet. This value was only set during a transaction and cleared when the transaction finished (even on errors).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 inapprove_join_identityto accept a join identity authorization.AuthToProposalIdused bymultisig.approve_join_identityto map anauth_idtoproposal_id.modified events
MultiSigSignaturesRequiredChangedtoMultiSigSignersRequiredChanged.MultiSig.ProposalExecutedevent is now emitted for both successful and failed executions. Theresultfield is used to see if the execution failed and get the error.MultiSig.ProposalFailedToExecutehas been removed, since the error is available in theProposalExecutedevent.MultiSigSignerAuthorizedtoMultiSigSignersAuthorizedand change thesignerfield tosignersas a bounded vec. Now only one event is emitted when adding multiple signers.MultiSigSignerRemovedtoMultiSigSignersRemovedand change thesignerfield tosignersas a bounded vec. Now only one event is emitted when removing multiple signers.caller_didis now optional for multisig events:ProposalAdded,ProposalExecuted,MultiSigSignersRequiredChanged,ProposalApprovalVote,ProposalRejectionVote,ProposalApproved, andProposalRejected. Since the multisig could be unlinked from an identity when those events are emitted.FinalVotes,Approved,Rejected, andExecuted.ReleaseCoordinatorUpdated.new events
MultiSig.ProposalApprovalVoteevent to signal an approval vote instead of eventProposalApproved. TheProposalApprovedevent is now only emitted when the proposal has received enough votes to be executed.MultiSigAddedAdmin,MultiSigRemovedAdmin, andMultiSigRemovedPayingDid.other
Context::current_identity*API.data migration
MultiSig.ProposalDetailstorage.Signatorytype.MultiSigToIdentity.MultiSigTxDonetoNextProposalId.Multisig.LostCreatorPrivileges.Multisig.CreatorDidtoMultisig.PayingDidandMultisig.AdminDid(only ifLostCreatorPrivilegeshasn't been set).