feat: E2E gas profiling native and erc20#123
Conversation
✅ Heimdall Review Status
|
| @@ -0,0 +1,111 @@ | |||
| // SPDX-License-Identifier: MIT | |||
| pragma solidity ^0.8.4; | |||
There was a problem hiding this comment.
make at parity with codebase so ^0.8.23
| import {UserOperation} from "account-abstraction/interfaces/UserOperation.sol"; | ||
| import {console2} from "forge-std/Test.sol"; | ||
|
|
||
| /// forge-config: default.isolate = true |
| } | ||
|
|
||
| // Native ETH transfer comparison between ERC-4337 and EOA | ||
| function test_transfer_native() public { |
There was a problem hiding this comment.
would benefit from comments to annotate the code sections here for easier skimming
| "rev": "cf2b89c33fed536c4dd6fef2fb84f39053068868" | ||
| }, | ||
| "lib/solady": { | ||
| "rev": "c4c96607cb3aa3807b14c81ae2015bcba061f8fc" |
There was a problem hiding this comment.
if this is a commit, we actually want this to be 5ea5d9f57ed6d24a27d00934f4a3448def931415
There was a problem hiding this comment.
@amiecorso did we update .gas-snapshot when pushing v1.1? Feels weird for the diff to be so big unless its fuzzing variance?
There was a problem hiding this comment.
we did actually... See the file on the v1.1 commit here
There was a problem hiding this comment.
differences could have to do with how things are compiled before snapshotting though... since control of that stuff is a mess
|
Review Error for ilikesymmetry @ 2025-09-10 00:06:54 UTC |
| } | ||
|
|
||
| // ERC20 transfer comparison between ERC-4337 and EOA | ||
| function test_transfer_erc20() public { |
There was a problem hiding this comment.
in the https://github.com/coinbase/solidity-style-guide there's a preference for tests only testing one thing. not necessarily a blocker here especially since these are just benchmarks, but if I were to write this I would split it out into the 4 explicit cases of native/erc20, scw/eoa for better org and readability.
| return ops; | ||
| } | ||
|
|
||
| function _sign(UserOperation memory userOp) internal view override returns (bytes memory signature) { |
There was a problem hiding this comment.
this should already be available on the SmartWalletTestBase parent contract so I don't think we need to re-write here?
|
Review Error for amiecorso @ 2025-09-10 00:24:00 UTC |
Gas profiling done for native and erc20 transfers. Results in snapshot folder.
https://docs.google.com/document/d/1G-ReRP_SQ4SvbHSjytj_ubdRwXTTMTdlwPAYSyr7LF4/edit?tab=t.0