Skip to content

tbc: change database to Larry#740

Open
AL-CT wants to merge 5 commits into
mainfrom
toni/larry
Open

tbc: change database to Larry#740
AL-CT wants to merge 5 commits into
mainfrom
toni/larry

Conversation

@AL-CT
Copy link
Copy Markdown
Contributor

@AL-CT AL-CT commented Nov 3, 2025

Summary
Migrates tbcd database from leveldb to Larry.

While functionality remains the same, the tbcd database implementation no longer utilizes leveldb directly. It instead uses a larry multidb, which separates each database table into its own file, similarly to the original pool implementation. Furthermore, multidb allows us to easily switch the underlying KV database for each of the tables. However, switching from using leveldb to a dynamic framework will require a database upgrade, and thus was left for a future PR.

This change also allows us to eliminate the need for multiple database interfaces so all tbcd related components were moved to the appropriate tbcd > level package, simplifying the old package and file structure from:

- database/
   ├─ level/
   │   └─ level.go
   ├─ tbcd/
   │   ├─ level/
   │   │   └─ level.go
   │   └─ database.go
   └─ database.go

To the following:

- database/
   └─ tbcd/
       ├─ level/
       │   └─ level.go
       └─ database.go

Changes

  • Replace leveldb with multidb.
  • Replace old leveldb code with larry API compliant replacements.
  • Remove the database package interface, and merge it with the tbcd database interface.
  • Remove the isolated level database code and merge it with the tbcd database implementation.

Related Future Changes

  • Database upgrade to allow dynamic database engines for each table.
  • Integrated replication system to provide distributed tbcd database nodes.

@github-actions github-actions Bot added area: tbc This is a change to TBC (Tiny Bitcoin) changelog: required This pull request must update the CHANGELOG.md file or explicitly be marked with changelog: skip labels Nov 3, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 3, 2025

@github-actions github-actions Bot added area: docs This is a change to documentation changelog: done This pull request includes an appropriate update to CHANGELOG.md. and removed changelog: required This pull request must update the CHANGELOG.md file or explicitly be marked with changelog: skip labels Jan 14, 2026
@AL-CT AL-CT added type: refactor This refactors existing functionality size: XXL This change is extremely large (+/- 1000+). Changes this large should be split into multiple PRs changelog: required This pull request must update the CHANGELOG.md file or explicitly be marked with changelog: skip and removed changelog: done This pull request includes an appropriate update to CHANGELOG.md. area: docs This is a change to documentation labels Jan 14, 2026
@github-actions github-actions Bot added area: docs This is a change to documentation changelog: done This pull request includes an appropriate update to CHANGELOG.md. and removed changelog: required This pull request must update the CHANGELOG.md file or explicitly be marked with changelog: skip labels Jan 14, 2026
@AL-CT AL-CT marked this pull request as ready for review January 14, 2026 14:54
@AL-CT AL-CT requested a review from joshuasing January 14, 2026 15:05
@ClaytonNorthey92
Copy link
Copy Markdown
Contributor

let's run this against localnet, running here: https://github.com/hemilabs/heminetwork/actions/runs/20999721117

@ClaytonNorthey92
Copy link
Copy Markdown
Contributor

localnet test passing 👍

@AL-CT AL-CT added the status: blocker This is blocking something else and requires review label Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs This is a change to documentation area: tbc This is a change to TBC (Tiny Bitcoin) changelog: done This pull request includes an appropriate update to CHANGELOG.md. size: XXL This change is extremely large (+/- 1000+). Changes this large should be split into multiple PRs status: blocker This is blocking something else and requires review type: refactor This refactors existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants