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

[Beyond EVM] Updateing StateDB createAccount behaviour to match Geth's latest version #5212

Merged
merged 5 commits into from
Jan 12, 2024

Conversation

ramtinms
Copy link
Contributor

@ramtinms ramtinms commented Jan 6, 2024

This PR updates the StateDB createAccount behaviour to match Geth's latest version:
When createAccount is called we check if an account exists,

  • if yes we need to flag the old account for destruction, clear the data, and transfer balance
  • yet the balance for destructed account has to be loaded from somewhere else that's why we check the account for destruction flag as well.

This is the current logic in the Geth code. Note that the EIP about selfDestruct explains the behaviour of the solidity code not necessarily the behaviour of the StateDB. for example a selfDestruction in the code might just check if account exist and call createAccount.

@ramtinms ramtinms changed the base branch from master to ramtin/5178-update-geth-version January 6, 2024 08:35
@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (b384458) 54.50% compared to head (d908c60) 56.10%.

Files Patch % Lines
fvm/evm/emulator/state/delta.go 50.00% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5212      +/-   ##
==========================================
+ Coverage   54.50%   56.10%   +1.59%     
==========================================
  Files         839      967     +128     
  Lines       80488    92899   +12411     
==========================================
+ Hits        43873    52120    +8247     
- Misses      33502    36858    +3356     
- Partials     3113     3921     +808     
Flag Coverage Δ
unittests 56.10% <50.00%> (+1.59%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ramtinms ramtinms changed the title [WIP] fix evm statedb create func [Beyond EVM] Updateing StateDB createAccount behaviour to match with Geth's latest version Jan 6, 2024
@ramtinms ramtinms changed the title [Beyond EVM] Updateing StateDB createAccount behaviour to match with Geth's latest version [Beyond EVM] Updateing StateDB createAccount behaviour to match Geth's latest version Jan 6, 2024
@ramtinms ramtinms marked this pull request as ready for review January 6, 2024 23:56
@ramtinms ramtinms requested a review from gregsantos January 6, 2024 23:56
@ramtinms ramtinms requested review from janezpodhostnik and sideninja and removed request for gregsantos January 8, 2024 22:23
Base automatically changed from ramtin/5178-update-geth-version to master January 8, 2024 23:35
@ramtinms ramtinms enabled auto-merge January 9, 2024 21:25
@ramtinms ramtinms added this pull request to the merge queue Jan 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 11, 2024
@ramtinms ramtinms added this pull request to the merge queue Jan 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 11, 2024
@ramtinms ramtinms added this pull request to the merge queue Jan 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 11, 2024
@ramtinms ramtinms added this pull request to the merge queue Jan 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 11, 2024
@ramtinms ramtinms added this pull request to the merge queue Jan 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 12, 2024
@ramtinms ramtinms added this pull request to the merge queue Jan 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 12, 2024
@ramtinms ramtinms added this pull request to the merge queue Jan 12, 2024
Merged via the queue into master with commit 7c2f987 Jan 12, 2024
51 checks passed
@ramtinms ramtinms deleted the ramtin/fix-evm-statedb-create-func branch January 12, 2024 02:10
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.

4 participants