Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Refactor Multisig Pallet #6324

Closed
wants to merge 7 commits into from
Closed

Conversation

shawntabrizi
Copy link
Member

This is a PR that refactors the Multisig pallet to:

  • Reduce complexity of the extrinsics
  • Reduce duplicated code
  • Simplify weight calculations

This PR splits the approve_as_multi and as_multi functions into clear linear steps that can be followed to complete a multi-signature operation:

  1. create: Creates a multi-signature operation using the hash of the call.
  2. note_preimage: Allows any sender to upload the raw call preimage for a multi-signature call hash.
  3. approve: Allows anyone in the multi-signature to voice their approval for the call.
  4. complete: When a multi-signature operation reaches the threshold number of approvals, this will dispatch the call using the preimage that was uploaded.
  5. cancel: The original creator of the multisignature operation can close it before it is completed.

When combined with batch calls, this refactor can act just like the original pallet:

  • batch(create, note_preimage): Create a multisig with some stored call preimage
  • batch(approve, note_preimage, complete): The final approval of a multisig with no preimage can batch this call to complete the multisig.
  • batch(create, note_preimage, complete): 1 user threshold multisig created and completed in a single transaction

In progress

@shawntabrizi shawntabrizi added the A3-in_progress Pull request is in progress. No review needed at this stage. label Jun 10, 2020
@shawntabrizi shawntabrizi requested a review from gavofyork June 10, 2020 23:51
@xlc
Copy link
Contributor

xlc commented Jun 10, 2020

How do you know the timepoints parameter for approve/complete for a non exist multisig request? I don't think you can use batch to reduce number of txs.

@shawntabrizi
Copy link
Member Author

yes that is a good point. So you can batch anything after the initial create

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-in_progress Pull request is in progress. No review needed at this stage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants