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 limit configuration #1009

Merged
merged 25 commits into from Sep 15, 2022
Merged

feat: add gas limit configuration #1009

merged 25 commits into from Sep 15, 2022

Conversation

ghost
Copy link

@ghost ghost commented Aug 23, 2022

What I did

fixes: #985

Added gas_limit as an available parameter for NetworkConfig (and subsequently NetworkAPI)

How to verify it

WIP

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@ghost
Copy link
Author

ghost commented Aug 23, 2022

Need to add project tests still which is a WIP, I know I'll at least be adding in functional tests that configure a project with a gas limit and then manually call estimate_gas_cost()... just not sure if there's an integration portion that needs to be accounted for as well

Copy link
Contributor

@antazoey antazoey left a comment

Choose a reason for hiding this comment

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

This looks great! I added some mostly small feedback

src/ape/api/networks.py Outdated Show resolved Hide resolved
src/ape/api/networks.py Outdated Show resolved Hide resolved
src/ape/api/providers.py Show resolved Hide resolved
src/ape/api/providers.py Show resolved Hide resolved
Copy link
Contributor

@sabotagebeats sabotagebeats left a comment

Choose a reason for hiding this comment

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

very cool, looking forward to testing this!

@ghost ghost marked this pull request as ready for review September 12, 2022 20:00
antazoey
antazoey previously approved these changes Sep 13, 2022
Copy link
Contributor

@antazoey antazoey 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!
I added some pretty small feedbacks.
Feel free to ping me again if you address any of it and neeed a re-approval

src/ape/api/networks.py Outdated Show resolved Hide resolved
src/ape/api/networks.py Outdated Show resolved Hide resolved
src/ape_test/providers.py Outdated Show resolved Hide resolved
eth_config = config.get_config("ethereum")

assert eth_config.rinkeby.gas_limit == "auto"
assert eth_config.local.gas_limit == "auto"
Copy link
Contributor

Choose a reason for hiding this comment

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

In 0.6 or any future release, we may want to consider making max the default for local.
I think it will give speed improvements to running test suites.

Copy link
Author

Choose a reason for hiding this comment

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

Good point, and what's funny is I thought previously I had local set to max but I can't seem to find trace of that now 🤔 it was before that pre-audit work so I think I lost a bit of track with the gear switching

I may need to revisit this for #957 but I'll see about including such changes in that PR if need be 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to make it use max now, that is probably fine. It should not affect anything really so maybe not a real breaking change

tests/functional/test_config.py Outdated Show resolved Hide resolved
tests/functional/test_provider.py Outdated Show resolved Hide resolved
@ghost ghost requested a review from antazoey September 14, 2022 19:21
docs/userguides/config.md Outdated Show resolved Hide resolved
src/ape_ethereum/ecosystem.py Outdated Show resolved Hide resolved
src/ape/api/networks.py Outdated Show resolved Hide resolved
docs/userguides/config.md Outdated Show resolved Hide resolved
tests/functional/test_config.py Outdated Show resolved Hide resolved
docs/userguides/config.md Show resolved Hide resolved
helloibis and others added 5 commits September 14, 2022 14:25
Co-authored-by: Juliya Smith <yingthi@live.com>
Co-authored-by: Juliya Smith <yingthi@live.com>
Co-authored-by: Juliya Smith <yingthi@live.com>
Co-authored-by: Juliya Smith <yingthi@live.com>
@ghost ghost requested a review from antazoey September 14, 2022 19:34
fubuloubu
fubuloubu previously approved these changes Sep 15, 2022
src/ape_ethereum/ecosystem.py Outdated Show resolved Hide resolved
@antazoey antazoey enabled auto-merge (squash) September 15, 2022 03:44
@antazoey antazoey merged commit ad3059e into ApeWorX:main Sep 15, 2022
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

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

missed one

src/ape_ethereum/ecosystem.py Show resolved Hide resolved
@ghost ghost deleted the feat/network-gas-limit-config branch September 15, 2022 14:52
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.

Configurable Gas Limit For Networks
3 participants