Skip to content

MESH-2006 multisig improvements part 2#1690

Merged
adamdossa merged 15 commits intoMESH-1955-multisig-improvementsfrom
MESH-1955-multisig-improvements-part-2
Aug 13, 2024
Merged

MESH-2006 multisig improvements part 2#1690
adamdossa merged 15 commits intoMESH-1955-multisig-improvementsfrom
MESH-1955-multisig-improvements-part-2

Conversation

@Neopallium
Copy link
Copy Markdown
Contributor

@Neopallium Neopallium commented Jul 16, 2024

changelog

new features

  • Convert the multisig pallet to frame v2.
  • A Multisig can be made a secondary key with custom permissions (if called by the primary key).
  • A Multisig can add/remove multiple singers in a single proposal now with multisig.add_multisig_signers and multisig.remove_multisig_signers.

modified external API

  • Refactor the ProposalDetail storage into two storage items ProposalVoteCounts and ProposalStates. ProposalVoteCounts only stores the approval/rejection vote counts. ProposalStates only store the state and expirey.
  • Change the key hasher of the Proposal value in double map MultiSig.ProposalIds from Blake2_128Concat to Blake2_128.
  • multisig.make_multisig_secondary take an optional set of permissions. Only the creator's primary key can set custom permissions.
  • multisig.add_multisig_signer has been replaced with multisig.add_multisig_signers to allow adding multiple signers.
  • multisig.remove_multisig_signer has been replaced with multisig.remove_multisig_signers to allow removing multiple signers.
  • Use BoundedVec<AccountId, T::MaxSigners> for signers list when creating/adding/removing multisig signers. Multisigs can still have more than T::MaxSigners, the limit is just used for a single call.
  • Added an multisig proposal execution reentry guard to prevent nested proposal executions.

modified events

  • The multisig events now use struct variants instead of tuple variants.
  • MultiSig.ProposalExecuted event is now emitted for both successful and failed executions. The result field is used to see if the execution failed and get the error.
  • MultiSig.ProposalFailedToExecute has been removed, since the error is available in the ProposalExecuted event.
  • Renamed MultiSigSignerAuthorized to MultiSigSignersAuthorized and change the signer field to signers as a bounded vec. Now only one event is emitted when adding multiple signers.
  • Renamed MultiSigSignerRemoved to MultiSigSignersRemoved and change the signer field to signers as a bounded vec. Now only one event is emitted when removing multiple signers.

new events

  • Add MultiSig.ProposalApprovalVote event to signal an approval vote instead of event ProposalApproved. The ProposalApproved event is now only emitted when the proposal has received enough votes to be executed.

data migration

  • Migration to remove old MultiSig.ProposalDetail storage.

@Neopallium Neopallium changed the title [WIP] Mesh 1955 multisig improvements part 2 Mesh 1955 multisig improvements part 2 Jul 22, 2024
@Neopallium Neopallium changed the title Mesh 1955 multisig improvements part 2 MESH-1955 multisig improvements part 2 Jul 23, 2024
@Neopallium Neopallium changed the title MESH-1955 multisig improvements part 2 MESH-2006 multisig improvements part 2 Jul 23, 2024
@Neopallium Neopallium force-pushed the MESH-1955-multisig-improvements branch from 69d8dd7 to a4740dd Compare July 30, 2024 12:59
@Neopallium Neopallium force-pushed the MESH-1955-multisig-improvements-part-2 branch from 1a4a195 to 344c16c Compare July 30, 2024 13:01
@Neopallium Neopallium force-pushed the MESH-1955-multisig-improvements branch from a4740dd to c0e77f6 Compare July 31, 2024 10:40
@Neopallium Neopallium force-pushed the MESH-1955-multisig-improvements-part-2 branch from 344c16c to ec20cb7 Compare July 31, 2024 10:45
@adamdossa adamdossa merged commit 423e9ae into MESH-1955-multisig-improvements Aug 13, 2024
@adamdossa adamdossa deleted the MESH-1955-multisig-improvements-part-2 branch August 13, 2024 13:47
Neopallium added a commit that referenced this pull request Aug 13, 2024
* 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.
Neopallium added a commit that referenced this pull request Aug 14, 2024
* 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.
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