fix(libp2p): Updating nim-libp2p to fix the wss connectivity issue (#1848)

* Updating nim-libp2p to fix the `wss` connectivity issue

* The `nim-libp2p` adds many changes although we are actually interested
in the latest commit:

> wstransport.nim: avoid re-raising 'TransportOsError' to avoid stopping
`switch.accept` (#929)

* The `nim-stew` bump is needed so that the `nim-libp2p` can compile.

* The changes in `waku_node.nim` are needed due to the changes in
`nim-stew`.

* waku_node.nim: returning a "completed" future within 'statusAndConfidenceHandler'

  This is aimed to avoid the next exception happening in the wakunode:

  ```
  Unhandled defect: Async procedure (service.nim(74)    callHandler)
  yielded `nil`, are you await'ing a `nil` Future? [AssertionDefect]
  ```

  * Adding 'async' to 'statusAndConfidenceHandler' so that it properly returns a Future[void]
This commit is contained in:
Ivan Folgueira Bande 2023-07-13 18:00:55 +02:00 committed by GitHub
parent 3fe4522a7e
commit 1d3410c7bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

2
vendor/nim-libp2p vendored

@ -1 +1 @@
Subproject commit 224f92e17251464984d6906316c54d2e1108ae43
Subproject commit 74c402ed9db4652a455c00c8d1713b222e3ef3d5

2
vendor/nim-stew vendored

@ -1 +1 @@
Subproject commit e18f5a62af2ade7a1fd1d39635d4e04d944def08
Subproject commit 6c97f11c7cb59eadf91b124b92d2ec035f7251fa

View File

@ -113,13 +113,15 @@ proc getAutonatService*(rng: ref HmacDrbgContext): AutonatService =
let autonatService = AutonatService.new(
autonatClient = AutonatClient.new(),
rng = rng,
scheduleInterval = some(chronos.seconds(120)),
scheduleInterval = Opt.some(chronos.seconds(120)),
askNewConnectedPeers = false,
numPeersToAsk = 3,
maxQueueSize = 3,
minConfidence = 0.7)
proc statusAndConfidenceHandler(networkReachability: NetworkReachability, confidence: Option[float]) {.gcsafe, async.} =
proc statusAndConfidenceHandler(networkReachability: NetworkReachability,
confidence: Opt[float]):
Future[void] {.gcsafe, async.} =
if confidence.isSome():
info "Peer reachability status", networkReachability=networkReachability, confidence=confidence.get()