-
Notifications
You must be signed in to change notification settings - Fork 39
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
System contract for registering external callbacks to be executed at the end of a batch. [WIP] #2135
Conversation
@@ -0,0 +1,19 @@ | |||
# Public Callbacks Contract | |||
|
|||
The PublicCallbacks contract provides a mechanism for registering and executing callbacks in a gas-efficient manner. It is designed to be used by contracts that need to hide their gas cost whenever executing something and make the state change immutable if proxied. |
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.
not only hide gas cost. Also make the action impossible to revert if the result is not positive
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 in principle. Nice work!
Left a few minor comments
callbacks[nextCallbackId++] = Callback({target: callback, data: data, value: value, baseFee: block.basefee}); | ||
} | ||
|
||
function register(bytes calldata callback) external payable { |
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.
what is this for?
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.
Nice work!
Why this change is needed
In order to implement privacy sensitive games for gas we need a new system contract that enables registering callbacks to be called at the end of a batch from the system
What changes were made as part of this PR
Please provide a high level list of the changes made
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks