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

using Concurrency in EsploraConfig resulting in errors #378

Open
BitcoinZavior opened this issue Jun 20, 2023 · 4 comments
Open

using Concurrency in EsploraConfig resulting in errors #378

BitcoinZavior opened this issue Jun 20, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@BitcoinZavior
Copy link

BitcoinZavior commented Jun 20, 2023

Describe the bug

Using concurrency value of more than 2 for EsploraConfig is resulting in following errors:

  1. failed to lookup address information: nodename nor servname provided, or not known
  2. timed out reading response
  3. tls connection init failed / AlertReceived(HandshakeFailure)
  4. ConnectionAborted / Software caused connection abort

Issue orginally raised for bdk-rn: LtbLightning/bdk-rn#51

To Reproduce

Initialise a EsploraConfig with a concurrency value of more than 2
Use the EsploraConfig to initialise a Blockchain object
User the Blockchain object to sync a wallet

Expected behavior

The sync should be faster when using a higher concurrency value and no result in errors

Build environment
bdk kotlin and bdk swift

This might be a possible cause: https://stackoverflow.com/questions/69732481/strange-error-when-multithreading-downloads-in-rust#comment123259499_69732481

@BitcoinZavior BitcoinZavior added the bug Something isn't working label Jun 20, 2023
@Czino
Copy link

Czino commented Jun 28, 2023

I'd like to add that even after changing concurrency to 1

Most of these errors still occur (albeit less frequently)

  1. failed to lookup address information: nodename nor servname provided, or not known
  2. timed out reading response
  3. failed to lookup address information: No address associated with hostname
  4. ConnectionAborted / Software caused connection abort

@thunderbiscuit
Copy link
Member

thunderbiscuit commented Jun 30, 2023

Weird. It looks like this would be Rust related because the ffi layer simply passes those options along to the Rust library without (as far as I can tell) transforming them or applying any kind of logic.

Do you get the same errors when leaving the value as null? (the config should default to 4)

@Czino
Copy link

Czino commented Jul 3, 2023

That's hard to test, because I don't get these errors locally but on production for our users. My phones seem to be unaffected from seeing these kind of errors, so I cannot inspect it for myself.

What I can tell you is that when I changed the concurrency from 5 to 1, the error rate lessened.

@Czino
Copy link

Czino commented Jul 3, 2023

Also worth mentioning, we are currently using the REST API instead of RPC because our server is behind cloudflare that does not forward RPC calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants