Skip to content

Cache computation of the block hash in state #2923

@ValarDragon

Description

@ValarDragon

Feature Request

Summary

We re-compute the block hash several times during consensus. We should just cache this block hash computation. E.g. each HashesTo call recreates the block's hash.

Here is the time spent in block hashing in a node synced to osmosis mainnet for 1 hour:
image

This is by no means the bottleneck, but is part of the sequential bottleneck of consensus and would be good to reduce, via only computing it once per block.

Proposal

I suggest that we cache this by adding a verifiedHash field to the internal Block type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions