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

feat(rpc): add state overrides to estimate gas, fix error msg #551

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

dancoombs
Copy link
Collaborator

@dancoombs dancoombs commented Jan 15, 2024

Closes #525
Closes #530

Proposed Changes

  • Add state overrides to eth_estimateUserOperationGas
  • Move revert bytes to revert_bytes in the data field of the eth_estimateUserOperationGas error response

TODO

  • Test state overrides using a USDC paymaster
  • Test revert bytes using a contract that returns a non-string error

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (4f2ffe8) 55.17% compared to head (d8874fc) 55.21%.

Additional details and impacted files

Impacted file tree graph

Files Coverage Δ
crates/provider/src/traits/provider.rs 33.33% <ø> (ø)
crates/rpc/src/eth/mod.rs 0.00% <ø> (ø)
crates/sim/src/estimation/types.rs 61.38% <ø> (ø)
crates/sim/src/simulation/simulation.rs 76.19% <100.00%> (ø)
bin/rundler/src/cli/mod.rs 0.00% <0.00%> (ø)
crates/rpc/src/eth/server.rs 0.00% <0.00%> (ø)
crates/sim/src/utils.rs 91.17% <90.00%> (+0.43%) ⬆️
crates/rpc/src/eth/error.rs 0.00% <0.00%> (ø)
crates/sim/src/estimation/estimation.rs 90.72% <93.47%> (-0.15%) ⬇️
crates/rpc/src/eth/api.rs 65.13% <10.00%> (-0.54%) ⬇️
... and 1 more
Flag Coverage Δ
unit-tests 55.21% <75.17%> (+0.03%) ⬆️

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.09% <ø> (ø)
dev 0.00% <ø> (ø)
pool 58.73% <ø> (ø)
provider 0.93% <0.00%> (-0.03%) ⬇️
rpc 38.23% <6.66%> (-0.27%) ⬇️
sim 83.26% <92.92%> (+0.06%) ⬆️
tasks ∅ <ø> (∅)
types 91.51% <ø> (ø)
utils 15.12% <ø> (ø)

@dancoombs
Copy link
Collaborator Author

Tested revert bytes by calling https://github.com/eth-infinitism/account-abstraction/blob/187613b0172c3a21cf3496e12cdfa24af04fb510/contracts/core/EntryPoint.sol#L356 on the entry point, the revert error is correctly formatted.

body: '{"jsonrpc":"2.0","error":{"code":-32521,"message":"execution reverted","data":{"revertData":"0x6ca7b8060000000000000000000000007e7df6dc443993a2c6fb67edcfd41522a6ffc49a"}},"id":43}',

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, just a nit math comment

crates/sim/src/estimation/estimation.rs Outdated Show resolved Hide resolved
@dancoombs dancoombs force-pushed the danc/overrides branch 5 times, most recently from 3d50c55 to 73bd520 Compare January 22, 2024 18:40
@dancoombs dancoombs merged commit 15cbd85 into main Jan 22, 2024
6 checks passed
@dancoombs dancoombs deleted the danc/overrides branch January 22, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants