-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Transaction cache for proving backend #4455
Description
When we calculate the storage root inside the runtime we cache the resulting transaction. This transaction can be applied to the backend to get the state of the block. After #3860 is merged, the cached transactions can be used in the import process to not require re-executing the freshly build block. When executing on the default state-machine backend the caching works and we don't need to regenerate the transaction. However, when we want to use the proving backend together with the transaction cache, the compiler currently denies it. The problem is that we can not proof to the compiler that the transaction type used by the proving backend is the same as we give it. (This leads to re-generating the transaction) To solve this, we need to clean up the state-machine Backend trait:
- This method to converting a
Backendinto aTrieBackendshould be removed. Every backend should be a trie backend. - The only stopping point is the
InMemoryBackendthat currently requires some special treatment.
This probably requires someone with a good understanding of the trie to rewrite the InMemoryBackend. I can mentor/help to some extend.