@@ -64,11 +64,11 @@ time ./bitc -d --connect <ip> --sync-and-exit # clean header-sync benchmark
6464- ` core/ ` — the engine: ` peer.c ` /` peergroup.c ` (p2p + peer management),
6565 ` block-store.c ` (header chain + checkpoints), ` btc-message.c ` /` serialize.c `
6666 (wire protocol), ` key.c ` /` crypt.c ` /` hash.c ` (crypto), ` wallet.c ` , ` txdb.c ` ,
67- ` script.c ` , ` bloom.c ` , ` base58.c ` , ` rpc.c ` .
67+ ` script.c ` , ` base58.c ` , ` rpc.c ` .
6868- ` lib/ ` — reusable infra: ` poll/ ` (home-grown ` poll(2) ` event loop),
6969 ` netasync/ ` (async sockets), ` util/ ` , ` file/ ` , ` poolworker/ ` , ` config/ ` , etc.
70- - ` public /` — shared headers: ` bitc.h ` (the global ` struct BITCApp *btc ` ),
71- ` bitc-defs.h ` (protocol constants/messages).
70+ - ` core /` — app-wide shared headers and implementation : ` bitc.h ` (the global ` struct BITCApp *btc ` ),
71+ ` bitc-defs.h ` (protocol constants/messages), plus
7272
7373** Threading model** (important, non-obvious): a ** single-threaded ` poll(2) ` event
7474loop** (` lib/poll ` , ` select(2) ` fallback) drives all socket I/O and message
@@ -77,11 +77,9 @@ state) runs on that one thread, so that shared state needs no locking. The
7777"multi-threaded" claim is the separate ** 10-thread poolworker** (` lib/poolworker ` )
7878used for CPU offload. During header sync CPU sits ~ 27%; the work is latency-bound.
7979
80- ** SPV mechanism** : currently BIP37 (bloom filter ` filterload ` + ` merkleblock ` ),
81- which modern Core nodes disable by default. There is an unfinished BIP37
82- ` peergroup_download_filtered_blocks ` phase that runs after header sync and hits an
83- ` ASSERT(0) ` in ` blockstore_get_hash_from_birth ` . The modernization direction is
84- BIP157/158 compact block filters (not yet implemented).
80+ ** SPV mechanism** : uses BIP157/158 compact block filters (not BIP37 bloom filters).
81+ The old BIP37 ` peergroup_download_filtered_blocks ` path is dead code that hits an
82+ ` ASSERT(0) ` in ` blockstore_get_hash_from_birth ` .
8583
8684** Header sync** : driven by a single ` peergroup->downloadPeer ` (parallel download
8785from multiple peers corrupts the shared counters). Sync loops ` getheaders ` until a
@@ -98,7 +96,7 @@ Prioritized improvements:
98963 . Validate header proof of work, difficulty, timestamps, and chainwork.
99974 . Make wallet accounting reorg-safe.
100985 . Version persistence formats and support recovery.
101- 6 . Replace BIP37 with BIP157/158 compact block filters .
99+ 6 . Improve compact filter download parallelism and reorg handling .
1021007 . Add SegWit, Bech32m, and Taproot support.
1031018 . Migrate to versioned AEAD wallet encryption.
1041029 . Add descriptors, BIP32, and PSBT support.
0 commit comments