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

incomplete EIP161 implementation, account's contract code and storage trie are not removed #440

Open
jangko opened this issue Dec 20, 2019 · 1 comment
Labels
bug Something isn't working EL

Comments

@jangko
Copy link
Contributor

jangko commented Dec 20, 2019

according to EIP161, empty accounts shall be removed after transaction execution.

current implementation: empty accounts are removed, but the contract code and storage trie are not removed.

but removing those contract code and storage trie is tricky. two or more accounts might be share the same contract code or share the same storage trie.

related issue: status-im/nim-eth#9.

@jangko jangko added the bug Something isn't working label Aug 6, 2023
@mjfh
Copy link
Contributor

mjfh commented Apr 24, 2024

Regarding contract code:

  • The access key could be prefixed by the account address which would help to manage deleting an account + related data.

    But this only solves half of the problem as it leaves the database with an inconsistent state. The problem occurs if an account is reverted when the MPT ledger database is rolled back to an earlier state. Then the account exists but the contract code data have gone for good.

    So the contract code should be part of the ledger which kicks the can down the road. For a single state MPT ledger DB this would then be managed with the state.

Regarding storage data:

  • Is solved with the single state database(s) currently tested or researched on.

@jangko jangko added the EL label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working EL
Projects
None yet
Development

No branches or pull requests

2 participants