Skip to content

btcindexer: fix ingestor integration and types#186

Merged
robert-zaremba merged 10 commits intomasterfrom
robert/fix-ingestor-integration
Nov 18, 2025
Merged

btcindexer: fix ingestor integration and types#186
robert-zaremba merged 10 commits intomasterfrom
robert/fix-ingestor-integration

Conversation

@robert-zaremba
Copy link
Contributor

Description

Follow up on: #154

Signed-off-by: Robert Zaremba <robert@zaremba.ch>
Signed-off-by: Robert Zaremba <robert@zaremba.ch>
Signed-off-by: Robert Zaremba <robert@zaremba.ch>
Signed-off-by: Robert Zaremba <robert@zaremba.ch>
Signed-off-by: Robert Zaremba <robert@zaremba.ch>
Signed-off-by: Robert Zaremba <robert@zaremba.ch>
@robert-zaremba robert-zaremba requested a review from a team as a code owner November 18, 2025 16:41
Copilot AI review requested due to automatic review settings November 18, 2025 16:41
@robert-zaremba robert-zaremba self-assigned this Nov 18, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @robert-zaremba, your pull request is larger than the review limit of 150000 diff characters

@robert-zaremba
Copy link
Contributor Author

@copilot update description of the pull request based on the changes. Ignore changes in worker-configuration.d.ts.

Copy link
Contributor

Copilot AI commented Nov 18, 2025

@robert-zaremba I've opened a new pull request, #187, to work on those changes. Once the pull request is ready, I'll request review from you.

Signed-off-by: Robert Zaremba <robert@zaremba.ch>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes integration issues and type inconsistencies in the btcindexer following PR #154. The main changes standardize the KV namespace binding names, refactor the block ingestion flow to use timestamps, and improve type organization.

Key changes:

  • Renamed KV namespace binding from btc_blocks to BtcBlocks for consistency with naming conventions
  • Replaced kv_key field with timestamp_ms in BlockQueueRecord interface
  • Moved NbtcDepositSender interface from models to storage module for better organization
  • Refactored block ingestion to generate timestamp once per batch and simplified queue message preparation

Reviewed Changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/lib/src/nbtc.ts Added timestamp_ms field to BlockQueueRecord, removed kv_key, and added kvBlocksKey helper function
packages/btcindexer/wrangler.jsonc Updated KV namespace binding name to BtcBlocks and removed trailing commas
packages/btcindexer/src/storage.ts Renamed method getBlockInfo to getBlockHash, moved NbtcDepositSender interface here, and renamed insertBtcDeposit to insertNbtcMintDeposit
packages/btcindexer/src/router.ts Updated KV namespace reference from btc_blocks to BtcBlocks
packages/btcindexer/src/queue-handler.ts Removed storage parameter, simplified block processing logic, and improved retry handling
packages/btcindexer/src/models.ts Removed NbtcDepositSender interface (moved to storage.ts)
packages/btcindexer/src/index.ts Updated function call to processBlockBatch to remove storage parameter
packages/btcindexer/src/cf-storage.ts Updated imports, implemented renamed methods, and modified insertBlockInfo to use timestamp_ms
packages/btcindexer/src/btcindexer.ts Reorganized imports, updated storage initialization with new binding name, and added insertBlockInfo call in processBlock
packages/btcindexer/src/btcindexer.test.ts Updated test data to use timestamp_ms instead of kv_key
packages/btcindexer/db/migrations/0001_initial_schema.sql Fixed indentation in SQL schema
packages/block-ingestor/wrangler.jsonc Updated KV namespace binding to BtcBlocks and removed trailing commas
packages/block-ingestor/src/ingest.ts Refactored to use kvBlocksKey helper, simplified batch preparation, and generate timestamp once per batch
packages/block-ingestor/src/index.ts Updated parameter name from BlockStore to BtcBlocks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Robert Zaremba <robert@zaremba.ch>
Copy link
Contributor

@sczembor sczembor left a comment

Choose a reason for hiding this comment

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

lgtm.

@robert-zaremba robert-zaremba merged commit f313297 into master Nov 18, 2025
11 checks passed
@robert-zaremba robert-zaremba deleted the robert/fix-ingestor-integration branch November 18, 2025 23:44
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.

4 participants