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

Entry Point v0.7 Support Feature Branch #694

Merged
merged 38 commits into from
Apr 19, 2024
Merged

Entry Point v0.7 Support Feature Branch #694

merged 38 commits into from
Apr 19, 2024

Conversation

dancoombs
Copy link
Collaborator

Proposed Changes

  • Entry Point v0.7 Support

dancoombs and others added 30 commits April 19, 2024 13:08
Correctly deserialize the `entryPoint` field, and display a more
descriptive error when deserialization fails.
Factors out the verification gas estimation logic, which performs a
binary search by making many `eth_call`s in a row, into a new trait,
`VerificationGasEstimator`, then provide implementations for v0.6 and
v0.7.

Some notable fixes along the way:

* Change the Rundler settings options around gas limits. There are now
  separate gas limits for all four things requiring gas in v0.7.
* Fixed some logic around v0.7's `simulateHandleOp`, which, unlike its
  counterpart in v0.6, returns its results normally rather than by
  reverting.
* Add some more functionality in and around `UserOperationBuilder` to
  facilitate updating fields in an existing `UserOperation`.
When validation fails in 0.7 in either simulation or gas estimation, the
entry point now surfaces the inner revert which caused validation to
fail. Surface this in the error response in the rpc, using the `data`
field to return an object with the fields:

- `entry_point_reason`: the entry point string like "AA99 some failure".
  This is the only field populated in v0.6.
- `inner_revert_bytes`: the raw bytes of the inner revert message.
- `inner_revert_reason`: if the inner revert is caused by a Solidity
  `require` or `assert`, then the string message provided to it.
Factors out the call gas estimation logic, which performs a binary
search using the `target` and `targetData` arguments to
`simulateHandleOp` along with some state override trickery, into a new
trait, `CallGasEstimator`, then provides implementations for v0.6 and
v0.7.
dphilipson and others added 8 commits April 19, 2024 13:09
Rather than hardcoding v0.6 entry point bytecode in two places, one with
the init code and one with the deployed code, use abigen to generate
Rust code for the v0.6 `EntryPoint.sol` and use the bytecode that was
generated.

This makes v0.6 `IEntryPoint.sol` unnecessary, to remove it and convert
all occurrences of `v0_6::i_entry_point::IEntryPoint` to
`v0_6::entry_point::EntryPoint`.
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 51.24789% with 2598 lines in your changes are missing coverage. Please review.

Project coverage is 55.19%. Comparing base (979f15b) to head (5273c93).

Additional details and impacted files

Impacted file tree graph

Files Coverage Δ
crates/builder/src/server/remote/protos.rs 0.00% <ø> (ø)
crates/pool/src/mempool/mod.rs 100.00% <100.00%> (+10.11%) ⬆️
crates/pool/src/mempool/paymaster.rs 93.62% <100.00%> (+0.01%) ⬆️
crates/pool/src/mempool/reputation.rs 85.25% <ø> (+5.13%) ⬆️
crates/pool/src/server/remote/server.rs 0.00% <ø> (ø)
crates/provider/src/ethers/provider.rs 0.00% <ø> (ø)
crates/provider/src/traits/provider.rs 100.00% <ø> (ø)
crates/rpc/src/eth/events/mod.rs 100.00% <100.00%> (ø)
crates/rpc/src/eth/mod.rs 0.00% <ø> (ø)
crates/sim/src/simulation/simulator.rs 82.37% <ø> (ø)
... and 76 more

... and 1 file with indirect coverage changes

Flag Coverage Δ
unit-tests 55.19% <51.24%> (-2.85%) ⬇️

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

Components Coverage Δ
rundler binary 0.00% <0.00%> (ø)
builder 50.60% <34.50%> (-1.58%) ⬇️
dev 0.00% <0.00%> (ø)
pool 64.87% <63.59%> (+0.39%) ⬆️
provider 14.77% <18.70%> (+14.35%) ⬆️
rpc 25.46% <28.51%> (-8.89%) ⬇️
sim 77.53% <85.55%> (-9.02%) ⬇️
tasks ∅ <ø> (∅)
types 65.88% <ø> (-21.46%) ⬇️
utils 18.28% <ø> (+1.55%) ⬆️

Copy link
Collaborator

@0xfourzerofour 0xfourzerofour left a comment

Choose a reason for hiding this comment

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

Send it

@dancoombs dancoombs merged commit f2f3dd8 into main Apr 19, 2024
8 checks passed
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.

3 participants