Skip to content

test: replace ffldb Bitcoin fixture#80

Merged
wolf31o2 merged 1 commit into
mainfrom
test/handshake-ffldb-fixtures
Jul 17, 2026
Merged

test: replace ffldb Bitcoin fixture#80
wolf31o2 merged 1 commit into
mainfrom
test/handshake-ffldb-fixtures

Conversation

@wolf31o2

@wolf31o2 wolf31o2 commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • generate deterministic, Handshake-wire blocks for ffldb storage tests
  • enable the interface, pruning, corruption, and injected failure suites
  • remove the inherited Bitcoin fixture with incompatible 80-byte headers
  • derive corruption offsets from decoded transaction locations

Validation

  • go test ./...
  • go vet ./...
  • make build
  • make lint workers=2
  • CI-pinned golangci-lint v2.1.6
  • make unit-cover
  • make unit-race
  • make integration
  • pinned hsd interop at 9f013c1cb7f92edf94db69fbd69daf34adf655fb
  • exact CI Go 1.26.5 test, vet, build, coverage, race, integration, and hsd interop
  • repeated ffldb tests and race tests under Go 1.26.5
  • Docker builds for linux/amd64 and linux/arm64

Summary by cubic

Replaced the Bitcoin-based test fixture with deterministic Handshake-wire blocks for ffldb tests, resolving the header mismatch (80-byte Bitcoin vs 236-byte Handshake). This restores the full interface, pruning, corruption, and injected failure coverage.

  • Refactors
    • Added ffldb.TstHandshakeBlocks(t) to generate deterministic Handshake blocks from mainnet genesis (no PoW).
    • Switched driver_test.go, interface_test.go, and whitebox_test.go to the new helper and unskipped the related suites.
    • Derived corruption offsets from TxLoc to target transaction bytes reliably.
    • Removed database/testdata/blocks1-256.bz2 and the bzip2/IO loader code.

Written for commit 1d2cf7f. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Tests
    • Re-enabled pruning, interface, and failure-scenario database tests.
    • Added deterministic Handshake block fixtures for reliable test execution.
    • Improved corruption testing by deriving validation offsets from transaction data.
    • Replaced legacy external block fixtures with built-in test data.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0762d3a8-7833-4ee4-8562-bd97bcae0d14

📥 Commits

Reviewing files that changed from the base of the PR and between 4e5c69d and 1d2cf7f.

⛔ Files ignored due to path filters (1)
  • database/testdata/blocks1-256.bz2 is excluded by !**/*.bz2
📒 Files selected for processing (4)
  • database/ffldb/driver_test.go
  • database/ffldb/handshake_fixture_test.go
  • database/ffldb/interface_test.go
  • database/ffldb/whitebox_test.go

📝 Walkthrough

Walkthrough

Added deterministic synthetic Handshake block fixtures with serialization round-trip validation. Updated pruning, interface, and white-box tests to use the shared fixture helper and removed their early skips. Removed legacy bz2 fixture-loading code. White-box corruption testing now derives the target offset from transaction locations rather than a fixed byte offset.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: ffldb tests replace the old Bitcoin fixture with Handshake test blocks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/handshake-ffldb-fixtures

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

You're on the cubic free plan with 9 free PR reviews remaining this month. Upgrade for unlimited reviews.

Re-trigger cubic

@wolf31o2
wolf31o2 merged commit 5139380 into main Jul 17, 2026
14 checks passed
@wolf31o2
wolf31o2 deleted the test/handshake-ffldb-fixtures branch July 17, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant