-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(protocol): move prover assignment verification to hook #15208
Conversation
Co-authored-by: Daniel Wang <[email protected]> Co-authored-by: David <[email protected]> Co-authored-by: Roger <[email protected]>
Co-authored-by: Daniel Wang <[email protected]> Co-authored-by: adaki2004 <[email protected]> Co-authored-by: D <[email protected]>
Co-authored-by: D <[email protected]>
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.
Looks good, just some small comments.
// Run all hooks. | ||
// Note that address(this).balance has been updated with msg.value, | ||
// prior to any code in this function has been executed. | ||
uint256 ethBalance = address(this).balance - msg.value; |
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 think no ETH is stored in this contract, so this could simply be address(this).balance
? Same thing below I think where instead of having to keep track of msgValue
, it could always just be address(this).balance
.
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.
True. I added some comments and removed ethBalance
uint256 ethBalance = address(this).balance - msg.value; | ||
|
||
// Run hooks | ||
for (uint256 i; i < params.hookCalls.length; ++i) { |
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.
Is it necessary/useful to support multiple hooks? Seems like only a single hook will probably be used, and even then this single hook itself can call into multiple other smart contracts if necessary.
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 think one hook is good enough for default scenario, but I want to support multiple hooks so proposers, with their imagination, can do extra things.
Brecht, David, Dani, I'm trying to prototype this hook idea so more logics can be extracted away from the protocol. Take a look at this, so later we can brainstorm a bit. No rush though.