Skip to content

Inomurko/bump bundler #698

Merged
InoMurko merged 22 commits intodevelopfrom
inomurko/bump-bundler-2
May 3, 2023
Merged

Inomurko/bump bundler #698
InoMurko merged 22 commits intodevelopfrom
inomurko/bump-bundler-2

Conversation

@InoMurko
Copy link
Copy Markdown
Contributor

@InoMurko InoMurko commented Apr 10, 2023

This PR brings in 0.5.0 Bundler changes from upstream.
It also introduces a wrapper contract EntryPointWrapper for the purpose of EntryPoint interaction through custom errors that our l2geth currently does not support.

Overview

Re-enabled and fixed tests:
boba_aa_wallet.spec
boba_aa_sponsoring_fee.spec
boba_aa_fee_boba.spec
boba_aa_fee_alt_token.spec

Changes

Describe your changes and implementation choices. More details make PRs easier to review.

  • Renaming everything from Wallet to Account
  • I think GethTracer could be deleted, but post Bedrock it might be useful (or even with Tenderly now)
  • Brings in mempool support

Testing

Unit tests and integration tests are in the PR

@InoMurko InoMurko force-pushed the inomurko/bump-bundler-2 branch 5 times, most recently from de6bd09 to 0e4b621 Compare April 12, 2023 09:50
@InoMurko InoMurko changed the title Inomurko/bump bundler 2 Inomurko/bump bundler Apr 20, 2023
@InoMurko InoMurko force-pushed the inomurko/bump-bundler-2 branch from 55249c7 to 654b5ab Compare April 24, 2023 18:46
Comment thread integration-tests/test/eth-l2/boba_aa_wallet.spec.ts Outdated
@InoMurko InoMurko force-pushed the inomurko/bump-bundler-2 branch 3 times, most recently from 0c5fae4 to 4ec5d7f Compare April 25, 2023 19:40
@InoMurko InoMurko force-pushed the inomurko/bump-bundler-2 branch 2 times, most recently from d588069 to cf77369 Compare April 28, 2023 12:17
@InoMurko InoMurko marked this pull request as ready for review April 28, 2023 14:53
Comment thread packages/boba/bundler/contracts/tests/TestStorageAccount.sol
entryPoint = _entryPoint;
}

function simulateValidation(UserOperation calldata userOp) external returns (FailedOpStatus memory, Response memory) {
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.

one thing I noticed when using this why we don't have the same return types for this and the actual entryPoint simulateValidation.

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.

can you elaborate?

the return of entrypoint does not matter much, because all code paths use custom revert (ValidationResultWithAggregation, ValidationResult, FailedOp)

}
// await EntryPoint__factory.connect(this.config.entryPoint,this.provider).callStatic.addStake(0)

// const err = await EntryPoint__factory.connect(
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.

do we need this?

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.

https://github.com/eth-infinitism/bundler/blob/v0.5.0/packages/bundler/src/BundlerServer.ts#L74-L79

we might want to support this via the Wrapper contract, currently we cannot run this!

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.

break
// custom errors post bedrock!
// case 'eth_estimateUserOperationGas':
// result = await this.methodHandler.estimateUserOperationGas(
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.

shouldn't we instead return an error that informs the user that the method exists but is not currently supported?

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.

otherwise it's just the generic not supported/not exists error

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.

i think this is the same endpoint you are working on? so we can add this back? "estimateUserOperationGas"

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, that can be fixed later on. for now I added a new error type and throw an error for not supported

Comment thread packages/boba/bundler/src/GethTracer.ts
Copy link
Copy Markdown
Contributor

@souradeep-das souradeep-das left a comment

Choose a reason for hiding this comment

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

this is super, lets go 🚀

Comment thread .circleci/config.yml
docker-compose -f <<parameters.docker_compose_file>> -f docker-compose-side.yml up -d bobalink aa_deployer bundler
working_directory: ops
- run:
name: Start background logging
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.

L257 - lets uncomment test_flow_bundler_and_depcheck?

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.

this actually does not exist in upstream anymore! will remove completely

DeterministicDeployer,
HttpRpcClient,
SimpleAccountAPI,
} from '../../../bundler_sdk/dist'
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.

external dep (although isok, i dont think runop is used extensively)

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.

resolved nevertheless!


const ctr = hexValue(new SampleRecipient__factory(ethers.provider.getSigner()).getDeployTransaction().data!)
DeterministicDeployer.init(ethers.provider, testWallet)
console.log(DeterministicDeployer.init(ethers.provider, testWallet))
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.

maybe we want to remove log?
(here and L36)

accountAPI = new SimpleAccountAPI({
provider: env.l2Provider,
entryPointAddress,
senderCreatorAddress: senderCreator.address,
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.

minor: since we are passing accountAddress, do we need to pass senderCreator additionally?
( if we dont need it we could remove it from L141)
(applies to the other tests files)


before('the user approves the paymaster to spend their $BOBA token', async () => {
// deploy a 4337 Wallet and send operation to this wallet
SimpleAccount__factory = new ContractFactory(
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.

super minor: should we call it 'SimpleAccountFactory__factory'?

(applies to the other tests files)

Comment on lines +206 to +207
console.log(log.args.msgSender)
console.log(account)
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.

unless this was added on purpose :D

entryPointAddress,
senderCreatorAddress: senderCreator.address,
owner: env.l2Wallet,
factoryAddress: accountFactory.address,
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.

lets remove factoryAddress and senderCreatorAddress here since we specify accountAddress?

to: await op.sender,
})

//what is this supposed to be?
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.

minor: a comment we can rem now 😄

target: recipient.address,
data: recipient.interface.encodeFunctionData('something', ['hello']),
})
await env.l2Wallet.sendTransaction({
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.

minor: we are sending eth two times? on L181 too?

@InoMurko InoMurko force-pushed the inomurko/bump-bundler-2 branch from 9c0ddd1 to ba17f52 Compare May 3, 2023 09:12
@InoMurko InoMurko force-pushed the inomurko/bump-bundler-2 branch from ba17f52 to 8794c88 Compare May 3, 2023 09:12
@InoMurko InoMurko force-pushed the inomurko/bump-bundler-2 branch from 8794c88 to a589698 Compare May 3, 2023 09:21
@InoMurko InoMurko merged commit 6368c72 into develop May 3, 2023
@InoMurko InoMurko deleted the inomurko/bump-bundler-2 branch May 3, 2023 09:58
InoMurko added a commit that referenced this pull request May 8, 2023
* 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)
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants