romanz / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
1.02k stars 373 forks source link

electrs stops when looking up for addresses with a lot of transactions #1047

Open tchjntr opened 1 month ago

tchjntr commented 1 month ago

Describe the bug I am running a self-hosted instance of Mempool and I stumbled upon an address that has quite a large number of transactions.

When looking up for that address on my self-hosted Mempool with a Bitcoin Knots + electrs backend, electrs stops working with the following error messages:

May 30 11:42:47 u59pro electrs[897604]: [2024-05-30T09:42:47.756Z INFO  electrs::electrum] your wallet uses less efficient method of querying electrs, consider contacting the developer of your wallet. Reason: blockchain.scripthash.get_balance called for unsubscribed scripthash
May 30 11:42:47 u59pro electrs[897604]: [2024-05-30T09:42:47.841Z WARN  electrs::thread] p2p_send thread failed: p2p failed to send
May 30 11:42:47 u59pro electrs[897604]: [2024-05-30T09:42:47.841Z WARN  electrs::thread] because: Broken pipe (os error 32)
May 30 11:42:47 u59pro electrs[897604]: [2024-05-30T09:42:47.841Z WARN  electrs::electrum] RPC blockchain.scripthash.get_balance failed: failed to get block 00000000000000000000b71ed0d9bec536d4fbbfa4da8dece0edb25324d11db0: receiving on an empty and disconnected channel
May 30 11:42:47 u59pro electrs[897604]: [2024-05-30T09:42:47.841Z INFO  electrs::db] closing DB at /home/janitor/.electrs/bitcoin
May 30 11:42:48 u59pro electrs[897604]: Error: electrs failed
May 30 11:42:48 u59pro electrs[897604]: Caused by:
May 30 11:42:48 u59pro electrs[897604]:     0: sync failed
May 30 11:42:48 u59pro electrs[897604]:     1: sending on a disconnected channel
May 30 11:42:48 u59pro systemd[1]: electrs.service: Main process exited, code=exited, status=1/FAILURE
May 30 11:42:48 u59pro systemd[1]: electrs.service: Failed with result 'exit-code'.

The command bitcoin-cli getblock 00000000000000000000b71ed0d9bec536d4fbbfa4da8dece0edb25324d11db0 is successful so it's not an issue with a possible missing block.

Electrs version 0.10.5

To Reproduce Steps to reproduce the behavior:

  1. Fully synced Bitcoin Knots and electrs
  2. Configure and run self-hosted instance of Mempool
  3. Lookup address bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h
  4. electrs system unit stops

Expected behavior I expect address lookups to complete successfully

Configuration electrs config file:

db_dir = "/home/janitor/.electrs/"
db_log_dir = "/home/janitor/.electrs/"
daemon_dir = "/home/janitor/.bitcoin/"
cookie_file = "/home/janitor/.bitcoin/.cookie"
network = "bitcoin"
electrum_rpc_addr = "127.0.0.1:50001"
daemon_rpc_addr = "127.0.0.1:8332"
daemon_p2p_addr = "127.0.0.1:8333"
monitoring_addr = "127.0.0.1:4224"
wait_duration_secs = 10
jsonrpc_timeout_secs = 15
index_batch_size = 10
index_lookup_limit = 0
reindex_last_blocks = 0
server_banner = "electrs 0.10.5"
log_filters = "info"
timestamp = true
auto_reindex = true
ignore_mempool = false
disable_electrum_rpc = false
sync_once = false
skip_block_download_wait = true

System running electrs