feat(spec, spec-specs): EIP-7997#2802
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2802 +/- ##
===================================================
- Coverage 88.17% 85.48% -2.69%
===================================================
Files 577 630 +53
Lines 35659 39383 +3724
Branches 3490 3909 +419
===================================================
+ Hits 31442 33668 +2226
- Misses 3654 5055 +1401
- Partials 563 660 +97
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:
|
4eb98bd to
2daf7a9
Compare
|
Deploying a system contract in the precompile range has the potential to cause weird bugs in clients that have longstanding hardcoded assumptions that the 0x01-0xff range is only precompiles. This isn't a precompile, it's just a regular contract. The level of testing required is higher than might superficially appear from the EIP. The included tests look pretty good, but I could think of few more:
|
|
Thanks @petertdavies! I will add those! It is very strange that this is in the precompile range, but is not a precompile. |
marioevz
left a comment
There was a problem hiding this comment.
Looks great so far, a few comments. Thanks!
| ref:ethereum.forks.amsterdam.fork.DETERMINISTIC_FACTORY_ADDRESS | ||
|
|
||
| """ | ||
| code_hash = store_code(old.state, DETERMINISTIC_FACTORY_CODE) |
There was a problem hiding this comment.
Interesting, I did not know we had this functionality!
I'm not sure though how do we signal from the tests that a block is the first block in the fork?
There was a problem hiding this comment.
@marioevz I'm not sure what you mean by:
I'm not sure though how do we signal from the tests that a block is the first block in the fork?
Can you clarify? AFAIK, the tests don't call apply_fork, and AIUI, we'd have to test with a pre_alloc mutable as discussed below, for inherently not a great test. This is also highlighted in the codecov report since there is not a great way to test this method. Let me know if you see another way though! I'm happy to update.
| REFERENCE_SPEC_GIT_PATH = ref_spec_7997.git_path | ||
| REFERENCE_SPEC_VERSION = ref_spec_7997.version | ||
|
|
||
| pytestmark = pytest.mark.valid_from("Amsterdam") |
There was a problem hiding this comment.
| pytestmark = pytest.mark.valid_from("Amsterdam") | |
| pytestmark = pytest.mark.valid_from("EIP7997") |
There was a problem hiding this comment.
We should test the transition to the fork where this EIP is enabled, but that circles back to my question on the first comment since I'm not really sure how we signal this in the t8n. Maybe @gurukamath has more insight.
There was a problem hiding this comment.
I think that the best we can do is do a pre_alloc_mutable and do something like: pre[0x12] - Account(code=b"", nonce=0, balance=0, and assert that you can call the contract, and it returns success for the call, but it doesn't return anything else. It looks like we do a similar thing here. I'm not sure how much value that test really adds though.
…warming, CALLCODE, and giving it a balance via SELFDESTRUCT
|
@marioevz @petertdavies @LouisTsai-Csie - this is ready for another look when you get a chance. I added the tests @petertdavies suggested. I'm not sure how to raise the question of whether this contract should be prewarmed - is that something that we'd generally put into the tests and see which clients fail or is it something we'd bring up in a sync call or comment on the EIP? Edit to add: I don't think there is a way around the |
🗒️ Description
EIP-7997 implementation and tests
🔗 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.[ ] Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.[ ] Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned@ported_frommarker.Cute Animal Picture