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

fix(sim): handle v0.7 executeUserOp special call in call gas estimation #715

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

dancoombs
Copy link
Collaborator

Proposed Changes

  • Handle the special call for executeUserOp during gas estimation.
  • This required modifications to the call gas proxy that are v0.7 specific.
  • Update the call gas specializations code to handle multiple proxy implementations.

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 84.55285% with 19 lines in your changes missing coverage. Please review.

Project coverage is 55.20%. Comparing base (07f6699) to head (c275a63).

Additional details and impacted files

Impacted file tree graph

Files Coverage Δ
crates/sim/src/estimation/estimate_call_gas.rs 96.12% <100.00%> (-0.87%) ⬇️
crates/sim/src/estimation/v0_6.rs 94.63% <100.00%> (+0.23%) ⬆️
crates/sim/src/estimation/v0_7.rs 80.42% <64.81%> (-1.59%) ⬇️

... and 2 files with indirect coverage changes

Flag Coverage Δ
unit-tests 55.20% <84.55%> (+<0.01%) ⬆️

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

Components Coverage Δ
rundler binary 0.00% <ø> (ø)
builder 50.00% <ø> (ø)
dev 0.00% <ø> (ø)
pool 64.37% <ø> (ø)
provider 16.68% <ø> (ø)
rpc 25.67% <ø> (ø)
sim 77.86% <84.55%> (-0.08%) ⬇️
tasks ∅ <ø> (∅)
types 65.45% <ø> (-0.51%) ⬇️
utils 18.28% <ø> (ø)

@dancoombs dancoombs force-pushed the danc/fix-v07-estimation-w-hash branch from 41f14f2 to f288be5 Compare June 4, 2024 02:39
Comment on lines +165 to +170
bytes memory executeCall;
if (methodSig == IAccountExecute.executeUserOp.selector) {
executeCall = abi.encodeCall(IAccountExecute.executeUserOp, (userOp, userOpHash));
} else {
executeCall = callData;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New code that caused this whole debacle.

@@ -0,0 +1,198 @@
// SPDX-License-Identifier: UNLICENSED
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is likely an opportunity to DRY this up as its mostly copied from the old proxy with minimal modifications.

Not sure its worth it given that we rarely modify this. I'm going to leave it as is for now.

@dancoombs dancoombs force-pushed the danc/fix-v07-estimation-w-hash branch from f288be5 to c275a63 Compare June 4, 2024 03:02
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.

Looks good apart from a nit

///
/// The easiest way to get the updated value is to run this module's tests. The
/// failure will tell you the new value.
const PROXY_TARGET_OFFSET: usize = 163;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This same value is used for both 0.6 and 0.7 we might want to consolidate

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I actually explicitly split these to being distinct. Changes to the contracts can change these values, so its possible the two have a different value. Its just a coincidence that they are the same right now (likely due to the minimal differences).

@dancoombs dancoombs merged commit 7990f85 into main Jun 4, 2024
7 checks passed
@dancoombs dancoombs deleted the danc/fix-v07-estimation-w-hash branch June 4, 2024 19:28
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.

2 participants