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

Improve connection speed/reliability and add more logging around connections #2550

Draft
wants to merge 48 commits into
base: develop
Choose a base branch
from

Conversation

islathehut
Copy link
Collaborator

This should make connecting to new peers, especially when opening the app or resuming the app (iOS), noticeably faster with fewer errors when connecting to peers that are online.

  • Wait to dial peers until we know tor is fully bootstrapped
  • Deduplicate tasks in processInChunksService to avoid clutter
  • Reduce the number of parallel dials on libp2p
  • Update some timeouts/ping intervals and use doPX on libp2p connection manager (PX allows peers to share peer information with each other)
  • Update tor config and actually use the numentryguards setting on desktop and mobile
  • Add more logging internally and on libp2p packages

Pull Request Checklist

  • I have linked this PR to a related GitHub issue.
  • I have added a description of the change (and Github issue number, if any) to the root CHANGELOG.md.

(Optional) Mobile checklist

Please ensure you completed the following checks if you did any changes to the mobile package:

  • I have run e2e tests for mobile
  • I have updated base screenshots for visual regression tests

Isla Koenigsknecht and others added 30 commits April 4, 2024 11:57
#2334) (#2400)

* Fix issue with users joining a community where the general channel was deleted while they were offline

* Update e2e tests to include case for this bug

* Update CHANGELOG.md
 - @quiet/desktop@2.2.0-alpha.0
 - @quiet/mobile@2.2.0-alpha.0
When using backend data directories like `Quietdev`, `Quietdev1`, `Quietdev2',
restarting the process using `Quietdev` can result in that process killing the
other backend processes due to the grep command used for finding hanging
processes. Example:

```
user (Quietdev1):
desktop:main:main Forked backend, PID: 214543

owner (Quietdev):
Found 1 hanging backend process(es) with pid(s) 214543. Killing...
```
iOS appears to not be syncing correctly after resuming from suspend.
It looks like this is due to the libp2p auto-dialler getting stuck
connecting to the Tor HTTP tunnel port which is replaced after
suspend/resume. This commit enables the WebsocketOverTor transport to
use the `dialTimeout` correctly. But still this means the current
dialer waits for `dialTimeout` to try another peer, and we currently
have `dialTimeout` set to 2 minutes. Ideally, we can find a better
approach for closing any sockets when suspending the app or detecting
when we are trying to connect to a port that nothing is listening on,
if that's possible.
* Better peer sorting and updated initial diallng

* Update tests
 - @quiet/desktop@2.2.0-alpha.1
 - @quiet/mobile@2.2.0-alpha.1
 - @quiet/desktop@2.2.0-alpha.2
 - @quiet/mobile@2.2.0-alpha.2
* Fix issue of duplicate CRSs being generated

* Install LFS with checkout to avoid random errors
Fixes for the following issues:
- Peers can be deleted if CSRs don't sync
- Backend starting before the frontend is ready, resulting in missed events
- Adding duplicate CSRs
 - @quiet/desktop@2.2.0-alpha.3
 - @quiet/mobile@2.2.0-alpha.3
* fix: start websocket connection on react init

* chore: restore self hosted ios e2e tests

* fix: prevent stripping hermes framework

* Revert "fix: prevent stripping hermes framework"

This reverts commit 65dfec8.

* chore: skip self-hosted ios e2e tests
* Fix issue with connecting on resume on ios

* Update changelogs
* chore: start own metro

* chore: comment out restore connection saga usage

* chore: repeat websocket connection tries on android

* chore: update pods

* chore: increase action timeout

* fix: always stop metro

* chore: limit intervals

* chore: enlarge intervals

* fix: use callback on react app init

* chore: remove redundand sagas

* fix: move app_ready event

* test: mock native modules
* Extra logging, blocking actions and random UX error fix

* Some more changes

* Add more logs

* Connect to tor when we should and update peers on connect

* Redial when tor is fully ready

* More logs, spawn hidden services early again, better hang up and mild refactor of tor

* PR fixes

* More fixes

* Small fix

* Fix tests

* Fix setup environment on mac in ci

* Fix mac e2e filename

* Update e2e-mac.yml

* Update e2e-mac.yml

* Comment fix and better redial on resume

* Add back fix I accidentally removed

* Don't redial on tor initialization

* Update .detoxrc.js

* Revert "Update .detoxrc.js"

This reverts commit 9290f25.
 - @quiet/desktop@2.2.0-alpha.4
 - @quiet/mobile@2.2.0-alpha.4
Isla Koenigsknecht and others added 18 commits May 9, 2024 09:40
* macos-latest -> macos-12 (#2482)

* fix: use explicit macos-12 image instead of macos-latest ('-latest' image was updated to macos-14)

* Update e2e-mac.yml

* Run e2e on e2e changes

---------

Co-authored-by: breadhunter <6099829+EmiM@users.noreply.github.com>
* Process queue fixes and updates

* Remove unnecessary log

* Log when we push to queue
 - @quiet/desktop@2.2.0-alpha.5
 - @quiet/mobile@2.2.0-alpha.5
 - @quiet/desktop@2.2.0-alpha.6
 - @quiet/mobile@2.2.0-alpha.6
…te queue, don't dial if the peer is in the peerstore
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

Successfully merging this pull request may close these issues.

2 participants