refactor(tests): generalize system-contract request test helpers (EIP-6110/7002/7251/7685)#2989
Open
marioevz wants to merge 7 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2989 +/- ##
===================================================
- Coverage 90.52% 81.28% -9.24%
===================================================
Files 535 620 +85
Lines 32895 36641 +3746
Branches 3022 3311 +289
===================================================
+ Hits 29778 29784 +6
- Misses 2595 6335 +3740
Partials 522 522
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
spencer-tb
added a commit
that referenced
this pull request
Jun 18, 2026
…-6110/7002/7251/7685) (#2989)
28 tasks
7 tasks
LouisTsai-Csie
approved these changes
Jun 23, 2026
Comment on lines
+58
to
+60
| def test_none_defaults_to_21000(self) -> None: | ||
| """`gas_limit=None` defaults the field to the 21,000 base cost.""" | ||
| assert Transaction(gas_limit=None).gas_limit == 21_000 |
Contributor
There was a problem hiding this comment.
Is it possible we do not hardcode 21_000 here?
Comment on lines
+52
to
+53
| # Value obtained from trace minus one | ||
| gas_limits=[114_247 - 1, None], |
Contributor
There was a problem hiding this comment.
Could we add an issue and try to remove the hardcode value in follow-up PRs?
Comment on lines
+116
to
+123
| while True: | ||
| if cls.get_fee(i) > last_fee: | ||
| excess_request_counts.append(i) | ||
| last_fee = cls.get_fee(i) | ||
| if len(excess_request_counts) == n: | ||
| break | ||
| i += 1 | ||
| return excess_request_counts |
Contributor
There was a problem hiding this comment.
Suggested change
| while True: | |
| if cls.get_fee(i) > last_fee: | |
| excess_request_counts.append(i) | |
| last_fee = cls.get_fee(i) | |
| if len(excess_request_counts) == n: | |
| break | |
| i += 1 | |
| return excess_request_counts | |
| while len(excess_request_counts) < n: | |
| fee = cls.get_fee(i) | |
| if fee > last_fee: | |
| excess_request_counts.append(i) | |
| last_fee = fee | |
| i += 1 | |
| return excess_request_counts |
17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
Refactors the shared infrastructure behind the execution-layer request tests (deposits, withdrawals, consolidations, and the EIP-7685 multi-type tests) so all request types share one implementation and a new request type can be added with minimal changes.
SystemContractRequest/FeeSystemContractRequest(thefake_exponentialfee dynamic) andSystemContractInteraction{Base,Transaction,Contract}. Each EIP now keeps only its own request descriptor.tests/common/system_contract_request_fixtures.py) that compute per-block inclusion independently per request type (fee/excess/cap for withdrawals & consolidations; always-included for fee-less deposits).*_out_of_gas.pyfiles.REQUEST_TYPESlist (fork-aware viamax_request_type()).This PR should make it much easier to implement tests for EIP-8282.
🔗 Related Issues or PRs
N/A.
✅ Checklist
just 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