rust-electrum-client
rust-electrum-client copied to clipboard
Breaking change in ElectrumX >= 1.16
It looks like they've changed the result for blockchain.headers.subscribe in the newer versions of ElectrumX, even though their docs still has the old reply documented, at least as of today.
electrs-esplora 0.4.1 (which is compatible with ElectrumX 1.15 and below):
[2021-07-12T13:13:36Z TRACE electrum_client::raw_client] ==> {"jsonrpc":"2.0","id":0,"method":"blockchain.headers.subscribe","params":[]}
[2021-07-12T13:13:36Z TRACE electrum_client::raw_client] Starting reader thread with `until_message` = Some(0)
[2021-07-12T13:13:37Z TRACE electrum_client::raw_client] <== {"id":0,"jsonrpc":"2.0","result":{"height":2033460,"hex":"0000c02012e830c5814d6bad557df5f76e2a0efcc0965e28566c1f76640000000000000003bb83b6663643a71bb9637ef80478d2e806186a2d9404ce035ad89d68896c5c343fec60ffff001a31d8c223"}}
ElectrumX 1.16.0
[2021-07-12T13:13:59Z TRACE electrum_client::raw_client] ==> {"jsonrpc":"2.0","id":0,"method":"blockchain.headers.subscribe","params":[]}
[2021-07-12T13:13:59Z TRACE electrum_client::raw_client] Starting reader thread with `until_message` = Some(0)
[2021-07-12T13:14:00Z TRACE electrum_client::raw_client] <== {"jsonrpc": "2.0", "result": 1, "id": 0}
Turns out this only happens with one specific server: testnet.aranguren.org:51001. The server reports a version ["ElectrumX 1.16.0","1.4"], but other servers with the same exact reported version work fine..
Not sure what's going on, I know there are a couple of forks of ElectrumX around, maybe there's a bad one somewhere but we have no way of detecting it just by the reported version.
I'll keep this open in case somebody else stumbles upon this, but at least it's not as bad as I thought it was.