Bug: electrs hangs on `get_history`

Đang mở
#1,069 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
api, backend, database

Hướng nghiên cứu

Bắt đầu từ các điểm vào RPC của Electrum cho blockchain.scripthash.subscribe và blockchain.scripthash.get_history, sau đó lần theo đường dẫn tra cứu địa chỉ và tải khối được thể hiện trong nhật ký máy chủ. Tái hiện bằng scripthash được cung cấp hoặc địa chỉ ví dụ và xác định lý do yêu cầu đi vào quá trình tải 70,101 khối; hoàn thành khi yêu cầu trả về mà không bị treo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Describe the bug
I want to get information about addresses (balances, transactions) via a custom script. While getting information of some addresses with a lot of transactions, electrs hangs, while there is no load on the cpu, disk or bitcoind.
Even Ctrl+C and kill does not work anymore.

Electrs version
603830f1b921928089c558d90519b7ca0c0d4658
Tag v0.10.5

To Reproduce

  1. Configure and start electrs
  2. Connect with custom client
  3. Call blockchain.scripthash.subscribe b3308ec9eb6b94b333e6aba375f681ad5a9630e823eb82c68e3f1cc38f9ea3fa
    or alternative
  4. Call blockchain.scripthash.get_history b3308ec9eb6b94b333e6aba375f681ad5a9630e823eb82c68e3f1cc38f9ea3fa

Expected behavior
A response and no hang

Configuration
electrs --ignore-mempool --network bitcoin --log-filters debug

System running electrs

  • Debian 12, custom build according to the docs

Electrum client
custom script

Additional context
Log file of electrum:

Starting electrs 0.10.5 on x86_64 linux with Config { network: Bitcoin, db_path: "./db/bitcoin", db_log_dir: None, daemon_dir: "/home/electrum/.bitcoin", daemon_auth: CookieFile("/home/electrum/.bitcoin/.cookie"), daemon_rpc_addr: 127.0.0.1:8332, daemon_p2p_addr: 127.0.0.1:8333, electrum_rpc_addr: 127.0.0.1:50001, monitoring_addr: 127.0.0.1:4224, wait_duration: 10s, jsonrpc_timeout: 15s, index_batch_size: 10, index_lookup_limit: None, reindex_last_blocks: 0, auto_reindex: true, ignore_mempool: true, sync_once: false, skip_block_download_wait: false, disable_electrum_rpc: false, server_banner: "Welcome to electrs 0.10.5 (Electrum Rust Server)!", signet_magic: f9beb4d9, args: [] }
[2024-08-10T19:07:01.295Z DEBUG tiny_http] Server listening on 127.0.0.1:4224
[2024-08-10T19:07:01.296Z INFO  electrs::metrics::metrics_impl] serving Prometheus metrics on 127.0.0.1:4224
[2024-08-10T19:07:01.296Z INFO  electrs::server] serving Electrum RPC on 127.0.0.1:50001
[2024-08-10T19:07:01.296Z DEBUG tiny_http] Running accept thread
[2024-08-10T19:07:01.321Z INFO  electrs::db] "./db/bitcoin": 194 SST files, 49.010265499 GB, 6.135426344 Grows
[2024-08-10T19:07:01.322Z DEBUG electrs::db] DB Some(Config { compacted: true, format: 0 })
[2024-08-10T19:07:01.345Z DEBUG electrs::db] auto-compactions enabled
[2024-08-10T19:07:02.860Z INFO  electrs::chain] loading 856201 headers, tip=0000000000000000000190c29c8dded4505059eb9bb3a973535611be782b3465
[2024-08-10T19:07:03.932Z INFO  electrs::chain] chain updated: tip=0000000000000000000190c29c8dded4505059eb9bb3a973535611be782b3465, height=856201
[2024-08-10T19:07:03.942Z DEBUG bitcoincore_rpc] JSON-RPC request: getblockchaininfo []
[2024-08-10T19:07:03.944Z DEBUG bitcoincore_rpc] JSON-RPC request: getnetworkinfo []
[2024-08-10T19:07:03.944Z DEBUG bitcoincore_rpc] JSON-RPC request: getnetworkinfo []
[2024-08-10T19:07:03.945Z DEBUG bitcoincore_rpc] JSON-RPC request: getblockchaininfo []
[2024-08-10T19:07:03.945Z DEBUG bitcoincore_rpc] JSON-RPC request: getnetworkinfo []
[2024-08-10T19:07:03.947Z DEBUG electrs::p2p] peer version: VersionMessage { version: 70016, services: ServiceFlags(3081), timestamp: 1723316823, receiver: Address {services: ServiceFlags(NONE), address: 0.0.0.0, port: 0}, sender: Address {services: ServiceFlags(NETWORK|WITNESS|NETWORK_LIMITED|P2P_V2), address: 0.0.0.0, port: 0}, nonce: 12289463789444946264, user_agent: "/Satoshi:27.1.0/", start_height: 856201, relay: false }
[2024-08-10T19:07:03.947Z DEBUG electrs::p2p] got 0 new headers
[2024-08-10T19:07:13.949Z DEBUG electrs::p2p] got 0 new headers
[2024-08-10T19:07:23.949Z DEBUG electrs::p2p] got 0 new headers
[2024-08-10T19:07:26.647Z DEBUG electrs::server] 0: recv [{"method": "blockchain.scripthash.subscribe", "params": ["b3308ec9eb6b94b333e6aba375f681ad5a9630e823eb82c68e3f1cc38f9ea3fa"], "id": 0, "jsonrpc": "2.0"}]
[2024-08-10T19:07:26.647Z DEBUG electrs::server] 0: connected
[2024-08-10T19:07:26.683Z DEBUG electrs::p2p] loading 70101 blocks
[2024-08-10T19:18:13.689Z INFO  electrs::signals] notified via SIG2
[2024-08-10T19:18:14.953Z INFO  electrs::signals] notified via SIG2

Edit: I know the time-span in the log is short, but it really hangs for hours.
An example address is: 1NDyJtNTjmwk5xPNhjgAMu4HDHigtobu1s
If there is a way to know in advance if a query will hang, it would be a ok-ish workaround for me.

Ngôn ngữ chính
Rust
Star
1.4k
Fork
580
Merge trung bình
13 giờ 8 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của romanz/electrs

Tất cả issue của romanz/electrs

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.