refactor: wallet management#7141
Merged
Merged
Conversation
mattsse
requested changes
Feb 15, 2024
mattsse
left a comment
Member
There was a problem hiding this comment.
but this brings wallet-management closer to the cheatcodes,
I think we want this, yes
style nits,
ptal @DaniPopes
mattsse
requested changes
Feb 15, 2024
mattsse
left a comment
Member
There was a problem hiding this comment.
more nits, otherwise lgtm
pending @DaniPopes
mattsse
approved these changes
Feb 16, 2024
mattsse
left a comment
Member
There was a problem hiding this comment.
a few additional docs would be great, otherwise lgtm
pending @DaniPopes @Evalir
DaniPopes
approved these changes
Feb 17, 2024
DaniPopes
left a comment
Member
There was a problem hiding this comment.
lgtm, mostly just avoiding cloning
Evalir
approved these changes
Feb 19, 2024
ce59859 to
f1ff391
Compare
|
Hey, this is excellent. Nice. |
Member
|
send it @klkvr ? |
This was referenced Mar 6, 2024
This was referenced Apr 26, 2024
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.
Motivation
This PR fixes two issues:
--senderargument when the sender can be determined from keystore or hw wallet. (A better UX about wallet management #6034)The idea was to rewrite
MultiWalletinto something that can be passed through script executionSolution
This PR consists of several parts:
wallets/utils, so that it's easier to navigate and we no more duplicating stuff.MultiWalletandPendingWallet.MultiWalletcontains set ofWalletSignerwhich is our enum wrapping ethers-signers objects and also a set ofPendingWallet, those are wallets which require user action to be unlocked. Currently it's only keystores and interactively requested private keys. The idea here is thatMultiWalletis an entity created once and used for the whole duration of the wallet interaction and on the first time signers are requested, all pending wallets are getting unlocked.chain_idon signers and set it to 1 by default. This can be cleaned up once we migrate to alloy signers which havechain_idfield optionalMultiWalletto cheatcodes inspector behingArc<Mutex>. Use it in cheatcodes to determine sender for "anonymous" broadcasts and add remembered private keys directly toMultiWalletstorage. Mutex here shouldn't really cause any threads to wait for locks asCheatcodesare only getting cloned and used in several threads when running tests, for whichscript_walletsis being set to None as we are not collecting anything from it for tests.Not sure if there was a demand for it, but this brings wallet-management closer to the cheatcodes, and would let us add support for
vm.signthrough local wallets (for example, signing stuff in script via ledger or keystore).