Skip to content

feat: replace ledger LMDB index with Fjall - #70

Closed
bmuddha wants to merge 2 commits into
devfrom
issue-62-fjall-ledger-index
Closed

feat: replace ledger LMDB index with Fjall#70
bmuddha wants to merge 2 commits into
devfrom
issue-62-fjall-ledger-index

Conversation

@bmuddha

@bmuddha bmuddha commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Replace each superblock's LMDB index with three Fjall keyspaces committed atomically at block boundaries.
  • Encode ordered slot and account-span key components in big-endian form while retaining little-endian opaque span values; account history uses pubkey_prefix || execution_span keys with empty values.
  • Publish ordinary blocks with buffered durability and use data synchronization for explicit sync, seal, reset, shutdown, and retention boundaries.
  • Open sealed indexes lazily, exempt the two sealed predecessors of the active head from idle eviction, and close older indexes after ten idle minutes.
  • Purge retained superblocks synchronously and move the remaining heed transaction helpers from nucleus into AccountsDB's index module.

Closes #62

Impact

The ledger index format is intentionally incompatible with existing LMDB ledgers and has no migration path. Blockstore and execution stream formats are unchanged. Ordinary block publication avoids per-block device synchronization; explicit strong boundaries retain data-sync durability. Fjall LZ4 compression remains disabled because the realistic fixture reduced closed-directory size by only 7.37%.

Reviewer notes

The highest-risk invariants are cross-keyspace batch publication, reverse ordering and exclusive pagination for account history, and metadata publication only after the selected file/index durability boundary. Retention removes metadata durably before synchronously purging the sealed directory.

@bmuddha bmuddha added the enhancement New feature or request label Aug 18, 2026
@bmuddha bmuddha self-assigned this Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 910ca14b-940c-4074-9a7a-5f73bbe624eb


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bmuddha

bmuddha commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

superseded with #71

@bmuddha bmuddha closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace the LMDB ledger index with a write-optimized backend

1 participant