feat(spec-specs, tests): charge EIP-8037 account creation at access - #3116
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3116 +/- ##
===================================================
+ Coverage 93.31% 93.37% +0.05%
===================================================
Files 624 624
Lines 36994 36990 -4
Branches 3384 3386 +2
===================================================
+ Hits 34521 34539 +18
+ Misses 1693 1677 -16
+ Partials 780 774 -6
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:
|
2a4a119 to
52b544e
Compare
52b544e to
bc2d714
Compare
bd3cc21 to
b5fa770
Compare
|
FYI the storage only collision is untestable, the fixture loader rejects empty with storage pre state accounts (StateWithEmptyAccount), hence the codecov patch miss on the refill lines. Please double check, these lines in the spec. Opcode-level refill ( execution-specs/src/ethereum/forks/amsterdam/vm/instructions/system.py Lines 122 to 123 in b5fa770 Transaction-level refill ( execution-specs/src/ethereum/forks/amsterdam/vm/interpreter.py Lines 146 to 149 in b5fa770 |
There was a problem hiding this comment.
This largely looks good to me. But I have a comment on how we should merge this in.
A lot of the changes to src/ethereum/forks/amsterdam/fork.py seem to be transitional scaffolding to bridge over the fact that the latest version of EIP-2780 isn't already in forks/amsterdam. EIP-2780 gets rid of the intrinsic state gas (see this)
The real meat of this PR lies in the system.py changes and some interpreter.py changes.
So, I would say, we should first get #3126 merged in, then rebase this PR and try to get that in next. @spencer-tb your thoughts?
|
Sgtm!! |
b5fa770 to
a3f0b0e
Compare
marioevz
left a comment
There was a problem hiding this comment.
LGTM on the tests side! I just left one comment, because I forgot to update CREATE/CREATE2 docstrings in the PR I submitted to your branch (sorry!)
gurukamath
left a comment
There was a problem hiding this comment.
The specs side looks good to me.
Description
Implements the EIP-8037 charge at access model for
CREATE/CREATE2and creation transactions from ethereum/EIPs#11858.Account creation state gas is now charged conditionally at the destination access, before the 63/64ths split, rather than charged unconditionally before the create frame and refilled. Failing a pre access check (balance, nonce, stack depth) reads no destination and charges nothing, an already alive target charges nothing, the charge is decided by existence alone, so a storage only collision is charged and refilled, and a failed create frame still refills.
Creation transactions follow the same rule: the create component of the intrinsic state gas is seeded into the reservoir rather than pre-consumed, charged at the deployment-address access only if the destination does not exist, and refilled on failure.
The storage only collision is untestable, the fixture loader rejects empty with storage pre state accounts (
StateWithEmptyAccount), hence the codecov patch miss on the refill lines.Related Issues or PRs
ethereum/EIPs#11858
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture