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

Multisig #1193

Merged
merged 31 commits into from
Nov 8, 2024
Merged

Multisig #1193

merged 31 commits into from
Nov 8, 2024

Conversation

immrsd
Copy link
Collaborator

@immrsd immrsd commented Oct 25, 2024

Fixed #21

  • Tests
  • Documentation
  • Added entry to CHANGELOG.md
  • Tried the feature on a public network

@immrsd immrsd requested a review from ericnordelo October 25, 2024 08:36
@immrsd immrsd self-assigned this Oct 25, 2024
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 95.70552% with 7 lines in your changes missing coverage. Please review.

Project coverage is 92.02%. Comparing base (02c9ce6) to head (a7c569e).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
packages/governance/src/multisig/multisig.cairo 96.47% 5 Missing ⚠️
...ckages/governance/src/multisig/storage_utils.cairo 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1193      +/-   ##
==========================================
+ Coverage   91.56%   92.02%   +0.46%     
==========================================
  Files          47       49       +2     
  Lines        1233     1392     +159     
==========================================
+ Hits         1129     1281     +152     
- Misses        104      111       +7     
Files with missing lines Coverage Δ
packages/account/src/account.cairo 98.11% <ø> (ø)
.../governance/src/timelock/timelock_controller.cairo 88.70% <100.00%> (ø)
packages/governance/src/utils/call_impls.cairo 78.57% <100.00%> (ø)
packages/testing/src/constants.cairo 100.00% <100.00%> (ø)
...ckages/governance/src/multisig/storage_utils.cairo 85.71% <85.71%> (ø)
packages/governance/src/multisig/multisig.cairo 96.47% <96.47%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02c9ce6...a7c569e. Read the comment docs.

Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @immrsd, I quickly went over the PR and the design is looking good, my main suggestion is to follow the off-chain approach for handling proposals similar to what we do in timelock and governor. Also, I know is a first iteration and there's no a lot of comments, but let's prioritize adding comment to functions so is also easier to review and keep track of everything.

packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
@immrsd immrsd marked this pull request as ready for review November 4, 2024 20:27
Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good @immrsd! Left some comments.

packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
packages/governance/src/multisig/multisig.cairo Outdated Show resolved Hide resolved
@ericnordelo
Copy link
Member

Also, if a signer is removed, should pending transactions be canceled since the signers that may have confirmed may have been the removed ones, and the confirmations of the transaction are not decreased while the quorum may have been? cc @andrew-fleming.

@immrsd
Copy link
Collaborator Author

immrsd commented Nov 6, 2024

Also, if a signer is removed, should pending transactions be canceled since the signers that may have confirmed may have been the removed ones, and the confirmations of the transaction are not decreased while the quorum may have been? cc @andrew-fleming.

That may be an issue indeed, good call. To my mind, introducing a new tx Canceled state and keeping track of all pending txs would overcomplicate the implementation and make it more error-prone. I addressed this issue by making confirmations a computable property that's not stored in the storage. It's calculated by iterating through all current signers and checking if a signer has confirmed the tx.

Only execute function becomes a bit more expensive in terms of computation, but it also removes storage variable for tracking number of confirmations and the necessity to update it in the confirm_transaction and revoke_confirmation functions

@immrsd immrsd requested a review from andrew-fleming November 6, 2024 20:46
Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The improvements look good! I left a few comments—really just one that needs to be addressed

@immrsd immrsd requested a review from andrew-fleming November 7, 2024 07:08
@ericnordelo ericnordelo mentioned this pull request Nov 7, 2024
4 tasks
Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@immrsd immrsd requested a review from ericnordelo November 7, 2024 19:59
Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments on the comments :). Besides that I think is ready to merge.

@immrsd immrsd requested a review from ericnordelo November 8, 2024 05:58
Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@immrsd immrsd merged commit 90bc317 into OpenZeppelin:main Nov 8, 2024
8 checks passed
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.

Add basic multisig Account
3 participants