romanz / electrs

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

Bug: mempool sync failed: batch request failed #985

Open antonilol opened 9 months ago

antonilol commented 9 months ago

Describe the bug after updating to the newest version today electrs spits out a bunch of mempool sync failed: batch request failed warnings one time after about 20 of them electrs exited, this could be unrelated, it said something like receiving on an unconnected channel (i lost that part of the log)

Electrs version 84c9a79cacc3cfb0131a75bd1d85f9bad27e6b45 (v0.10.2)

To Reproduce Steps to reproduce the behavior:

  1. Configure and start electrs
  2. Connect with electrum client mempool (mempool.space local instance) server
  3. Wait
  4. See warnings (log level must be at least warn), maybe it exits

Expected behavior not getting warnings that say something failed (mempool server does not use that part of electrs, mempool functions fine, including address lookup)

Configuration no config file or env Arguments: --log-filters DEBUG --db-dir /home/node/.bitcoin/electrs --electrum-rpc-addr=0.0.0.0:50002 --index-lookup-limit=500

System running electrs

Electrum client Client name (if not upstream desktop Electrum) and version: mempool/mempool bf4a1fcd7ad04a9ec626e82b36668916a600bee9

Additional context it happened just after updating 0.9.14

if it is not directly clear where this comes from i can set up a way to test the mempool sync part of electrs (i think using electrum wallet should be fine)

romanz commented 8 months ago

Many thanks for reporting this issue!

eugenesan commented 8 months ago

Same issue here. Running master as of today [f1be85f] and Core 26.0.

antonilol commented 8 months ago

just to add, i run Core v25.0.0

romanz commented 8 months ago

IIUC, the current mempool sync algorithm may fail to retrieve some transactions (most probably due to RBF): https://github.com/romanz/electrs/blob/f1be85fa7fcdf25e849a11f2b639c4f94a75ced3/src/mempool.rs#L54-L98 In that case, it's not a real problem - unless it fails consistently.

antonilol commented 8 months ago

i now regularly get these warnings about twice a day (max 10 on 6th of january), but before i would get them spammed in the log every 2 or so seconds, restarting electrs seemed to fix that

romanz commented 8 months ago

Please try https://github.com/romanz/electrs/pull/997 - it should help with this issue.

antonilol commented 8 months ago

got master + #997 running on my node right now, will report later on the results as these messages did not show very often, also, no new mempool sync failed messages have been logged since january 24th which is a bit strange to me as i did not do anything to it then (no restart or update etc)

i will report bugs and logged warnings related to that pr in the thread there