hemilabs/heminetwork

tbc: roll heighthash database into blockheaders

Open

#535 opened on Jun 10, 2025

View on GitHub
 (1 comment) (0 reactions) (1 assignee)Go (108 forks)auto 404
area: tbcgood first issuesize: XLtype: enhancementtype: refactor

Repository metrics

Stars
 (143 stars)
PR merge metrics
 (PR metrics pending)

Description

Confirmation

  • I have checked for similar issues.

Problem

We keep a separate database to map height to hash of blockheaders. This really should be rolled into the blockheaders database which will drastically simplify database locking.

Suggested solution

  • Remove heighthash database
  • Reindex all blockheaders and encode heighthash in the same database as follows: H[32 bit big endian height][32 byte hash]
  • Adjust calls that use heighthash database to dig into blockheaders database instead and index on H[height]`
  • Upgrade database +1

Additional Information

No response

Contributor guide