Repository navigation
v0.7.0
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-testnetcreates 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_gbcan 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
u128range, 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.tomlis now the top-level orchestrator configuration.- Each network uses its own
<network>/config.toml. - A directory containing only
config.tomlcontinues 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-testnetReapply 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> runThe final multi-network merge was validated with 3,500 Rust tests and 815 frontend tests.
Full changelog: v0.6.0...v0.7.0