Skip to content

Releases: zeldhash/protoblock

v0.1.6

06 Dec 13:57
e18c6f4

Choose a tag to compare

[0.1.6] - 2025-12-06

Fixed

  • Refresh the cached blockchain tip after HeightOutOfRange events so the fetcher no longer stalls or crashes when a worker briefly targets heights above the actual tip.

v0.1.5

02 Dec 21:30
b57275a

Choose a tag to compare

[0.1.5] - 2025-12-02

Changed

  • Downgraded routine RPC retry and circuit-breaker logs from warn to info to reduce noise during normal syncs.
  • Worker pool control-signal delivery failures now log at info, reflecting their expected occurrence during shutdown.

v0.1.4

01 Dec 20:24
84502a1

Choose a tag to compare

[0.1.4] - 2025-12-01

Changed

  • bump bitcoin crate dependency to 0.32

v0.1.3

28 Nov 22:51
ea2e504

Choose a tag to compare

[0.1.3] - 2025-11-28

Fixed

  • fix Cargo.lock

v0.1.2

28 Nov 22:22
f604e2d

Choose a tag to compare

[0.1.2] - 2025-11-28

Fixed

  • fix cargo.toml

v0.1.1

28 Nov 22:03
d66218d

Choose a tag to compare

[0.1.1] - 2025-11-28

Fixed

  • docs.rs build now succeeds by dropping the unstable doc_auto_cfg gate from src/lib.rs

Changed

  • Oversized batch and RPC retry logs are downgraded from warn to info to reduce noise during normal resizing
  • Ordered queue gap test hooks carry a queue identifier so pause probes only affect the intended queue under test

v0.1.0

23 Nov 12:31
d9c75bd

Choose a tag to compare

[0.1.0] - 2025-11-23

Added

Core Features

  • Asynchronous Bitcoin block ingestion pipeline with multiplexed JSON-RPC batch calls across a worker pool
  • BlockProtocol trait for user-defined block processing with pre_process, process, rollback, and shutdown hooks
  • Runner for lifecycle management with graceful shutdown and signal handling (Ctrl-C support)
  • BlocksFetcher orchestrating the worker pool, ordered queue, and main processing loop

Worker Pool & Concurrency

  • Multi-threaded worker pool for concurrent block fetching with configurable thread_count
  • Double-buffer prefetching in workers to minimize RPC idle time by launching the next batch request while preprocessing
  • Automatic batch sizing that grows/shrinks based on observed megabytes per batch
  • Tip wait mode that reduces worker pool to a single task when catching up to Bitcoin tip

Queue & Backpressure

  • OrderedBlockQueue guaranteeing strictly increasing block heights despite out-of-order worker fetches
  • Queue byte budget with configurable queue_max_size_mb to enforce backpressure and prevent unbounded memory growth
  • QueueByteSize trait for tracking post-pre_process memory footprint

Reorg Handling

  • ReorgWindow tracking recent block hashes to detect chain reorganizations
  • Automatic rollback via BlockProtocol::rollback when fork is detected
  • Configurable reorg window size to control maximum tolerated reorg depth

RPC & Networking

  • RpcCircuitBreaker to avoid hammering failing Bitcoin nodes with automatic recovery probing
  • Configurable RPC timeout with retry instrumentation
  • HTTP client with Basic authentication support for Bitcoin Core RPC
  • Batch request/response size limits (rpc_max_request_body_bytes, rpc_max_response_body_bytes)

Observability & Telemetry

  • Built-in tracing with init_tracing() helper for structured logging
  • Metrics reporter exposing throughput, queue blocks/bytes, and RPC error rates
  • Configurable metrics interval for telemetry snapshot logging
  • ProgressTracker reporting pipeline progress and durable heights

Configuration

  • FetcherConfig builder with validation for all runtime parameters
  • Comprehensive configuration options including:
    • RPC connection settings (URL, user, password)
    • Worker pool size and batch sizing
    • Queue limits and backpressure thresholds
    • Reorg window size
    • Timeout and retry settings
    • Tip polling and refresh intervals

Error Handling

  • FatalErrorHandler for stopping pipeline on unrecoverable protocol errors
  • Graceful error propagation from workers through BlocksFetcher to Runner
  • Fast shutdown semantics with immediate worker termination on cancellation

Examples & Documentation

  • rpc_speed.rs example for measuring raw JSON-RPC throughput with live progress bar
  • Quick start example demonstrating LoggingProtocol implementation
  • Comprehensive README with architecture overview, configuration guide, and usage examples
  • docs/architecture.md detailing internal pipeline and concurrency model
  • docs/usage.md covering configuration, protocol implementation, and operational practices

Testing

  • Unit tests for core components
  • Mock integration tests with simulated RPC client
  • Regtest suite for end-to-end testing against real Bitcoin Core (opt-in via PROTOBLOCK_RUN_REGTESTS=1)
  • CI/CD workflows for tests, coverage, formatting, clippy, and publishing

Technical Details

  • Rust 1.79+ required
  • Built on Tokio async runtime
  • Uses jsonrpsee for RPC client
  • Bitcoin block parsing via bitcoin crate
  • Dual-licensed under MIT OR Apache-2.0