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

Fix selfdestruct empty vs. exists bug #878

Merged
merged 3 commits into from
Oct 17, 2024
Merged

Conversation

simonlechner
Copy link
Contributor

The ethereum tests pointed out another problem regarding selfdestruct, the dynamic gas computation should not rely on whether the account exists but if its balance = 0, code = nil and nonce = 0.

@LuisPH3
Copy link
Contributor

LuisPH3 commented Oct 16, 2024

The ethereum tests pointed out another problem regarding selfdestruct, the dynamic gas computation should not rely on whether the account exists but if its balance = 0, code = nil and nonce = 0.

Can you reference some literature about this issue? Is this experimental or is it there a documented description about this behavior?

LuisPH3
LuisPH3 previously approved these changes Oct 16, 2024
go/interpreter/lfvm/instructions_test.go Outdated Show resolved Hide resolved
go/interpreter/lfvm/instructions_test.go Outdated Show resolved Hide resolved
go/interpreter/lfvm/instructions_test.go Outdated Show resolved Hide resolved
go/interpreter/lfvm/instructions_test.go Outdated Show resolved Hide resolved
go/interpreter/lfvm/instructions_test.go Outdated Show resolved Hide resolved
go/interpreter/lfvm/instructions.go Outdated Show resolved Hide resolved
go/interpreter/lfvm/instructions.go Outdated Show resolved Hide resolved
HerbertJordan
HerbertJordan previously approved these changes Oct 16, 2024
go/interpreter/lfvm/instructions.go Outdated Show resolved Hide resolved
go/interpreter/lfvm/instructions.go Outdated Show resolved Hide resolved
go/interpreter/lfvm/instructions_test.go Outdated Show resolved Hide resolved
@simonlechner
Copy link
Contributor Author

The ethereum tests pointed out another problem regarding selfdestruct, the dynamic gas computation should not rely on whether the account exists but if its balance = 0, code = nil and nonce = 0.

Can you reference some literature about this issue? Is this experimental or is it there a documented description about this behavior?

Here is the documentation inside the geth code and the related eip 161

Copy link
Contributor

@LuisPH3 LuisPH3 left a comment

Choose a reason for hiding this comment

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

Thanks for test refactor. 👍

@simonlechner simonlechner merged commit f898b6b into main Oct 17, 2024
5 checks passed
LuisPH3 added a commit that referenced this pull request Oct 18, 2024
LuisPH3 added a commit that referenced this pull request Oct 18, 2024
LuisPH3 added a commit that referenced this pull request Oct 18, 2024
@simonlechner simonlechner deleted the simon/selfdestruct-empty branch October 29, 2024 08:21
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