-
Notifications
You must be signed in to change notification settings - Fork 167
feat(tests): Add flag to configure max_gas
for fill command
#1470
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
Conversation
Add fixture for `max_gas` with default of 30_000_000
Are tests that use more than Should these values remain or should they be set to the Another question: There are gas limits used in the execution command. Are those to remain as is for now? |
Update fill command output in docs
f279050
to
739ed53
Compare
@marioevz I like the idea of setting the gas_limit as part of the I noticed there is a default value of Once it is in the environment, all tests will change and I'm not certain what effect lowering the value will have. Is this the right approach? |
I think the default of Doing the environment-as-a-fixture would require some big changes, like the ones we did for the pre-as-a-fixture. It might not even be necessary that the test function uses the parameter and we could simply pass it from the filler to the spec like we do for the execution-spec-tests/src/pytest_plugins/filler/filler.py Lines 717 to 718 in b48d1dc
If the test function requires to know about its environment, it will be included in the test function as a parameter:
And the test could then:
One change I would do to the current implementation of this PR is rename |
@marioevz Pushed up my latest changes and had some follow up questions for what we've discussed.
|
I normally see
I don't think this validation happens anywhere at the moment, it's simply set to a default max. As an example, we do a hacky trick to alter the defaults of a transaction by using a execution-spec-tests/src/ethereum_test_types/types.py Lines 578 to 585 in c35b42f
And then in the execution-spec-tests/src/pytest_plugins/execute/execute.py Lines 192 to 200 in c35b42f
Maybe this helps for environment too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks very good!
After going through the code, I'm more convinced about the separation between gas_limit
and block_gas_limit
.
I'll try the changes today locally and potentially merge if it goes well :)
@marioevz Is it worth removing the I also haven't updated the execute command with a default value. Is that necessary? |
I was just thinking about that, it's maybe way too many tests using this pattern. Maybe since it's simpler to just use the EnvironmentDefaults trick in this PR and focus on the ones that directly set
If we go ahead and skip using a fixture then nothing needs to be changed for execute, but if we end up using the fixture route then we need to define it also in the execute plugin. |
Just to summarize, the two options are:
|
I'm fine with using the |
@marioevz I'm not seeing the flag in the help section when I put in the correct description for the flag group With the |
cbac34c
to
bf70458
Compare
Have an idea on how to fix it: I think we should move the flag to the I'll push a commit in a bit 👍 |
@reedsa Added the changes and it seems to be working now. The nice thing is that with this change, since the default for Let me know what you think of the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on these updates! I think the only update I would make is to the help text and I'll go ahead and push up that change.
Any test that currently just uses the default environment could also stop using env = Environment()
to pass into state_test
but isn't necessarily hurting anything as is. Looks good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this!
I'll apply my comments and merge :)
…ethereum#1470) * Add flag to configure `max_gas` for fill command Add fixture for `max_gas` with default of 30_000_000 * Warnings for blockchain and state tests using gas_limit >= 30_000_000 * Set gas_limit from fixture for fill command * Update CHANGELOG Update fill command output in docs * Add env fixture to pytest fill plugin and pass Environment to state tests directly * Updates for using EnvironmentDefaults * refactor(plugins/shared): Move block gas limit flag to shared * refactor(tests): test fixes * fix(specs): Unit tests * fix(specs): More unit tests * fix(types): Change semantics of max block gas limit * refactor(plugins): Use different max gas defaults for execute/fill * revert(pytest.ini): Remove filler.env * fix(tests): Reduce amount of excessive-gas-usage tests * fix(types): Fix unit tests take 3 * fix(tests): Mark tests timing out as slow * Update docs for max gas flag * fix(plugins): Move environment defaults modification in pytest_config * fix tox * Apply suggestions from code review --------- Co-authored-by: Mario Vega <[email protected]>
🗒️ Description
Add flag to configure
max_gas
for fill command with default of of 30_000_000.Add fixture for
max_gas
to use ingas_limit
of a Transaction.🔗 Related Issues
#1434
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.