Skip to content

Releases: janx/ckbadger

v0.8.2

Choose a tag to compare

@github-actions github-actions released this 26 Sep 07:58

Full Changelog: v0.8.1...v0.8.2

v0.8.1

Choose a tag to compare

@github-actions github-actions released this 26 Sep 03:34

What's Changed

  • fix(frontend): prevent homepage horizontal overflow by @Hanssen0 in #13

New Contributors

Full Changelog: v0.8.0...v0.8.1

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 25 Sep 04:29

Full Changelog: v0.7.4...v0.8.0

v0.7.4

Choose a tag to compare

@github-actions github-actions released this 08 Sep 16:10

Full Changelog: v0.7.3...v0.7.4

v0.7.3

Choose a tag to compare

@janx janx released this 07 Sep 05:50

v0.7.3 restores historical did:ckb indexing, fixes intermittent DAO listing errors, and expands the opt-in peer crawler with resumable rounds and inspectable discovery and session evidence.

Goal

  • Preserve protocol facts throughout bulk sync, keep API reads coherent while the indexer advances, and make locally observed CKB peer evidence available through the API, web UI, and TUI.

Principle Alignment

  • CKB Native: did:ckb identities and their historical outpoint mappings are derived from chain data through the existing protocol-facts parser.
  • Local First: the crawler checkpoints its work in local RocksDB and resumes across execution slices and process restarts. Network observations remain separate from replayable chain data.
  • Agent Friendly: verification exposes check selection and endpoint overrides, and peer endpoints expose typed observations and their provenance.
  • Store ownership: corrected identity writes target the indexer-owned domain store. Crawler state and observations target the crawler-owned network store. The append-only cell-payload format and write-once semantics are unchanged; APIs remain read-only.

Result

  • Retain did:ckb facts during bulk sync. The binary bulk parser now carries did:ckb protocol facts into identity materialization. This fixes missing historical identities and the later live-sync failure when one of their cells is consumed. An exhaustive match prevents future protocol-backed tags from silently dropping their facts, with a regression using a real testnet cell.
  • Keep secondary-store reads coherent. Each HTTP request pins one read view while RocksDB catch-up is coordinated across secondary stores. DAO status listings now resolve their index rows and deposits through the same view, fixing intermittent HTTP 500 responses during normal withdrawal transitions. The cycles long-poll releases its pin before waiting for new data.
  • Make verification selectable. ckbadger verify exposes --checks, --no-explorer, output format, sampling controls, endpoint overrides, and cache configuration. Unknown checks, checks above the selected depth, and ambiguous orchestrator-level endpoint overrides fail explicitly. The suite now includes an exact DAO status-index cross-check, bringing it to 57 checks.
  • Resume and finish crawl rounds. Durable frontiers, bounded concurrent dialing, fair alias retries, and atomic checkpoints preserve progress across slices and restarts. A completed snapshot is published only after the round drains; crawl --once now completes one whole logical round. Discovery aliases are canonicalized and validated consistently at scheduling and publication.
  • Inspect peer evidence. The API, web UI, and TUI expose Discovery advertisements, advertiser provenance, per-address dial outcomes, and direct sessions reported by the configured local CKB node. Peers observed only through direct sessions remain visible. Session direction is relative to that local node, and RPC session addresses are kept separate from reusable dial aliases. The observer's genesis hash must match the configured network.

Upgrade instructions

Re-sync required: yes. Earlier bulk syncs omitted did:ckb identity rows and outpoint mappings in the domain store. Stop ckbadger, purge the affected chain stores or initialize a fresh work directory, then start v0.7.3 and sync from genesis. Existing databases are not repaired or backfilled by this release.

Existing crawler installations also need these changes:

  1. Rename [crawler].round_budget_secs to [crawler].slice_budget_secs in each network's configuration. The old key is rejected.
  2. Recreate the network primary and its API secondary, then crawl again. Default mainnet paths are work/mainnet/data/network and work/mainnet/data/network-api-secondary. The network schema is incompatible with previous serialized values, and a chain purge does not clear this separate observation store.
  3. Update API clients from /api/v1/network/nodes to /api/v1/network/peers, including detail routes. History metrics totalNodes and reachableNodes become verifiedPeers and reachablePeers; summary and peer response fields also change. See the network API contract.

Validation

  • The release workflow passed and published the Linux x86_64 archive and SHA-256 checksum.
  • The downloaded archive passed sha256sum -c; the packaged binary reports ckbadger 0.7.3@86135d398027.
  • Frontend production build, TypeScript checking, and lint passed.
  • CI for the tagged commit is not green: 803 frontend tests passed and one script-detail test failed (renders zero-deployment versions without synthesizing fake deployment rows). Rust Clippy failed on the Rust 1.98 chunks_exact_to_as_chunks lint in crates/ckbadger-store/src/stats_ops.rs:49, so the Rust test step did not run.
  • A targeted local run of pnpm exec vitest run __tests__/pages/script-detail.test.tsx passed all five tests on the tagged commit; this does not replace the full CI result above.

Full changelog: v0.7.2...v0.7.3

v0.7.2

Choose a tag to compare

@github-actions github-actions released this 17 Aug 05:00

v0.7.2 adds an exact live-cell inventory API, makes shallow-reorg rollback proportional to affected chain data, corrects the DAO treasury partition, and updates USDI metadata.

This release includes 13 commits across 57 files.

Highlights

Exact live-cell inventory

The new GET /api/v1/cells/live-summary endpoint exposes an exact block-end inventory of CKB's live cells:

  • liveCells, derived as the checked sum of three mutually exclusive classes: dao, typedNonDao, and plain
  • dataBearing, an orthogonal count of cells with non-empty data
  • A canonical tip.block and tip.hash that consumers can verify against their local CKB node

The indexer maintains these counters incrementally across live sync, bulk build, and shallow reorgs. The API performs a fixed number of point reads instead of scanning cells, and returns 503 initializing while the first snapshot is being built or a reorg is being reconciled rather than returning stale or default data.

All new persistent writes target the mutable domain store. The append-only CF_CELLS store is unchanged.

Bounded shallow-reorg rollback

Rollback no longer performs several chain-sized scans for a small fork:

  • Address transaction rows are derived from rolled-back transaction contexts instead of scanning the entire addr_txs column family. On the observed testnet failure, the old path scanned 641 million keys and took roughly 170 seconds to delete one row.
  • Token-transfer cleanup now seeks only the type hashes touched by the rolled-back range.
  • Statistics cleanup now seeks only replay-scoped key families.
  • The parser's unresolved-input retry budget pauses while rollback owns the writer, preventing an expected temporary unresolved state from terminating the pipeline.

Regression tests pin the bounded read counts so these scans cannot silently become chain-sized again.

Exact DAO treasury and compensation partition

Treasury now subtracts all exact unclaimed DAO compensation, including compensation frozen on phase-1 withdraw-request cells. This removes a 77,489,937.99 CKB overlap where the same phase-1 amount appeared in both compensation and treasury.

Daily DAO snapshots now materialize exact phase-1 compensation. /api/v1/charts/secondary-issuance exposes protocolTotalShannons and phase1CompensationShannons, allowing verification to normalize the official Explorer's legacy overlapping partition without rescanning DAO lifecycles or widening tolerances.

Metadata and maintenance

  • Corrected the testnet USDI deployment to use its dedicated six-decimal, xUDT-compatible metadata and added the issuer icon. A regression test pins the deployment type hash and imported values.
  • Hardened CI path filtering and pnpm caching, updated clippy-compatible sort expressions for Rust 1.97, and made CLI path tests portable across runner environments.

Upgrade notes

Important

A full re-sync from genesis is required. v0.7.2 adds the live-cell summary state and extends persisted DAO daily snapshots in the domain store. Do not reuse a v0.7.1 domain database. The append-only cell-payload store format is unchanged.

Stop ckbadger, purge the affected RocksDB data or initialize a fresh work directory, then start v0.7.2 and allow each configured network to sync from genesis.

Contributors

  • @yixyxiu made their first contribution in #12, correcting the bundled USDI metadata.

Full changelog: v0.7.1...v0.7.2

v0.7.1

Choose a tag to compare

@github-actions github-actions released this 04 Aug 04:34

Full Changelog: v0.7.0...v0.7.1

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 03 Aug 15:04

v0.7.0 brings full testnet parity, multi-network orchestration, an opt-in CKB peer crawler, major bulk-sync memory improvements, and extensive correctness fixes across chain-derived data.

This release includes 287 commits across 403 files.

Highlights

Mainnet and testnet in one explorer

CKBadger can now run multiple CKB networks side by side:

  • ckbadger init --with-testnet creates mainnet and testnet stacks under one orchestrator.
  • Each network runs its own indexer, API, and RocksDB stores.
  • One shared frontend provides network-aware routing and reverse proxying.
  • The web UI and TUI now include network switchers.
  • URLs, API requests, WebSockets, caches, and realtime state are scoped to the active network.
  • Startup validates the CKB node's genesis hash and persisted database identity to prevent cross-network data corruption.
  • APIs and the frontend start immediately while fresh-store indexers are admitted sequentially.

Predictable, bounded memory during bulk sync

Bulk sync received a substantial memory-management overhaul. Memory is now treated as a hard runtime boundary rather than an approximate tuning target.

  • Prefetch and flush queues apply backpressure using actual retained payload bytes.
  • Fetched blocks are split using their encoded sizes, while flush permits account for retained row-vector memory.
  • Batch draining uses cell count as the primary target with a RAM-derived byte cap for safety.
  • Compact address identifiers, packed per-block history payloads, and sparse side maps reduce long-lived reducer memory.
  • Interned lock, type, and data identities maintain exact live reference counts; identities with no remaining live references are reclaimed between batches.
  • Transient facts, frozen views, and temporary build state are released between stages instead of accumulating through the full sync.
  • Final owner snapshots and live-cell indexes are streamed through bounded 32 MiB write batches instead of constructing a second full copy in memory.
  • A whole-process memory guard checks RSS and swap before each batch, after building, and before finalization. It reduces subsequent input size when headroom becomes tight and fails with detailed diagnostics before the kernel OOM killer intervenes.
  • jemalloc now covers both Rust and RocksDB/C allocations on supported platforms, improving allocator visibility and unused-page reclamation.
  • [indexer].bulk_memory_budget_gb can set an explicit whole-indexer limit; otherwise the per-network share of host RAM is used.
  • Only one co-resident network may perform a fresh-store bulk sync at a time.
  • After durable bulk completion, the indexer exits cleanly and the supervisor starts a fresh live-sync process, releasing the entire bulk reducer heap.

Bulk sync remains intentionally single-shot: an interrupted or incomplete build fails fast and requires rebuilding from genesis.

CKB peer network explorer

v0.7.0 adds an opt-in crawler for observing the reachable CKB P2P network:

  • New ckbadger crawl [--once] command and supervised crawler service.
  • Separate network store for TTL-retained, non-chain observations.
  • Peer summaries, client and protocol distributions, historical trends, filtering, and pagination.
  • Optional MaxMind country and ASN enrichment.
  • New peer views in both the web explorer and TUI.

The crawler is disabled by default and remains isolated from deterministic chain stores.

More exact chain-derived data

Five audit rounds corrected roughly 60 data and read-path issues.

Notable changes include:

  • Genesis issuance, burnt capacity, circulating supply, APC, and Common Knowledge baselines are now derived exactly from block 0 for each network.
  • Protocol identification is centralized in ProtocolRegistry, providing consistent mainnet and testnet classification.
  • DAO miner secondary issuance, withdrawal compensation, request-cell occupied capacity, and daily snapshots now follow protocol-exact calculations.
  • UDT supplies, holder balances, transfers, and activity deltas support the full u128 range, with wider intermediate aggregation where required.
  • Reorg rollback now restores DAO, HODL, block-time, activity, address-set, and cutoff-bucket statistics exactly.
  • Script usage is attributed to the actual deployment and exact script reference form.
  • Transaction fees, cycles, proposal windows, hash rate, rolling 24-hour statistics, and daily bucket boundaries were corrected.
  • did:ckb and independent .bit Cell identities are now indexed correctly.
  • Fiber, Stable++, UTXOSwap, RGB++, Spore, mNFT, and DOB parsing received substantial correctness fixes.

Reliability and explorer improvements

  • Append-only cell data is durably synced before the domain-store tip advances.
  • Supervisor crash-loop protection and blocked-state reporting were strengthened.
  • Completed bulk builds are no longer discarded when shutdown arrives during the final durable handoff.
  • API listeners bind immediately while caches seed through background refresh loops.
  • Filtered activity scans for large addresses now pre-filter through the compact address index.
  • Invalid hashes, numeric identifiers, cursors, addresses, and filters return controlled client errors.
  • Canonical RFC-0021 bech32m address handling is enforced.
  • Spore pagination is now lossless and uses strict composite cursors.
  • Unknown token decimals remain unknown instead of being guessed, and raw amounts are preserved exactly.
  • Deterministic DOB decode failures are stored and shown to users instead of remaining permanently pending.
  • Proposal graphs, cell dependencies, object routing, search results, and network initialization UX were improved.

Breaking changes

Full re-sync required

Important

v0.7.0 changes multiple schemas, key layouts, persisted types, and calculation semantics. Every configured network must be re-synced from genesis. Do not reuse v0.6 domain or append-only RocksDB data.

New configuration layout

  • ckbadger.toml is now the top-level orchestrator configuration.
  • Each network uses its own <network>/config.toml.
  • A directory containing only config.toml continues to work in standalone single-network mode.

Network-scoped shared endpoints

When accessing APIs through the shared frontend:

  • REST: /api/{network}/v1/*
  • WebSocket: /ws/{network}
  • Explorer pages: /{network}/*

Direct per-network API ports continue to expose /api/v1/* and /ws.

Upgrading

The recommended upgrade path is to initialize a fresh v0.7 work directory:

# Mainnet only
ckbadger init -C <new-workdir>

# Mainnet and testnet
ckbadger init -C <new-workdir> --with-testnet

Reapply the CKB RPC URL, node workdir, storage settings, and custom metadata in each network's config.toml, then start the orchestrator:

ckbadger -C <new-workdir> run

The final multi-network merge was validated with 3,500 Rust tests and 815 frontend tests.

Full changelog: v0.6.0...v0.7.0

v0.6.3

Choose a tag to compare

@github-actions github-actions released this 04 Jul 02:47

Full Changelog: v0.6.2...v0.6.3

v0.6.2

Choose a tag to compare

@github-actions github-actions released this 07 Jun 03:12

Full Changelog: v0.6.1...v0.6.2