ethereum / trin

An Ethereum portal client: a json-rpc server with nearly instant sync, and low CPU & storage usage
382 stars 112 forks source link

Remove contract bytecode on reverts and account self-destruct #1428

Open KolbyML opened 2 months ago

KolbyML commented 2 months ago

https://github.com/ethereum/trin/pull/1337#discussion_r1747395280

Problem

Delete contract code if no accounts point to it

This can happen in 1 of 2 cases

Solution

The solution would require keeping a count of how many accounts point to a contract code and deleting the contract code if the count is 0. This is very low priority due to this issue being very rare and it not taking up much storage

After thoughts

I think this is super low priority almost non-existent, but there is value in documenting it so other's know to look at other things first if they are hunting for things to improve