Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement EIP-7610 (non-empty storage create collision) and upgrade execution-tests #816

Merged
merged 2 commits into from May 8, 2024

Conversation

chfast
Copy link
Collaborator

@chfast chfast commented Feb 12, 2024

This implements EIP-7610: Revert creation in case of non-empty storage.
When a contract creation collides with an existing account it also reverts in case of the storage not being empty.

The ethereum/tests are upgraded to v13.3.

Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 98.28%. Comparing base (6483138) to head (9720138).

❗ Current head 9720138 differs from pull request most recent head f538f9e. Consider uploading reports for the commit f538f9e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #816      +/-   ##
==========================================
- Coverage   98.50%   98.28%   -0.23%     
==========================================
  Files         130      127       -3     
  Lines       15619    15574      -45     
==========================================
- Hits        15386    15307      -79     
- Misses        233      267      +34     
Flag Coverage Δ
ethereum-tests ?
ethereum-tests-silkpre ?
execution-spec-tests 19.06% <80.00%> (+0.01%) ⬆️
unittests 94.35% <80.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
test/state/host.cpp 95.65% <80.00%> (-2.53%) ⬇️

... and 22 files with indirect coverage changes

@chfast chfast force-pushed the state/eip_7610_create_collision branch 3 times, most recently from 6dd6bd6 to af793ec Compare May 6, 2024 10:26
@chfast chfast changed the title state: Implement EIP-7610 state: Implement EIP-7610 non-empty storage create collision May 6, 2024
@chfast chfast changed the base branch from master to state/create_refactor May 6, 2024 10:27
@chfast chfast marked this pull request as ready for review May 6, 2024 10:27
@chfast chfast requested review from gumb0 and winsvega May 6, 2024 10:28
@chfast chfast force-pushed the state/eip_7610_create_collision branch from 333d376 to 858f717 Compare May 6, 2024 11:00
@chfast chfast force-pushed the state/eip_7610_create_collision branch from 858f717 to de11a0e Compare May 6, 2024 11:10
@chfast chfast self-assigned this May 6, 2024
Base automatically changed from state/create_refactor to master May 6, 2024 14:44
@chfast chfast force-pushed the state/eip_7610_create_collision branch from de11a0e to 936bba3 Compare May 6, 2024 14:49
@chfast chfast changed the title state: Implement EIP-7610 non-empty storage create collision Implement EIP-7610 (non-empty storage create collision) and upgrade execution-tests May 6, 2024
@chfast chfast requested a review from pdobacz May 6, 2024 15:12
@@ -268,14 +275,6 @@ evmc::Result Host::create(const evmc_message& msg) noexcept

new_acc->just_created = true;

// Clear the new account storage, but keep the access status (from tx access list).
// This is only needed for tests and cannot happen in real networks.
for (auto& [k, v] : new_acc->storage) [[unlikely]]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the storage is empty now we don't have to do anything with it. This is really nice because this eliminates the only case for storage traversal in EVM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could replace with assertion, but not very important

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not easy check because of the access list... so I'll pass.

test/state/host.cpp Outdated Show resolved Hide resolved
test/state/host.cpp Outdated Show resolved Hide resolved
chfast added 2 commits May 8, 2024 09:42
This implements EIP-7610: Revert creation in case of non-empty storage.
When a contract creation collides with an existing account
it also reverts in case of the storage not being empty.

https://eips.ethereum.org/EIPS/eip-7610
Also disable EIP tests for EIP-2537 because this is not implemented.
@chfast chfast force-pushed the state/eip_7610_create_collision branch from 9720138 to f538f9e Compare May 8, 2024 07:42
@chfast chfast enabled auto-merge May 8, 2024 07:48
@chfast chfast merged commit 7e4397a into master May 8, 2024
21 of 22 checks passed
@chfast chfast deleted the state/eip_7610_create_collision branch May 8, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants