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 support for Optimism gas costs (bedrock & ecotone) #180

Merged
merged 10 commits into from
Feb 26, 2024
Merged

Conversation

cgewecke
Copy link
Owner

@cgewecke cgewecke commented Feb 24, 2024

  • Adds logic to synthesize optimism gas costs locally
  • Adds stubs for Arbitrum gas costs (impl in separate PR)
  • Misc table appearance imp.
  • Moves viem to dependencies for tx serialization
  • Upgrades viem
  • Change ts comp target to ES2021 (same as Hardhat)
  • Remove unused truffle5 dep

Checked output vs some tx on Etherscan - variance is < 1%

Call type PR L1 Etherscan L1 % Total Tx Cost Diff
small fn 2324 2340 0.72%
large fn 21144 21176 0.15%
deployment 47948 47980 0.06%

NOTE: There's a weird thing with the hardhat projects template where testFiles paths resolve incorrectly on linux. This doesn't happen on MacOS though... e.g

/home/circleci/project/test/projects/options/test/variableCosts.ts

TODO

@cgewecke
Copy link
Owner Author

cgewecke commented Feb 25, 2024

Methods

Min Max L2 Avg (Exec) L1 Avg (Data) Calls chf avg
VariableCosts
       addToMap 45,059 135,939 101,859 2,739 4 0.24
       methodThatThrows - - 43,727 2,064 1 0.18
       otherContractMethod - - 49,939 1,932 1 0.17
       removeFromMap 25,069 36,253 29,263 2,598 4 0.23
       sendPayment - - 33,312 2,456 1 0.22
       transferPayment - - 33,302 2,456 1 0.22
Wallet
       sendPayment - - 33,268 2,456 1 0.22
       transferPayment - - 33,257 2,456 1 0.22

Deployments

Min Max L2 Avg (Exec) L1 Avg (Data) Block % chf avg
VariableCosts - - 753,821 49,848 2.5 % 4.41
Wallet - - 213,658 13,420 0.7 % 1.19

Solidity and Network Config

Option Settings
Solidity: version 0.8.24
Solidity: optimized false
Solidity: runs 200
Solidity: viaIR false
Block Limit 30,000,000
L1 Base Fee 46 gwei
L2 Gas Price 0.00332 gwei
Token Price 2806.78 chf/eth
Network optimism

@cgewecke
Copy link
Owner Author

cgewecke commented Feb 25, 2024

Screen Shot 2024-02-26 at 1 49 09 PM

src/lib/render/terminal.ts Outdated Show resolved Hide resolved
@cgewecke cgewecke changed the title [WIP] Add support for Optimism gas costs (bedrock & ecotone) Add support for Optimism gas costs (bedrock & ecotone) Feb 26, 2024
@cgewecke cgewecke merged commit b08193c into beta Feb 26, 2024
1 check passed
@cgewecke cgewecke deleted the optimism-support branch February 26, 2024 22:39
@cgewecke cgewecke mentioned this pull request Feb 26, 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