-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 v2] Enhanced multisig v2 with batch operations and the max pending txn limit #12241
Conversation
⏱️ 5h 49m total CI duration on this PR
🚨 1 job on the last run was significantly faster/slower than expected
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12241 +/- ##
=========================================
- Coverage 63.9% 63.9% -0.1%
=========================================
Files 799 801 +2
Lines 177623 177641 +18
=========================================
+ Hits 113628 113629 +1
- Misses 63995 64012 +17 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the underflow comment, I think this solves the DoS problem. Can you confirm this is the flow that happens in practice for an m-of-n multisig?
- Attacker compromises a signer, submits 10 bogus txns to the queue
- m signers call
vote_all_transactions()
withapproved = false
- Evictor calls
create_transaction_with_eviction()
with payload ofswap_owners_and_update_signatures_required()
- m - 1 signers approve the new payload
- Evictor executes the payload
- Evictor invokes
execute_rejected_transactions()
- Multisig has empty queue and honest signatory set
#[view] | ||
public fun available_transaction_queue_capacity(multisig_account: address): u64 acquires MultisigAccount { | ||
let multisig_account_resource = borrow_global_mut<MultisigAccount>(multisig_account); | ||
let num_pending_transactions = multisig_account_resource.next_sequence_number - multisig_account_resource.last_executed_sequence_number - 1; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next_sequence_number
is initially 1. So, there should be no underflow:
next_sequence_number: 1, |
@alnoki , in the step list above ^^, the order of the step 5 and the step 6 should be swapped because the payload would be at the end of the queue. Other than that, the flow looks right! |
775cbad
to
414fad4
Compare
414fad4
to
af48cbe
Compare
@junkil-park yes, thank you for the clarification. Noting that in between invocation of But seeing as the new functionality nevertheless deters flooding behavior, regardless of how many "cycles" of queue packing there are, this flow should solve the DoS problem and I approve the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions:
- Add support for the new bulk operations in the CLI
- Remove the _with_eviction version. This is adding a lot of entry functions that are not useful for the common cases. In case where there's a lot of txs to be rejected and a new one to be inserted at the same time, a script can be used with the CLI
@movekevin the cc @junkil-park |
@alnoki , I think Kevin suggests using a script in this case while simplifying the Multisig module API. |
af48cbe
to
30a4349
Compare
@junkil-park scripts can offer the same functionality, but they introduce major UX overhead since scripts can essentially only be submitted from the CLI at present. This contrasts with standalone public entry functions which are easily accessible in a variety of formats, most notably through MSafe's UI |
30a4349
to
7fccf86
Compare
- introduced and enforced `MAX_PENDING_TRANSACTIONS` - added entry functions for batch voting - added entry functions for batch executing rejected transactions
7fccf86
to
a8bff20
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Description
MAX_PENDING_TRANSACTIONS
This PR resolves #8411.
Test Plan
aptos move test