Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electrum queries are inefficient, may produce server bans #865

Open
icy-ux opened this issue Dec 10, 2021 · 5 comments
Open

Electrum queries are inefficient, may produce server bans #865

icy-ux opened this issue Dec 10, 2021 · 5 comments

Comments

@icy-ux
Copy link
Contributor

icy-ux commented Dec 10, 2021

Queries to the electrum server are done in an inefficient way. When using an electrs locally hosted back end, the following log messages are produced:
your wallet uses less efficient method of querying electrs, consider contacting the developer of your wallet. Reason: blockchain.scripthash.get_history called for unsubscribed scripthash: c28a[......]

This may be related to #797 where the (public) electrum server rejects our requests, probably to avoid DoS attacks.

@icy-ux
Copy link
Contributor Author

icy-ux commented Dec 10, 2021

After several tries, I managed to do a successful swap between a local asb instance and my local client only when both asb and swap were using my local electrs server.

When either or both asb and swap were using the default public Electrum server, the swap errored out at one or the other point, with the CloseNotify issue discussed in #797

@rishflab
Copy link
Member

rishflab commented Dec 13, 2021

Thanks for writing up the issue.

I have not looked into this deeply but It seems like there has been changes to electrum, this is the first time I have seen this message. When we implemented this we put a fair bit of work in making the queries efficient as we were triggering DDoS protection.

We are happy to accept a PR on this and happy to provide guidance. Alternatively running a local electrum server might be the best way to go for now.

@icy-ux
Copy link
Contributor Author

icy-ux commented Dec 15, 2021 via email

@binarybaron
Copy link
Collaborator

I analyzed the outgoing traffic of the Bob and the Cli is making tons of blockchain.scripthash.get_history calls to the electrum server. We may need to replace that with a subscription.

{"method":"blockchain.scripthash.get_history","params":["71fc8007a74346f8d3f8748936857173e2d3bd74fbbd8d52951c347863a5bad2"],"id":2693}

@delta1
Copy link
Collaborator

delta1 commented Jun 30, 2022

Some info here too

bitcoindevkit/bdk#618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants