trezor / trezor-suite

Trezor Suite Monorepo
https://trezor.io/trezor-suite
Other
705 stars 248 forks source link

Workaround for lack of json-rpc batching support in Electrum Personal Server #10387

Closed mcjoojar closed 9 months ago

mcjoojar commented 9 months ago

Describe the bug Trezor Suite gets stuck indefinitely on checking balances when using Electrum Personal Server ("EPS") backend. Looking over the EPS logs, this appears to be because Trezor Suite is using json-rpc batching, which is not supported by EPS

Info:

How to reproduce

  1. Setup EPS
  2. Configure Trezor Suite to use the EPS that was set up in 1
  3. Connect Trezor Model T

Expected behavior Balances are checked successfully and show in the Trezor Suite UI in the usual way

Screenshots n/a

Additional context EPS has an open issue for lack of support for json-rpc batching: https://github.com/chris-belcher/electrum-personal-server/issues/186

However, it doesn't seem like it will be fixed any time soon, so how about a workaround along similar lines to the one described in the thread for Blue wallet? Blue wallet works well with my EPS server, presumably thanks to this workaround.

mroz22 commented 9 months ago

Is it some specific setup of electrum backend?

Maybe @marekrjpolak can comment on this.

mcjoojar commented 9 months ago

Is it some specific setup of electrum backend?

Yes, it is a canonical install of Electrum Personal Server (EPS) on Ubuntu. Here is EPS: https://github.com/chris-belcher/electrum-personal-server

The root cause is that EPS does not support json-rpc batching, and is not likely to any time soon - full details here: https://github.com/chris-belcher/electrum-personal-server/issues/186

marekrjpolak commented 9 months ago

Yeah, I've implemented json-rpc batching as a default. Currently it cannot be turned off with a param, but it should be relatively simple to add it. The question is whether this BlueWallet's heuristics is sufficient (electrs currently supports batching): https://github.com/BlueWallet/BlueWallet/pull/940/files#diff-40c0cccbe75c88e8db6d83e684deb07c172cd6702e9e2ab6392014fed76015c3R64-R67

mcjoojar commented 9 months ago

Yeah, I've implemented json-rpc batching as a default. Currently it cannot be turned off with a param, but it should be relatively simple to add it. The question is whether this BlueWallet's heuristics is sufficient (electrs currently supports batching): https://github.com/BlueWallet/BlueWallet/pull/940/files#diff-40c0cccbe75c88e8db6d83e684deb07c172cd6702e9e2ab6392014fed76015c3R64-R67

If not, what about exposing EPS as its own backend type, so the user explicitly chooses EPS (which turns off batching)?

bosomt commented 9 months ago

QA OK

sent,bumped, finalized via electrum.corp.sldev.cz:50001:t

Info: