Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tchjntr opened this issue May 30, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@tchjntr
Copy link

tchjntr commented May 30, 2024

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

  • Deployment method: manual, static linking
  • OS name and version: Debian 12 x64
@tchjntr tchjntr added the bug Something isn't working label May 30, 2024
@su-sd
Copy link

su-sd commented Aug 11, 2024

I have the same log messages. This is probably the same bug as #1011

[2024-08-11T03:45:38.331Z DEBUG electrs::server] 16: recv [{"method": "blockchain.scripthash.get_history", "params": ["03308ec8dd9f3324db5fef4e83a268abcabbafd247ae53e7bcfec51002c236e9"], "id": 39398, "jsonrpc": "2.0"}]
[2024-08-11T03:45:38.331Z INFO  electrs::electrum] your wallet uses less efficient method of querying electrs, consider contacting the developer of your wallet. Reason: blockchain.scripthash.get_history called for unsubscribed scripthash
[2024-08-11T03:45:40.159Z DEBUG electrs::p2p] loading 216003 blocks
[2024-08-11T03:45:40.202Z DEBUG electrs::p2p] closing p2p_loop thread: peer has disconnected
[2024-08-11T03:45:40.202Z WARN  electrs::thread] p2p_send thread failed: p2p failed to send
[2024-08-11T03:45:40.202Z WARN  electrs::thread] p2p_recv thread failed: failed to recv a message from peer: IO error
[2024-08-11T03:45:40.203Z WARN  electrs::electrum] RPC blockchain.scripthash.get_history failed: failed to get block 00000000000000000012206336bbb49aca889479cae2877399756ad5798d4ffb: receiving on an empty and disconnected channel
[2024-08-11T03:45:40.203Z DEBUG electrs::server] 16: send [{"error":{"code":1,"message":"failed to get block 00000000000000000012206336bbb49aca889479cae2877399756ad5798d4ffb"},"id":39398,"jsonrpc":"2.0"}]
[2024-08-11T03:45:40.204Z INFO  electrs::db] closing DB at ./db/bitcoin
[2024-08-11T03:45:40.203Z WARN  electrs::thread] because: Broken pipe (os error 32)
[2024-08-11T03:46:03.905Z DEBUG electrs::server] 16: disconnected
Error: electrs failed

Caused by:
    0: sync failed
    1: sending on a disconnected channel

@su-sd
Copy link

su-sd commented Aug 11, 2024

This is easy reproducible with
``blockchain.scripthash.get_history scripthash(1N52wHoVR79PMDishab2XmRHsbekCdGquK)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants