✨ feat(specs,tests): Implement EIP-7954#2276
✨ feat(specs,tests): Implement EIP-7954#2276fselmo merged 19 commits intoethereum:eips/amsterdam/eip-7954from
Conversation
tests/amsterdam/eip7954_increase_max_contract_size/test_max_initcode_size.py
Outdated
Show resolved
Hide resolved
tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py
Outdated
Show resolved
Hide resolved
28db343 to
596239c
Compare
|
The mainnet tests that verify EVM opcodes for new sizes need not deploy their own contract and pollute state. I think we should reuse one of the contract deployed in the same suite. |
95ff84c to
1ddd772
Compare
|
@raxhvl had to rebase here to get CI working. Added some minor tweaks as well but going to review more thoroughly now 👀 |
1ddd772 to
95ff84c
Compare
95ff84c to
be62700
Compare
be62700 to
fbb0c0f
Compare
|
note: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/amsterdam/eip-7954 #2276 +/- ##
===========================================================
- Coverage 85.85% 84.00% -1.85%
===========================================================
Files 599 642 +43
Lines 39428 42191 +2763
Branches 3776 4055 +279
===========================================================
+ Hits 33851 35444 +1593
- Misses 4946 6027 +1081
- Partials 631 720 +89
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:
|
|
@raxhvl I added a minor simplification refactor here. Tests look good to me but I will take one more pass at them tomorrow as I ran out of time today 😅 |
tests/amsterdam/eip7954_increase_max_contract_size/test_eip_mainnet.py
Outdated
Show resolved
Hide resolved
tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py
Outdated
Show resolved
Hide resolved
tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py
Outdated
Show resolved
Hide resolved
tests/amsterdam/eip7954_increase_max_contract_size/test_max_initcode_size.py
Outdated
Show resolved
Hide resolved
5c82a52 to
a23b9e1
Compare
I lied, I was able to get to it today! 😄 I added a test case for testing max code WITH max init code together. I'd love your thoughts on it. I also added some simplifications on what you already had and double checked gas, etc. Anything I wasn't sure we wanted I left as comments. Please feel free to push back on any of what I added, comment, etc... and also please lmk if you think the new test case is overkill across all 3 of I'm ready to approve here once you mark these resolved 👀. Nicely done and ty for this! 🚀 |
92b1d44 to
173c9da
Compare
|
@fselmo thanks for this thorough review. responded to all your points. re overkill: i hoped my initial implementation wouldn't be considered overkill for literally changing a single line in the specification. the new test is a valuable addition, but we could a second opinion on whether it's needed for the transition; the other two are definitely required. Lastly, for the mainnet opcode test, can we reuse the deployed contract instead of creating a new one? |
Co-authored-by: felipe <[email protected]>
Great thought. I used the |
|
The mainnet test file deploys 4 contract. I think for mainnet test lets only keep My question was can we get |
Yes! I like that. I extracted this to a fixture and used the deterministic deploy so we can reduce it to just this contract when possible, which can also be used in the non-mainnet file to DRY some of the same code over there 👌🏼 |
Done 👍🏼 |
- DRY max size contract for mainnet by including the superset in one and removing subset tests
8b4cef6 to
83d8240
Compare
93352e4
into
ethereum:eips/amsterdam/eip-7954
* ✨ feat: Tests for new contract size * ✨ feat: Gas metering of initcode * ✨ feat: Transition, Mainnet tests * 🧹 chore: Names * fix: use gas constant instead of hard-coded number * fix: remove references to old_max that are not in tests * fix: align with other forks; use 2*code_size for initcode size * chore: fix lint * refactor: simplify gas calculation with gas cost API; add post check * refactor: use opcode metadata for gas calc * feat(test): add max_code with max_init_code in same test * refactor: simplify calls to compute_create_address; no conditional necessary * 🧹 chore: Simplify docstring * 🧹 chore: Simplify opcode based testing * 🧹 chore: Better names * 🧹 chore: types * version Co-authored-by: felipe <[email protected]> * feat(test): use deterministic deploy for similar contracts * refactor: use same max-size self-checking contract for tests - DRY max size contract for mainnet by including the superset in one and removing subset tests --------- Co-authored-by: raxhvl <[email protected]> Co-authored-by: fselmo <[email protected]>
🗒️ Description
Adds specs and tests for EIP-7954, see test_casee.md for human readable test cases.
test_max_code_size.py:
test_max_initcode_size.py:
test_fork_transition.py:
test_eip_mainnet.py:
🔗 Related Issues or PRs
closes #2275
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.