Directly bypass the StateDB layer into the disk DB, in order to find out if a value exists. This will avoid a lot of caching bugs.
The obvious problem with this approach, is that reading a slot will require hashing. One workaround for this problem would be to have a DB with (key, values). All the insertions/tree updates are moved to the prefetcher/background threads. This would mean that the tree and values are stored at different locations - and that we need to rewrite the disk access layer in geth :| Let's see how bad the performance hit is, before we go for that one.
One thing to note is that there are really two things that cause this read:
SELFDESTRUCT is the use case for which the most checks need to happen. Note that this isn't implemented at the current state of this PR.
SSTORE is the other use case, and unfortunately it will come at a significant slowdown.
Directly bypass the
StateDB
layer into the disk DB, in order to find out if a value exists. This will avoid a lot of caching bugs.The obvious problem with this approach, is that reading a slot will require hashing. One workaround for this problem would be to have a DB with (key, values). All the insertions/tree updates are moved to the prefetcher/background threads. This would mean that the tree and values are stored at different locations - and that we need to rewrite the disk access layer in geth :| Let's see how bad the performance hit is, before we go for that one.
One thing to note is that there are really two things that cause this read:
SELFDESTRUCT
is the use case for which the most checks need to happen. Note that this isn't implemented at the current state of this PR.SSTORE
is the other use case, and unfortunately it will come at a significant slowdown.