lightninglabs / neutrino

Privacy-Preserving Bitcoin Light Client
MIT License
894 stars 182 forks source link

neutrino: improve perf in high latency networks #300

Closed djkazic closed 2 months ago

djkazic commented 2 months ago

After working with @hsjoberg and @niteshbalusu11 to troubleshoot Blixt performance we realized two things were consistently going wrong in networks with > around 300ms latency:

  1. Retries would be exhausted quickly
  2. Due to that --^ timeouts being doubled did not help much

After investigating, we decided to experiment with changing some constants in neutrino to work better.

This PR addresses both issues by:

The result is that we can now use Blixt with networks that we could not previously.

djkazic commented 2 months ago

OK, it appears that queryAllPeers breaks the unit test when the numRetries of the defaultQueryOptions struct is > 1.

djkazic commented 2 months ago

Cool, so I fixed the unit test.

Now, the Blixt team will do some testing to make sure that we haven't also rolled back the perf improvements.

djkazic commented 2 months ago

cool LGTM - before the final ✅ though, can you open an LND PR that points to this so that we can just check the CI on that side?

Created here: https://github.com/lightningnetwork/lnd/pull/8797

ellemouton commented 2 months ago

cool thanks - will ACK this once the neutrino test on that side is green

lightninglabs-deploy commented 2 months ago

@djkazic, remember to re-request review from reviewers when ready