Describe the bug
After a contract suicides the storage_diff table should verify that the positions associated to the contract have been removed. Due to the way trace_replayTransactions returns contract suicide https://github.com/paritytech/parity/issues/8937, these storage positions are not wiped out.
To Reproduce
Steps to reproduce the behavior:
Fill the required blocks in the database.
$ # Block that creates the contract
$ ether_sql scrape_block --block_number=54300
$ # Block that suicides the contract
$ ether_sql scrape_block --block_number=54316
If code_to goes to Null during filling the state_diff table, we should ask the database for currently existing storage positions associated to the address and clean them as well. This would require finding existing positions in the database, which is a costly operation. (Note: till block 5,826,976 there were contracts 6,829,008 and 2,767,4816 suicides ~ 1:2)
Ignore the storage of accounts with no code, this is a hack, not advisable but easiest to implement until option 1 becomes a possibility.
Describe the bug After a contract suicides the storage_diff table should verify that the positions associated to the contract have been removed. Due to the way
trace_replayTransactions
returns contract suicide https://github.com/paritytech/parity/issues/8937, these storage positions are not wiped out.To Reproduce Steps to reproduce the behavior:
Fill the required blocks in the database.
Check the
storage_diff
table in the database:The
storage_diff
rows that demonstrate deleting the positions in the contract address are missing.Expected behavior The
storage_diff
table should have extra rows to show the clean_up after the contract suicides.Options to resolve the issue
code_to
goes toNull
during filling the state_diff table, we should ask the database for currently existing storage positions associated to the address and clean them as well. This would require finding existing positions in the database, which is a costly operation. (Note: till block 5,826,976 there were contracts 6,829,008 and 2,767,4816 suicides ~ 1:2)