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

Remove unnecessary early exit in EVM::call #632

Merged
merged 1 commit into from
Apr 15, 2022
Merged

Conversation

yperbasis
Copy link
Member

@yperbasis yperbasis commented Apr 13, 2022

Because after EIP-161 it's impossible within EVM to differentiate between empty and non-existent accounts, the early exit in EVM::call is unnecessary. Its purpose was to cater for this rule of EIP-161: "No account may change state from non-existent to existent-but-empty. If an operation would do this, the account SHALL instead remain non-existent."

Without the early exit some empty accounts might be created, but then they will be deleted at transaction's end as empty touched accounts.

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #632 (3ec3fe4) into master (d52bc6c) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #632      +/-   ##
==========================================
- Coverage   82.18%   82.12%   -0.07%     
==========================================
  Files         173      173              
  Lines       14433    14425       -8     
==========================================
- Hits        11862    11846      -16     
- Misses       2571     2579       +8     
Impacted Files Coverage Δ
core/silkworm/execution/evm.cpp 95.27% <100.00%> (-0.89%) ⬇️
core/silkworm/consensus/base/engine.cpp 93.03% <0.00%> (-1.00%) ⬇️
core/silkworm/state/in_memory_state.cpp 94.14% <0.00%> (-0.98%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d52bc6c...3ec3fe4. Read the comment docs.

@chfast
Copy link
Member

chfast commented Apr 14, 2022

Without the early exit some empty accounts might be created, but then they will be deleted at transaction's end as empty touched accounts.

I understand this depends on newly created accounts being marked as "touched".

@yperbasis
Copy link
Member Author

I understand this depends on newly created accounts being marked as "touched".

Yes, that's right.

@yperbasis yperbasis merged commit d57404a into master Apr 15, 2022
@yperbasis yperbasis deleted the no_early_exit branch April 15, 2022 15:14
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.

3 participants