Skip to content
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

Merged
merged 7 commits into from
Dec 20, 2023

Conversation

drortirosh
Copy link
Contributor

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

@drortirosh drortirosh force-pushed the AA-222-delegate-and-revert branch from 62afc47 to 1d63ae2 Compare December 10, 2023 10:56
forshtat
forshtat previously approved these changes Dec 18, 2023

/// @inheritdoc IEntryPoint
function delegateAndRevert(bytes calldata data) external {
(bool success, bytes memory ret) = address(this).delegatecall(data);

This comment was marked as resolved.

* 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;
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@drortirosh drortirosh merged commit 85bec5c into develop Dec 20, 2023
8 checks passed
@drortirosh drortirosh deleted the AA-222-delegate-and-revert branch December 20, 2023 22:10
drortirosh added a commit that referenced this pull request Jan 3, 2024
…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
drortirosh added a commit that referenced this pull request Jan 7, 2024
…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
DemonBarber1020 added a commit to DemonBarber1020/account-abstraction that referenced this pull request Aug 23, 2024
* 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]>
Copy link

@Missjones2 Missjones2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants