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: Add gas estimation utilities #6267

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Conversation

roninjin10
Copy link
Contributor

@roninjin10 roninjin10 commented Jul 12, 2023

  • Add simple gas estimation tools such as the ability to estimate l1 gas with a minimal api
  • This replaces l2Provider.ts version which was tightly coupled to ethers.js. This one you don't even realize you are using viem as the API is minimal
  • Don't document this as it's a one off tool and the plan is to make normal tools "just work"
    • we should document it in a guide/tutorial instead after this lands

@changeset-bot
Copy link

changeset-bot bot commented Jul 12, 2023

⚠️ No Changeset found

Latest commit: 5a817f1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@roninjin10
Copy link
Contributor Author

roninjin10 commented Jul 12, 2023

@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from f4a25b6 to e2d3fb0 Compare July 12, 2023 08:02
@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from e2d3fb0 to f0af6c9 Compare July 12, 2023 08:03
@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from f0af6c9 to 6431ffb Compare July 12, 2023 08:09
@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from 6431ffb to 5fb79b4 Compare July 12, 2023 08:12
@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from 5fb79b4 to e2c0d73 Compare July 12, 2023 08:14
@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from e2c0d73 to 6175b77 Compare July 12, 2023 08:16
@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from 6175b77 to 3912f3a Compare July 12, 2023 08:28
@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from 3912f3a to 26d73c3 Compare July 12, 2023 08:28
@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Merging #6267 (3753b5c) into 07-11-feat_Add_ts_contract_package_for_TS (8087e2b) will decrease coverage by 1.09%.
The diff coverage is n/a.

❗ Current head 3753b5c differs from pull request most recent head c4bb3a3. Consider uploading reports for the commit c4bb3a3 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@                              Coverage Diff                              @@
##           07-11-feat_Add_ts_contract_package_for_TS    #6267      +/-   ##
=============================================================================
- Coverage                                      44.53%   43.44%   -1.09%     
=============================================================================
  Files                                            437      306     -131     
  Lines                                          29081    24315    -4766     
  Branches                                         712        0     -712     
=============================================================================
- Hits                                           12950    10564    -2386     
+ Misses                                         15062    12754    -2308     
+ Partials                                        1069      997      -72     
Flag Coverage Δ
bedrock-go-tests 43.44% <ø> (+0.01%) ⬆️
cannon-go-tests ?
common-ts-tests ?
contracts-bedrock-tests ?
core-utils-tests ?
fault-detector-tests ?
sdk-next-tests ?
sdk-tests ?

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

see 134 files with indirect coverage changes

@mergify
Copy link
Contributor

mergify bot commented Jul 12, 2023

Hey @roninjin10! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the conflict label Jul 12, 2023
@roninjin10 roninjin10 force-pushed the 07-11-feat_Add_ts_contract_package_for_TS branch from 26d73c3 to f0474d4 Compare July 12, 2023 11:36
@mergify mergify bot removed the conflict label Jul 12, 2023
Copy link
Contributor

@tynes tynes left a comment

Choose a reason for hiding this comment

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

These utilities should go in core utils

@roninjin10 roninjin10 requested a review from jxom July 20, 2023 05:44
Copy link
Member

@nickbalestra nickbalestra left a comment

Choose a reason for hiding this comment

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

LGTM!

packages/fee-estimation/LICENSE Show resolved Hide resolved
@roninjin10 roninjin10 force-pushed the willc/gas-estimation branch 2 times, most recently from 98276c8 to 15a532c Compare July 20, 2023 19:57
@roninjin10 roninjin10 requested review from a team as code owners July 20, 2023 19:57
@mergify mergify bot added A-indexer Area: indexer sdk labels Jul 20, 2023
@roninjin10
Copy link
Contributor Author

git in shambles

@mergify
Copy link
Contributor

mergify bot commented Jul 20, 2023

Hey @roninjin10! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the conflict label Jul 20, 2023
@mergify mergify bot removed the conflict label Jul 21, 2023
@roninjin10 roninjin10 force-pushed the willc/gas-estimation branch 4 times, most recently from c3d4e47 to 2c74b97 Compare July 21, 2023 23:17
feat: Add feeEstimation function and move to correct package

Apply suggestions from code review

Co-authored-by: Annie Ke <[email protected]>

fix: Remove the copy pasta from package.json

Update packages/fee-estimation/README.md

feat: Offer passing in viem client as an option

better api and tests

better docs

all the docs

fix: Make viem a peer dep

typo

fix: Refactor to use viem correctly (docs not updated yet)

moar tests more explicit implementations

Update packages/fee-estimation/src/estimateFees.ts

fix: lint

fix: Remove bad import and debugging fs.writeFile

chore: pnpm up --latest packages

feat: Add zora and base mainnet

fix: linter
@roninjin10
Copy link
Contributor Author

Moved ci check into it's own pr so the devops folks who might already be off for the weekend aren't blocking review #6407

@OptimismBot OptimismBot merged commit f4411c5 into develop Jul 21, 2023
@OptimismBot OptimismBot deleted the willc/gas-estimation branch July 21, 2023 23:42
@mergify
Copy link
Contributor

mergify bot commented Jul 21, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Contributor

mergify bot commented Jul 21, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-indexer Area: indexer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants