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

Provide methods to handle SELFDESTRUCT #117

Closed
Scooletz opened this issue Aug 3, 2023 · 2 comments · Fixed by #178
Closed

Provide methods to handle SELFDESTRUCT #117

Scooletz opened this issue Aug 3, 2023 · 2 comments · Fixed by #178
Labels
ethereum An Ethereum specific work item that requires a good understanding of Eth

Comments

@Scooletz
Copy link
Contributor

Scooletz commented Aug 3, 2023

The SELFDESTRUCT code requires an ability to destroy any account with its underlying storage tree in one call like:

IWorldState.Destroy(anAccountToBeDestroyed)

This should be implemented in a way that is aligned with the write-trough behavior of Paprika's tree in PageDb so that the information if flushed down not necessarily immediately which could result in a lot of writes. If a page contains only storage information for the given account, it could be easily batch.RegisterForFutureReuse() so maybe it's possible to do a deep walk through the tree from the given level and find all the matches and write just the top page.

@Scooletz Scooletz added the ethereum An Ethereum specific work item that requires a good understanding of Eth label Aug 3, 2023
@Scooletz
Copy link
Contributor Author

Scooletz commented Aug 3, 2023

This could be done in a marker fashion, that either sets a special key (then it requires querying) or writes a special account value.

@Scooletz
Copy link
Contributor Author

Scooletz commented Aug 3, 2023

Or just check and iterate. For accounts with small storages, it will be several deletes. With accounts with Massive Storage Trees, it can be just removal of the MST + special operation for the Merkle.

@Scooletz Scooletz linked a pull request Oct 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ethereum An Ethereum specific work item that requires a good understanding of Eth
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant