Remove contract bytecode on reverts and account self-destruct
KolbyML opened this issue · comments
Kolby Moroz Liebl commented
Problem
Delete contract code if no accounts point to it
This can happen in 1 of 2 cases
- the account is deleted and the contract code is not used by any other accounts
- we do a revert and the contract code is not used by any other accounts
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