Blockstream / esplora

Explorer for Bitcoin and Liquid
MIT License
1.01k stars 398 forks source link

A panic in src/new_index/fetch.rs:143:17 #523

Open Warchant opened 2 months ago

Warchant commented 2 months ago

I am running a custom signet.

Modified run script like this:

docker run -p 50001:50001 -p 8084:80 \
           --volume $PWD/data_bitcoin_signet:/data \
           --rm -i -t blockstream/esplora \
           bash -c '
           echo "Creating configuration file..."
           cat << EOF > /srv/explorer/source/contrib/bitcoin-signet-explorer.conf.in
signet=1
[signet]
signetchallenge=51210............................. # CUSTOM SIGNET
server=1
peerbloomfilters=0
enforcenodebloom=1
disablewallet=1
listenonion=1
listen=1
mempoolfullrbf=1
blocknotify=pkill -USR1 electrs
maxmempool=1000
EOF
           echo "Configuration file created. Starting explorer..."
           /srv/explorer/run.sh bitcoin-signet explorer
           '

Docker image:

blockstream/esplora   latest    177ecccc19cb   4 months ago    1.03GB

Here is the panic:

2-thread 'blkfiles_fetcher' panicked at src/new_index/fetch.rs:143:17:                                                                              2-failed to index 4711 blocks from blk*.dat files
2-note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2-Config { log: StdErrLog { verbosity: Info, quiet: false, show_level: true, timestamp: Millisecond, modules: [], writer: "stderr", color_choice: Never, show_module_names: false }, network_type: Signet, db_path: "/data/electrs_bitcoin_db/signet/signet", daemon_dir: "/data/bitcoin/signet", blocks_dir: "/data/bitcoin/signet/blocks", daemon_rpc_addr: 127.0.0.1:38332, cookie: None, electrum_rpc_addr: 0.0.0.0:50001, http_addr: 127.0.0.1:3000, http_socket_file: Some("/var/electrs-rest.sock"), monitoring_addr: 0.0.0.0:4224, jsonrpc_import: false, light_mode: false, address_search: true, index_unspendables: false, cors: None, precache_scripts: None, utxos_limit: 500, electrum_txs_limit: 100000, electrum_banner: "Welcome to electrs-esplora 0.4.1", electrum_public_hosts: None, electrum_announce: false, tor_proxy: Some(127.0.0.1:9050) }
2-2024-09-06T11:22:52.780+00:00 - INFO NetworkInfo { version: 240100, subversion: "/Satoshi:24.1.0/", relayfee: 1e-5 }
2-2024-09-06T11:22:52.781+00:00 - INFO BlockchainInfo { chain: "signet", blocks: 4710, headers: 4710, bestblockhash: "00000077de172497375c8744b61f06f6c4967d4db55929131cde7a5b2864936b", pruned: false, verificationprogress: 1.0, initialblockdownload: Some(false) }
RCasatta commented 1 month ago

Not sure what changes in your custom signet, we may not support that if the magic bytes are different from normal signet https://docs.rs/bitcoin/0.31.2/src/bitcoin/p2p/mod.rs.html#212

As a workaround you can use --jsonrpc-import which compromise speed of first sync but should not have this kind of issues