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

Clear self-destructed account state at the end of tx #1513

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

codchen
Copy link
Collaborator

@codchen codchen commented Apr 5, 2024

Describe your changes and provide context

Geth's behavior of SelfDestruct is to only clear account balance when SelfDestruct is called but clear other account states at the end of the transaction. This PR aligns sei's behavior to that of Geth's

Testing performed to validate your change

unit test

Comment on lines +112 to +117
for acc, status := range st.transientAccounts {
if !bytes.Equal(status, AccountDeleted) {
return
}
s.clearAccountState(common.HexToAddress(acc))
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.24%. Comparing base (cc2d088) to head (b2b6de3).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            seiv2    #1513      +/-   ##
==========================================
- Coverage   60.50%   60.24%   -0.27%     
==========================================
  Files         363      363              
  Lines       25766    25771       +5     
==========================================
- Hits        15590    15526      -64     
- Misses       9196     9270      +74     
+ Partials      980      975       -5     
Files Coverage Δ
x/evm/state/state.go 95.04% <100.00%> (+0.12%) ⬆️
x/evm/state/statedb.go 47.67% <100.00%> (+1.24%) ⬆️

... and 1 file with indirect coverage changes

@codchen codchen merged commit 424c8d9 into seiv2 Apr 7, 2024
44 checks passed
@codchen codchen deleted the defer-selfdestruct branch April 7, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants