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.

Get rid of junk in storage proofs. #9170

Open
@arkpar

Description

@arkpar

Currently block execution storage proofs contain nodes that are not actually necessary to validate the block.

There's a common pattern in the runtime that we use to store intermediate values. Values that need to be passed around between extrinsics. Such values are put in the storage and are removed at the end of block execution with take. Here's one example:

let extrinsics = (0..ExtrinsicCount::<T>::take().unwrap_or_default())

The problem here is that take attempts to delete the value from the trie, even if it is not there. This attempted deletion query ends up being part of the proof.

A proposed solution would be to use revert rather than take. revert would simply delete the key from the state overlay.
Alternatively we could use static memory instead of storage API for intermediate values. This would also be a significant performance win, although some additional work would be needed to implement transactional semantics with this method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I9-optimisationAn enhancement to provide better overall performance in terms of time-to-completion for a task.U2-some_time_soonIssue is worth doing soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions