-
Notifications
You must be signed in to change notification settings - Fork 672
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
AA-222 add delegateAndRevert helper, to simulate code execution from entryPoint. #365
Conversation
5a7ff61
to
73c5023
Compare
62afc47
to
1d63ae2
Compare
contracts/core/EntryPoint.sol
Outdated
|
||
/// @inheritdoc IEntryPoint | ||
function delegateAndRevert(bytes calldata data) external { | ||
(bool success, bytes memory ret) = address(this).delegatecall(data); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
contracts/interfaces/IEntryPoint.sol
Outdated
* The method always revert, so is only useful off-chain for dry run calls, in cases where state-override to replace | ||
* actual EntryPoint code is less convenient. | ||
*/ | ||
function delegateAndRevert(bytes calldata data) external; |
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 there a reason to have this method as part of the EntryPoint
interface? I think this is just a temporary workaround and should not affect the interface at all.
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.
yes, we removed all opinionated "view" functions from the EntryPoint, since "state-override" allows using custom functionalities.
But in case state override doesn't exist, this is the minimum required code in entrypoint to allow running off-chain code from entrypoint address without causing any side-effect.
e.g. state-override is not supported by estimateGas, at least on some node implementations. Bundlers can overcome this by rapid RPC "eth_call" calls to the node which they are close to - but end-users can't.
…entryPoint. (#365) Minimal "static" call from EntryPoint to simulate special cases. Equivalent to the EntryPointSimulations in purpose, but doesn't require stateOverride. Executes code on behalf of entryPoint using delegateCall, and revert with the result
…entryPoint. (#365) Minimal "static" call from EntryPoint to simulate special cases. Equivalent to the EntryPointSimulations in purpose, but doesn't require stateOverride. Executes code on behalf of entryPoint using delegateCall, and revert with the result
* update validation rules * spellings * merge changes from davidinsuomi:update-eip-4337-description-paymater from external PR eth-infinitism#378 * AA-222 add delegateAndRevert helper, to simulate code execution from entryPoint. (eth-infinitism#365) Minimal "static" call from EntryPoint to simulate special cases. Equivalent to the EntryPointSimulations in purpose, but doesn't require stateOverride. Executes code on behalf of entryPoint using delegateCall, and revert with the result * TokenPaymaster "gas-calc" test (eth-infinitism#300) * Initial commit for TokenPaymaster "gas-calc" test * Deploy all TokenPaymaster contracts with Create2Factory for "gas-calc" * Make TestPaymaster use postOp * Storage-Optimization for TokenPaymaster - change gas and timestamps to 48 bits - change blanaces and multipliers to 128 bit - saves 10kgas (and since 10-op batch uses the same TokenPaymaster, the * add initial balance to paymaster * editorial changes by yoav Co-authored-by: Yoav Weiss <[email protected]> * review changes * merge fixes * more review fix * Apply suggestions from code review Co-authored-by: Yoav Weiss <[email protected]> * make sure innerHandleOp gets enough gas. (eth-infinitism#401) * make sure innerHandleOps gets enough gas. UserOperation's call must receive at least callGasLimit. If there isn't enough provided to handleOps, the bundle should revert. * address yoav PR comments * added EREP-015: paymaster opsSeen if failure caused by other entity * Fixing reputation rules * update ERCs (eth-infinitism#404) * update ERCs * Update erc/ERCS/erc-7562.md Co-authored-by: Yoav Weiss <[email protected]> * Fixing pr * Update erc-7562.md * Update erc-7562.md * Fixing merge * Update erc/ERCS/erc-7562.md Co-authored-by: Yoav Weiss <[email protected]> * Update erc-7562.md: fixed typo * Update erc-7562.md (eth-infinitism#405) --------- Co-authored-by: Dror Tirosh <[email protected]> Co-authored-by: Alex Forshtat <[email protected]> Co-authored-by: Yoav Weiss <[email protected]> Co-authored-by: shahafn <[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.
Merge
Minimal "static" call from EntryPoint to simulate special cases. Equivalent to the EntryPointSimulations in purpose, but doesn't require stateOverride.
Executes code on behalf of entryPoint using
delegateCall
, and revert with the result