diff --git a/crates/brk_cli/README.md b/crates/brk_cli/README.md index 80b4fab90..b04b2c2ee 100644 --- a/crates/brk_cli/README.md +++ b/crates/brk_cli/README.md @@ -18,7 +18,7 @@ Command-line interface for running a Bitcoin Research Kit instance. ```bash rustup update -RUSTFLAGS="-C target-cpu=native" cargo install --locked brk_cli" +RUSTFLAGS="-C target-cpu=native" cargo install --locked brk_cli ``` Portable build (without native CPU optimizations): diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index cc3e00ac7..5b24d9c12 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,101 @@ All notable changes to the Bitcoin Research Kit (BRK) project will be documented > *This changelog was generated by Claude Code* +## [v0.1.2](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.2) - 2026-01-29 + +### New Features + +#### `brk_bindgen` +- Added `indexToDate(index, i)` and `isDateIndex(index)` helper functions to JavaScript client for converting index values to Date objects ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_bindgen/src/generators/javascript/client.rs)) +- Added `index_to_date(index, i)` and `is_date_index(index)` helper functions to Python client ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_bindgen/src/generators/python/client.rs)) +- Added rich helper methods to JavaScript `MetricData` response object: + - `dates()` - convert index range to Date array + - `indexes()` - get index range as number array + - `toDateMap()` / `toIndexMap()` - convert to Map keyed by date or index + - `dateEntries()` / `indexEntries()` - get as `[key, value]` pair arrays + - `iter()` / `iterDates()` - generator functions for iteration + - `[Symbol.iterator]()` - enable `for...of` loop support +- Added rich helper methods to Python `MetricData` dataclass: + - `dates()` - convert index range to date list + - `indexes()` - get index range as list + - `to_date_dict()` / `to_index_dict()` - convert to dict + - `date_items()` / `index_items()` - get as tuple lists + - `iter()` / `iter_dates()` - iterators for (index, value) or (date, value) + - `to_polars(with_dates)` / `to_pandas(with_dates)` - convert to DataFrame with optional date column +- Added `index` field to MetricData JSON response indicating the index type used for the query + +#### `brk_types` +- Added `CentsSigned` type (i64-based) for signed cent values used in profit/loss calculations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/cents_signed.rs)) +- Added `CentsSignedCompact` type (i32-based) for memory-efficient signed cents in map keys ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/cents_signed_compact.rs)) +- Added `CentsUnsigned` type (u64-based) for unsigned cent values used in invested capital and realized cap ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/cents_unsigned.rs)) +- Added `CentsUnsignedCompact` type (u32-based) for memory-efficient unsigned cents ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/cents_unsigned_compact.rs)) +- Added `is_date_based()` method to `Index` enum to check if an index type represents dates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/index.rs)) +- Added `index_to_date(i)` method to `Index` enum for converting index values to `Date` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/index.rs)) +- Added `From` implementations to convert date-based index types (`WeekIndex`, `MonthIndex`, `YearIndex`, `QuarterIndex`, `SemesterIndex`, `DecadeIndex`) to `Date` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/date.rs)) + +#### `brk_computer` +- Added `invested_capital_in_profit` and `invested_capital_in_loss` fields to `UnrealizedState` for tracking cost basis of positions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/state/cost_basis/unrealized.rs)) + +#### `brk_server` +- Added higher API weight limit (50MB) for localhost requests compared to remote requests (650KB) to support larger local data queries ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_server/src/api/metrics/mod.rs)) + +#### `brk_logger` +- Added `LOG` environment variable support for simple log level control (e.g., `LOG=debug brk`) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_logger/src/lib.rs)) + +#### `brk_cli` +- Added `ENVIRONMENT` and `CONFIG` sections to help output documenting `LOG`/`RUST_LOG` variables and config file location ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_cli/src/config.rs)) + +#### `workspace` +- Added GitHub Actions workflow to check for outdated dependencies daily ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/.github/workflows/outdated.yml)) +- Added SIMD instruction flags (BMI1, BMI2, AVX2) for x86_64 targets to accelerate pcodec decompression ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/.cargo/config.toml)) + +### Bug Fixes + +#### `brk_indexer` +- Fixed rollback consistency: deduplicate `addressindex_txindex` removals to prevent double deletion when same address appears multiple times in a transaction ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/stores.rs)) +- Fixed rollback cache consistency: clear txid caches after rollback to prevent stale reads ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/stores.rs)) + +#### `brk_computer` +- Fixed rollback recovery to use actual consistent height instead of target height for state imports ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/compute/recover.rs)) +- Fixed detection of failed rollbacks when height lands ahead of target, now falls back to fresh start ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/compute/recover.rs)) +- Fixed address index lookups to use `get_any_or_read_at_unwrap` instead of `get_pushed_or_read_at_unwrap` to properly check updated layer after rollback ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/address/indexes/any.rs)) +- Fixed height subtraction overflow using `saturating_sub` in computer example ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/examples/computer.rs)) + +#### `brk_cli` +- Fixed config file not being overwritten on every startup, preserving user modifications ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_cli/src/config.rs)) + +### Internal Changes + +#### `brk_bindgen` +- Switched from `HashMap` to `BTreeMap` in pattern analysis for deterministic code generation order ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_bindgen/src/analysis/patterns.rs)) +- Added `write_if_changed()` utility to skip file writes when content is unchanged, avoiding unnecessary cargo rebuilds ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_bindgen/src/generators/mod.rs)) + +#### `brk_store` +- Added `clear_caches()` method to clear all partition caches after bulk removals like rollback ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_store/src/lib.rs)) + +#### `brk_indexer` +- Removed unused `COLLISIONS_CHECKED_UP_TO` constant ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/constants.rs)) +- Added debug logging for transaction metadata storage showing inserted/skipped counts ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/processor/tx.rs)) +- Added error logging for unknown TXID cases with full context including store result and current txindex ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_indexer/src/processor/txin.rs)) + +#### `brk_computer` +- Added extensive debug and warning logging throughout rollback recovery process ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_computer/src/distribution/compute/recover.rs)) + +#### `brk_server` +- Added middleware to extract client socket address and pass to API handlers ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_server/src/lib.rs)) + +#### `brk_logger` +- Changed log file naming format from `{prefix}.{date}` to `{prefix}_{date}.txt` ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_logger/src/rate_limit.rs)) + +#### `brk_cli` +- Increased server startup delay from 3 to 10 seconds when indexing is far behind ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_cli/src/main.rs)) +- Added separator lines around "Indexing blocks" message for visibility ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_cli/src/main.rs)) + +#### `brk_types` +- Added comprehensive unit tests for `Date` from index type conversions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.2/crates/brk_types/src/date.rs)) + +[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.1...v0.1.2) + ## [v0.1.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.1) - 2026-01-27 ### Bug Fixes diff --git a/modules/brk-client/package.json b/modules/brk-client/package.json index 4025f890d..aa67cbf1a 100644 --- a/modules/brk-client/package.json +++ b/modules/brk-client/package.json @@ -34,5 +34,5 @@ "url": "git+https://github.com/bitcoinresearchkit/brk.git" }, "type": "module", - "version": "0.1.1" + "version": "0.1.2" } diff --git a/packages/brk_client/pyproject.toml b/packages/brk_client/pyproject.toml index 365a33d8c..8bab88c0a 100644 --- a/packages/brk_client/pyproject.toml +++ b/packages/brk_client/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "brk-client" -version = "0.1.1" +version = "0.1.2" description = "Python client for the Bitcoin Research Kit" readme = "README.md" requires-python = ">=3.9"