-
Notifications
You must be signed in to change notification settings - Fork 152
Migrate solver's ethcontract::Account to alloy #3995
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
Conversation
a265d81 to
c2518d8
Compare
c2518d8 to
0e6210e
Compare
| /// An address is used to identify the account for signing, relying on the | ||
| /// connected node's account management features. This can also be used to | ||
| /// start the driver in a dry-run mode. | ||
| Address(eth::Address), |
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.
This is a breaking change. For testing purposes it's really nice to be able to plug in a public address. This ensures that the driver will not be able to submit a transaction while you are experimenting (avoid loss of money).
Additionally this allows you to role play as an already allow listed account to bypass the authentication contract.
This should be easy to address with your new Account enum. We just need a PublicAddress(Address) variant that always errors out when it's supposed to sign something. Also we don't add those accounts to the wallet.
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.
I see, will add one then. It will error out anyway on the alloy side because node-side signing goes through a different path in alloy
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.
It will error out anyway on the alloy side because node-side signing goes through a different path in alloy
Without the new variant you'll not be able to construct an Account instance from a public Address since it can't be used to construct a PrivateKeySigner.
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.
m-sz
left a comment
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.
LGTM except for @MartinquaXD 's comment. Will approve then.
Description
Migrates the solver ethcountract::Account's to alloy
Changes
with_signerfunctionHow to test
Existing tests