spesmilo / electrumx

Alternative implementation of spesmilo/electrum-server
MIT License
429 stars 343 forks source link

electrumx crashes after DASH hardfork #218

Closed cipig closed 12 months ago

cipig commented 1 year ago

DASH did a hardfork today, which makes the server to crash like this:

ERROR:electrumx:ElectrumX server terminated abnormally
Traceback (most recent call last):
  File "/usr/local/bin/electrumx_server", line 35, in main
    asyncio.run(controller.run())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.9/dist-packages/electrumx/lib/server_base.py", line 129, in run
    await server_task
  File "/usr/local/lib/python3.9/dist-packages/electrumx/lib/server_base.py", line 102, in serve
    await self.serve(shutdown_event)
  File "/usr/local/lib/python3.9/dist-packages/electrumx/server/controller.py", line 134, in serve
    await group.spawn(wait_for_catchup())
  File "/usr/local/lib/python3.9/dist-packages/aiorpcx/curio.py", line 297, in __aexit__
    await self.join()
  File "/usr/local/lib/python3.9/dist-packages/electrumx/lib/util.py", line 370, in join
    task.result()
  File "/usr/local/lib/python3.9/dist-packages/electrumx/server/mempool.py", line 373, in keep_synchronized
    await group.spawn(self._logging(synchronized_event))
  File "/usr/local/lib/python3.9/dist-packages/aiorpcx/curio.py", line 297, in __aexit__
    await self.join()
  File "/usr/local/lib/python3.9/dist-packages/electrumx/lib/util.py", line 370, in join
    task.result()
  File "/usr/local/lib/python3.9/dist-packages/electrumx/server/mempool.py", line 258, in _refresh_hashes
    await self._process_mempool(hashes, touched, height)
  File "/usr/local/lib/python3.9/dist-packages/electrumx/server/mempool.py", line 302, in _process_mempool
    deferred, unspent = task.result()
  File "/usr/local/lib/python3.9/dist-packages/electrumx/server/mempool.py", line 349, in _fetch_and_accept
    tx_map = await run_in_thread(deserialize_txs)
  File "/usr/local/lib/python3.9/dist-packages/aiorpcx/curio.py", line 57, in run_in_thread
    return await get_event_loop().run_in_executor(None, func, *args)
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/dist-packages/electrumx/server/mempool.py", line 333, in deserialize_txs
    tx, tx_size = deserializer(raw_tx).read_tx_and_vsize()
  File "/usr/local/lib/python3.9/dist-packages/electrumx/lib/tx.py", line 152, in read_tx_and_vsize
    return self.read_tx(), self.binary_length
  File "/usr/local/lib/python3.9/dist-packages/electrumx/lib/tx_dash.py", line 409, in read_tx
    assert self.cursor == end
AssertionError

guess the deserializer will need changes

s-mohammad-dabir commented 1 year ago

Hello, Do you have any updates?

cipig commented 1 year ago

Hello, Do you have any updates?

Unfortunately not. I am not a developer, so i can't fix this myself. A developer from DASH would be the perfect person to fix this, they know best about the changes in DASH.

UdjinM6 commented 1 year ago

Please test https://github.com/spesmilo/electrumx/pull/221

cipig commented 1 year ago

Please test #221

Works fine. Also did a swap by using the electrum servers: image

Thanks a lot for the fix.