Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Transaction cache for proving backend #4455

@bkchr

Description

@bkchr

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 Backend into a TrieBackend should be removed. Every backend should be a trie backend.
  • The only stopping point is the InMemoryBackend that 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I7-refactorCode needs refactoring.I9-optimisationAn enhancement to provide better overall performance in terms of time-to-completion for a task.Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.Z6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions