chris-belcher/electrum-personal-server

Startup error with bitcoin core 23.0

waage opened this issue ยท 8 comments

waage commented
INFO:2022-04-25 17:11:27,328: Synchronizing mempool . . .
Traceback (most recent call last):
  File "/home/norbert/.local/bin/electrum-personal-server", line 8, in <module>
    sys.exit(main())
  File "/home/norbert/.local/lib/python3.8/site-packages/electrumpersonalserver/server/common.py", line 494, in main
    run_electrum_server(rpc, txmonitor, config)
  File "/home/norbert/.local/lib/python3.8/site-packages/electrumpersonalserver/server/common.py", line 121, in run_electrum_server
    mempool_sync.initial_sync(logger)
  File "/home/norbert/.local/lib/python3.8/site-packages/electrumpersonalserver/server/mempoolhistogram.py", line 57, in initial_sync
    self.poll_update(-1)
  File "/home/norbert/.local/lib/python3.8/site-packages/electrumpersonalserver/server/mempoolhistogram.py", line 111, in poll_update
    fee_rate = 1e8*mempool_tx["fee"] // mempool_tx["vsize"]
KeyError: 'fee'

I get exactly the same error after upgrading Bitcoin Core to 23.0

Same error

I found a work around for now:

In /home/user/.local/lib/python3.8/site-packages/electrumpersonalserver/server/mempoolhistogram.py

I changed line 108:

mempool_tx = self.rpc.call("getmempoolentry", [txid])

into

mempool_tx = self.rpc.call("getmempoolentry -deprecatedrpc=fees", [txid])

and EPS was working again. This was changed in version 23 of Bitcoin Core

- - The top-level fee fields `fee`, `modifiedfee`, `ancestorfees` and `descendantfees`
  returned by RPCs `getmempoolentry`,`getrawmempool(verbose=true)`,
  `getmempoolancestors(verbose=true)` and `getmempooldescendants(verbose=true)`
  are deprecated and will be removed in the next major version (use
  `-deprecated=fees` if needed in this version).

As well as what @hMsats wrote, you can also fix this by adding deprecatedrpc=fees to your bitcoin.conf file and then restarting Bitcoin Core.

The same kind of thing happened with this other issue: #247

Ah awesome, that config worked for me too

I get the impression that my proposed solution above (changing line 108 in mempoolhistogram.py) increases the cpu usage of EPS considerably. Itโ€™s now often at the top of the Unix top command and also my measure of general cpu usage of my server has gone up a lot.

@hMsats indeed it would. A better approach would be 008d9ac, which you can try until that patch gets merged.

@andrewtoth Thanks a lot. EPS is working fine now, without the high cpu usage! I switched to adding deprecatedrpc=fees to bitcoin.conf but have removed that now. Electrum connected only to my EPS server is also working.