Skip to content

Create lmdb unit tests #7715

@SWvheerden

Description

@SWvheerden

Bounty: Create LMDB Unit Tests

Tier: M — 60,000 XTM

Description

LMDB correctness in the base node is currently untested. Create a reproducible test chain (genesis block, 10 main-chain blocks, and a 10-block fork from block 5) and write two unit tests: one that writes the chain to a new LMDB file and bit-compares it against a reference, and one that loads the LMDB file and verifies all headers, blocks, outputs, inputs, kernels, and accumulated data can be fetched correctly through the full range of query methods.

Acceptance Criteria

  • A test chain is created with a genesis block, 10 main-chain blocks, and a 10-block fork from block 5
  • All block data is saved in a JSON file for reproducibility
  • A write test creates a new LMDB file from the JSON data and bit-compares it against the reference file
  • A read test loads the LMDB file and verifies all 15 main-chain headers, 5 reorged headers, and all blocks can be fetched
  • The read test verifies per-block queries: outputs by header_hash, inputs by header_hash, kernels by header_hash, output by hash, unspent output by commitment, output by payref, outputs with spend state at height, kernel by excess sig, and header containing kernel by MMR position

Context

How to Claim

  1. Comment on this issue to signal intent (courtesy, not a lock)
  2. Fork the repo and do the work
  3. Submit a PR that meets the acceptance criteria
  4. First PR that passes review and gets merged wins the bounty
  5. On acceptance, XTM payment is processed

Notes

  • AI-assisted development is expected and encouraged
  • If you get stuck, ask in Discord
  • If you can't complete it within 14 days of claiming, let us know so someone else can pick it up

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions