feat(spec-tests): add basic eip7778 test#2045
Conversation
|
Link @marioevz 's comment from old PR. |
No worries @LouisTsai-Csie! Just to better understand, is this the status quo:
If that's the case, we should update this PR's target branch to |
|
Nerolation just merged #1401 into |
112a7dd to
73ab16d
Compare
gurukamath
left a comment
There was a problem hiding this comment.
This looks good to me! One suggestion would be to keep track of the implemented tests and further test ideas using a BAL style test tracking table. See here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-7778 #2045 +/- ##
===========================================================
- Coverage 86.33% 86.07% -0.27%
===========================================================
Files 538 599 +61
Lines 34557 39530 +4973
Branches 3222 3780 +558
===========================================================
+ Hits 29835 34024 +4189
- Misses 4148 4872 +724
- Partials 574 634 +60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
spencer-tb
left a comment
There was a problem hiding this comment.
Some small cosmetic changes. LGTM otherwise.
marioevz
left a comment
There was a problem hiding this comment.
Added many changes on top of your cases @LouisTsai-Csie
…est_gas_accounting.py
fselmo
left a comment
There was a problem hiding this comment.
I think really just the pytest-xdist issue jumped out at me.
Some other cases to think about for a subsequent PR:
- multiple txs with refunds in same block
- verifying each tx receipt's
gas_spentandgas_used - verify
cumulative_gas_usedacross transactions (I wonder if this is a good time to add validation for this inexpected_receipt)?
- verifying each tx receipt's
- combine refund types for the fork in a single tx
Ah did not mean to approve. Please fix pytest-xdist issue. Other than that, this is a great addition!
abca655
into
ethereum:eips/amsterdam/eip-7778
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-7778 #2045 +/- ##
===========================================================
- Coverage 86.33% 86.07% -0.27%
===========================================================
Files 538 599 +61
Lines 34557 39530 +4973
Branches 3222 3780 +558
===========================================================
+ Hits 29835 34024 +4189
- Misses 4148 4872 +724
- Partials 574 634 +60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ut refunds (#2840) * feat(spec-specs): Implement EIP-7778 Block Gas Accounting without Refunds (#1401) * feat(specs): add eip-7778 implementation * fix(specs) spliting receipt gas from block gas * revert receipt_gas_used * make sure that the calldata floor cost overwrites the tx gas before refund * receipt gas used after refunds * clarify variable naming @gurukamath * revert to using gas used after refunds for cumulative gas in receipt and add gasSpent to receipt * spec(amsterdam): fix code formatting --------- Co-authored-by: Guruprasad Kamath <guru241987@gmail.com> * fix(tests): fix legacy tests to run with eip-7778 (#2048) * fix(tests): fix legacy tests to run with eip-7778 * fix(tests): check gas_spent and gas_used after Amsterdam * feat(spec-tests): add basic eip7778 test (#2045) * feat(spec-tests): add eip-7778 tests for calldata checks (#2060) * feat(spec-tests): add eip-7778 for calldata checks * feat(spec-tests): post review - use code gas_cost function Co-authored-by: Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com> * Apply suggestions from code review --------- Co-authored-by: Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com> Co-authored-by: Mario Vega <marioevz@gmail.com> * fix(tests): Fix gas used/spent in EIP-7702 tests (#2068) * feat(spec-specs): use post refund gas in receipts in EIP-7778 (#2073) * fix(test): Update refspec for EIP-7778 to match latest revision (#2093) * feat(test-forks): Add EIP-7778 * refactor(tests): Condition EIP-7778 tests to EIP inclusion * fix(test): use deterministic iteration order for refund types The set iteration in `build_refund_tx` is non-deterministic due to Python's hash randomization, causing fixture output to vary between runs. Sort by enum value to ensure reproducible fixtures. * doc: remove changelog md * fix: broken auth tx benchmark * doc: add eip checklist * fix: typo * Update tests/benchmark/compute/scenario/test_transaction_types.py * Apply suggestions from code review Co-authored-by: Mario Vega <marioevz@gmail.com> --------- Co-authored-by: Toni Wahrstätter <51536394+nerolation@users.noreply.github.com> Co-authored-by: Guruprasad Kamath <guru241987@gmail.com> Co-authored-by: Guruprasad Kamath <48196632+gurukamath@users.noreply.github.com> Co-authored-by: Mario Vega <marioevz@gmail.com> Co-authored-by: felipe <fselmo2@gmail.com> Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
🗒️ Description
Due to an incorrect git operation, PR #2026 was closed. I’ve recreated the PR with the same content and updated the related links to point to this new PR.
Implement eip-7778 test cases.
test_simple_gas_accounting: User should receive the refund, block accounting should exclude refund.test_multi_block_gas_accounting: Block accounting should exclude refund, and the transaction receipt should reflect the cumulative gas usage.🔗 Related Issues or PRs
Require PR #1401
Tracker:
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.Cute Animal Picture