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

Add options for measuring eth_call gas usage #191

Merged
merged 5 commits into from
Mar 2, 2024
Merged

Conversation

cgewecke
Copy link
Owner

@cgewecke cgewecke commented Mar 2, 2024

#170

Options

  • reportPureAndViewMethods: tracks eth_calls via estimate_gas
  • includeIntrinsicGas: opt out of paying intrinsic gas on all txs
  • excludeAutoGeneratedGetters: filters StateVariable getters from eth_call tracking

Misc:

  • Makes custom proxy resolvers a class that must implement resolve and ignore methods. They need to declare any eth_calls they will make otherwise reporter goes into infinite loop when call reporting is enabled.
  • Refactors provider.ts
  • Refactors gasData.ts

TODO

  • Filter state variable getters

@cgewecke cgewecke changed the title [WIP] Support gas usage measurement for eth_call Add options for measuring eth_call gas usage Mar 2, 2024
@cgewecke
Copy link
Owner Author

cgewecke commented Mar 2, 2024

Markdown

Methods

Symbol Meaning
Execution gas for this method does not include intrinsic gas overhead
Cost was non-zero but below the precision setting for the currency display (see options)
Min Max L2 Avg (Exec) L1 Avg (Data) Calls chf avg
VariableCosts
       addToMap 45,059 135,939 101,859 2,742 4 0.47993
     callEmptyFn - - 211 - 1 0.00006
     callPureFnReturn - - 713 - 1 0.00021
     callViewFn - - 2,887 - 1 0.00087
       methodThatThrows - - 43,727 2,064 1 0.35130
       otherContractMethod - - 49,939 1,916 1 0.32895
       removeFromMap 25,047 36,231 29,241 2,598 4 0.43468
       sendPayment - - 33,312 2,456 1 0.41241
       transferPayment - - 33,302 2,456 1 0.41241
Wallet
     getBalance - - 317 - 1 0.00009

Deployments

Min Max L2 Avg (Exec) L1 Avg (Data) Block % chf avg
VariableCosts - - 781,011 51,201 2.6 % 8.62796
Wallet - - 213,658 13,421 0.7 % 2.26407

Solidity and Network Config

Settings Value
Solidity: version 0.8.24
Solidity: optimized false
Solidity: runs 200
Solidity: viaIR false
Block Limit 30,000,000
L1 Base Fee 79 gwei
L2 Gas Price 0.09878 gwei
Token Price 3033.95 chf/eth
Network optimism

@cgewecke
Copy link
Owner Author

cgewecke commented Mar 2, 2024

Terminal

Screen Shot 2024-03-02 at 11 52 59 AM

@cgewecke cgewecke merged commit 1785638 into beta Mar 2, 2024
1 check passed
@cgewecke cgewecke deleted the scripts-table branch March 2, 2024 20:12
@cgewecke cgewecke mentioned this pull request Mar 2, 2024
54 tasks
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.

1 participant