Skip to content

Conversation

@romanz
Copy link
Owner

@romanz romanz commented Dec 25, 2025

Requires bitcoin/bitcoin#33657 (to be released in Bitcoin Core 31).

For more information, see slides.

@romanz romanz force-pushed the bindex branch 6 times, most recently from 68811de to 2970eb8 Compare December 28, 2025 10:27
@romanz romanz self-assigned this Dec 28, 2025
@romanz
Copy link
Owner Author

romanz commented Dec 28, 2025

Tested by subscribing to https://mempool.space/address/1BitcoinEaterAddressDontSendf59kuE (with warm OS block cache):

$ ./contrib/history.sh --venv 1BitcoinEaterAddressDontSendf59kuE --only-subscribe
$ curl -s localhost:4224 | egrep 'electrs_rpc_duration_.*scripthash'
commit duration [sec]
this PR 2970eb8 0.6
base b562e8c 3.2

which is quite similar to bindex CLI-based query:

$ ./bindex.sh -a <(echo 1BitcoinEaterAddressDontSendf59kuE) -1
+ export RUST_LOG=info
+ RUST_LOG=info
+ cargo +stable build --release --all --locked
    Finished `release` profile [optimized] target(s) in 0.03s
+ ARGS='--db-path ./db'
+ ulimit -n 8192
+ target/release/bindex-cli --db-path ./db -a /dev/fd/63 -1
[2025-12-28T15:35:25.900146Z INFO  bindex::cache] added 1 new addresses to watch
[2025-12-28T15:35:25.900163Z INFO  bindex::chain] index DB: "./db/bitcoin", node URL: http://localhost:8332
[2025-12-28T15:35:25.943368Z INFO  bindex::db] CF headers: 1082 files, 74.300911 MBs
[2025-12-28T15:35:25.943873Z INFO  bindex::db] CF txpos: 1229 files, 1326.950489 MBs
[2025-12-28T15:35:25.944020Z INFO  bindex::db] CF txid: 227 files, 14415.941564 MBs
[2025-12-28T15:35:25.944425Z INFO  bindex::db] CF script_hash: 634 files, 40907.656340 MBs
[2025-12-28T15:35:26.330326Z INFO  bindex::chain] block=000000000000000000004aa07f2de9399d0cefe7ae3515c0b06404acae21be1f height=929877 headers loaded
[2025-12-28T15:35:26.360323Z INFO  bindex::db] started auto compactions
[2025-12-28T15:35:26.363367Z INFO  bindex::cache] adding 1 history entries, 5333 transactions, 2219 headers to cache=""
[2025-12-28T15:35:26.969674Z INFO  bindex_cli] 1 address history: 5333 entries, balance: 13.39953869 BTC, UTXOs: 5500 [10.700165ms]

@romanz romanz added this to the 0.12.0 milestone Dec 28, 2025
@romanz romanz changed the title WIP: use bindex WIP: use bindex Dec 28, 2025
@romanz romanz force-pushed the bindex branch 3 times, most recently from 7063933 to 41be478 Compare December 28, 2025 19:06
@romanz
Copy link
Owner Author

romanz commented Dec 29, 2025

Tested on 37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z, having 23k txs:

$ time ./contrib/history.sh --venv 37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z --only-subscribe
commit duration [sec]
this PR 2970eb8 11.51 → 2.42
base b562e8c 813

Footnotes

  1. first subscription (reading transactions from disk)

  2. re-subscription benefits from warm OS cache

  3. too many blocks to be cached

@romanz romanz force-pushed the bindex branch 2 times, most recently from 6128a86 to 9f8b9c7 Compare December 31, 2025 20:42
@romanz romanz changed the title WIP: use bindex Switch to bindex Dec 31, 2025
@romanz romanz force-pushed the bindex branch 3 times, most recently from 17f6fcf to 4dab202 Compare January 3, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants