Skip to content

[AA]: fix inconsistent userOpHash#757

Merged
souradeep-das merged 7 commits intodevelopfrom
souradeep/aa_update_userOpHash
May 4, 2023
Merged

[AA]: fix inconsistent userOpHash#757
souradeep-das merged 7 commits intodevelopfrom
souradeep/aa_update_userOpHash

Conversation

@souradeep-das
Copy link
Copy Markdown
Contributor

@souradeep-das souradeep-das commented May 1, 2023

📋 closes https://github.com/bobanetwork/boba/issues/690

Overview

Add upstream changes to AA contracts (primarily fix inconsistent userOpHash issue)

To merge after https://github.com/bobanetwork/boba/pull/698 is merged

Changes

  • add token callback handler on SimpleAccount (to support receiving ERC721/1155)
  • fix: inconsistent userOpHash issue
  • prevent recursive calls in handleOps method
  • move nonce validation from individual Account to EntryPoint

Notes

Testing

/

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Patch coverage: 64.00% and project coverage change: +0.01 🎉

Comparison is base (a07ee58) 52.42% compared to head (2ab9a53) 52.44%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #757      +/-   ##
===========================================
+ Coverage    52.42%   52.44%   +0.01%     
===========================================
  Files          167      168       +1     
  Lines         7622     7644      +22     
  Branches      1572     1572              
===========================================
+ Hits          3996     4009      +13     
- Misses        3626     3635       +9     
Flag Coverage Δ
coverage 52.44% <64.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nt-abstraction/contracts/samples/SimpleAccount.sol 93.61% <ø> (ø)
...ontracts/samples/callback/TokenCallbackHandler.sol 0.00% <0.00%> (ø)
.../account-abstraction/contracts/core/EntryPoint.sol 98.20% <100.00%> (+0.01%) ⬆️
...oba/account-abstraction/contracts/core/Helpers.sol 100.00% <100.00%> (ø)
...abstraction/contracts/interfaces/UserOperation.sol 88.88% <100.00%> (+5.55%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@souradeep-das souradeep-das marked this pull request as ready for review May 1, 2023 14:48
@souradeep-das souradeep-das requested review from InoMurko and wsdt May 1, 2023 14:48
*/
function nonce() public view virtual returns (uint256);
function getNonce() public view virtual returns (uint256) {
return entryPoint().getNonce(address(this), 0);
Copy link
Copy Markdown
Contributor

@InoMurko InoMurko May 1, 2023

Choose a reason for hiding this comment

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

was just discussing this on twitter lol, why is nonce handling handled on the entrypoint contract?

I guess it makes sense since the bundler submitter nonce actually gets bumped not the userop sender

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah! if user account contracts are allowed to control nonces - (or not have nonces) - the userOpHash might not be a unique value and that might confuse wallets/explorers. Because of that they moved the validation to the EntryPoint. found more details here :)
https://docs.google.com/document/d/1MywdH_TCkyEjD3QusLZ_kUZg4ZEI00qp97mBze9JI4k/edit#heading=h.gyhqxhuyd59n

}

uint256 collected = 0;
emit BeforeExecution();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is this? :D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh since there can be recursive calls to handleOps() (and the handleAggregatedOps()), understanding the order of emitted events and parsing is difficult. This event emitted before every execution is like a separator for each execution (if recursive)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sweet!


UserOpInfo[] memory opInfos = new UserOpInfo[](totalOps);

emit BeforeExecution();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same ^^

@souradeep-das souradeep-das changed the title [AA]: fix inconsistnet userOpHash [AA]: fix inconsistent userOpHash May 2, 2023
@souradeep-das
Copy link
Copy Markdown
Contributor Author

note: to be merged after https://github.com/bobanetwork/boba/pull/698 and ensure tests pass
thanks for the review guys!

@souradeep-das souradeep-das merged commit cc4e205 into develop May 4, 2023
@souradeep-das souradeep-das deleted the souradeep/aa_update_userOpHash branch May 4, 2023 12:54
InoMurko pushed a commit that referenced this pull request May 8, 2023
* add token callback handler on SimpleAccount

* fix: userOpHash packing

* prevent recursive calls into handleOps

* move nonce validation from individual Account to EntryPoint

* add bundler changes for nonce change to EP

(cherry picked from commit cc4e205)
InoMurko added a commit that referenced this pull request May 8, 2023
* Inomurko/bump bundler  (#698)

* bump bundler, limit dependency bumps

* uncomment bundler related stuff

* build bundler in docker

* build fixes

* fix tests

* fix bundler building

* uncomment _disableInitializers

* fix running DTL

* v1.0.0

* fixing starting bundler and tests, default config

* local unsafe, linting fix in intg tests

* custom errors fixes

* new api for simple account contract

* use simple account factory proxy

* use simple account factory proxy in SimpleAccountAPI

* use simple account factory proxy in SimpleAccountAPI

* use wrappers to get around custom errors

* update entrypoint wrapper (#745)

* sponsoring fee fixed

* stricter validation for staking

* remove debug namespace, fix return for unaavailable rpc methods

* addressing Souradeeps comments

---------

Co-authored-by: Souradeep Das <dsouradeep2@gmail.com>
(cherry picked from commit 6368c72)

* fix: qsp30 (#773)

fix: BOB1-30
(cherry picked from commit 7feda88)

* run op fix (#771)

(cherry picked from commit 176cd3c)

* close-server (#768)

(cherry picked from commit 72021af)

* [AA]: fix inconsistent userOpHash (#757)

* add token callback handler on SimpleAccount

* fix: userOpHash packing

* prevent recursive calls into handleOps

* move nonce validation from individual Account to EntryPoint

* add bundler changes for nonce change to EP

(cherry picked from commit cc4e205)

* ValidationManager account for signature expiration (#775)

* resolve #753

* Update packages/boba/bundler/src/modules/ValidationManager.ts

Co-authored-by: Ino Murko <ino.murko.github@protonmail.com>

* fix bool

* validAfter/Until integrationt tests, validAfter

* cleanup

* regex

* integration_tests

* integration & unit tests

---------

Co-authored-by: Ino Murko <ino.murko.github@protonmail.com>
(cherry picked from commit ef02bee)

* npm release workflow for bundler-sdk (#749)

(cherry picked from commit 718141f)

* Fix/banxa and bridges (#772)

* adding boba network

* fixing boba bridge url

* fixing bridge integration

* replace code by selectors

* remove hardcoded symbol

* enable banxa only for mainnet

* Available bridge inable only for mainnet

* adding support for testnet

* update conditional for other bridges

* implemented the available bridges with typescript

* unit test cases for available bridges

* typo in Available bridges

---------

Co-authored-by: alvaro-ricotta <alvaro.e.ricotta@gmail.com>
Co-authored-by: alvaro-ricotta <81116391+alvaro-ricotta@users.noreply.github.com>
Co-authored-by: Ino Murko <ino.murko.github@protonmail.com>
(cherry picked from commit dcf9b7e)

* add validation of entryPoint and wrapper (#779)

* add validaiton of entryPoint and wrapper

(cherry picked from commit 41f3150)

---------

Co-authored-by: Souradeep Das <dsouradeep2@gmail.com>
Co-authored-by: Riedl Kevin, Bsc <kevin.riedl@wavect.io>
Co-authored-by: Sahil K <86316370+sk-enya@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AA] update AA contract with userOp collision fix

4 participants