Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I experimented a bit more with the LMDB integration, since I think we shouldn't give up too quickly on this, since potential client-wide gains would be just too significant if we could integrate.
Even if by no means clean I will push my work based on #2986 here since this is a bit reduced with no blockchain integration e.g. and therefore has less code changes and it gets somewhat easier to play with and adopt.
So @scorbajio mentioned in his integration PR that the client would start but it would take several (!) minutes until execution/sync starts at all. We should definitely have a closer look here and try to fix this, since this has some large likelyhood to point us to what we are still doing structurally wrong. This is by no means "normal" LMDB behavior.
The one thing I noticed from the LMDB docs is that LMDB
get
is synchronous. This was definitely not yet considered in the previous PR, so I think it makes a lot of sense to take this as a starting point.In the current overhaul I've made the very last DB call sync by interface addition (so this would be backwards compatible), this doesn't bring the change yet though.
So I think we should make the (somewhat harder) test and see what happens if the whole call stack (so from StateManager -> Trie -> DB) is made synchronous. A bit hairy to admint. But we might be able to at lest test this in some not too dramatic way by just copy-paste code over and name sync methods similarly what I've done for the interface.
So that might already be it. If LMDB is made for synchronous gets and this is called in an async manner, might be that things block each other and this is eventually the reason client is not properly starting.
As a reminder why we are doing this:
These are promises/results from a benchmark run. Take with a grain of salt (from the LMDB website/GitHub), but other benchmarks do point to larger gains too.
So at least worth to go one level deeper and test this to the level that we are sure about our results.