Bumps for chronos, nim-eth and unittest2 and future callback fixes

This commit is contained in:
kdeme 2024-01-19 13:35:15 +01:00
parent 36dd297331
commit 9875eb11d6
No known key found for this signature in database
GPG Key ID: 4E8DD21420AF43F5
5 changed files with 10 additions and 8 deletions

View File

@ -203,7 +203,7 @@ proc findPeersAndMakeSomeCalls[R](peerPool: PeerPool, protocolName: string, prot
# info("AARDVARK: peer does not support protocol", protocolName, peer)
if attempts.len == 0:
warn("AARDVARK: findPeersAndMakeSomeCalls did not find any peers; waiting and trying again", protocolName, totalPeerPoolSize=peerPool.connectedNodes.len)
await sleepAsync(5000)
await sleepAsync(chronos.seconds(5))
else:
if attempts.len < maxNumberOfPeersToAttempt:
warn("AARDVARK: findPeersAndMakeSomeCalls did not find enough peers, but found some", protocolName, totalPeerPoolSize=peerPool.connectedNodes.len, found=attempts.len)

View File

@ -1,5 +1,5 @@
# nim-eth
# Copyright (c) 2018-2022 Status Research & Development GmbH
# Nimbus
# Copyright (c) 2018-2024 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at
# https://opensource.org/licenses/MIT).
@ -875,13 +875,14 @@ proc startSyncWithPeer(ctx: LegacySyncRef, peer: Peer) =
ctx.busyPeers.incl(peer)
let f = ctx.startSyncWithPeerImpl(peer)
f.callback = proc(data: pointer) {.gcsafe.} =
let cb = proc(data: pointer) {.gcsafe.} =
if f.failed:
if f.error of TransportError:
debug "Transport got closed during startSyncWithPeer"
else:
error "startSyncWithPeer failed", msg = f.readError.msg, peer
ctx.busyPeers.excl(peer)
f.addCallback(cb)
asyncSpawn f
except TransportError:
@ -895,13 +896,14 @@ proc startObtainBlocks(ctx: LegacySyncRef, peer: Peer) =
ctx.busyPeers.incl(peer)
let f = ctx.obtainBlocksFromPeer(peer)
f.callback = proc(data: pointer) {.gcsafe.} =
let cb = proc(data: pointer) {.gcsafe.} =
if f.failed:
if f.error of TransportError:
debug "Transport got closed during startObtainBlocks"
else:
error "startObtainBlocks failed", msg = f.readError.msg, peer
ctx.busyPeers.excl(peer)
f.addCallback(cb)
asyncSpawn f
except TransportError:

2
vendor/nim-chronos vendored

@ -1 +1 @@
Subproject commit 92acf68b04070dfe8eb65bab71fbf63804979a16
Subproject commit 3ca2c5e6b510c15ce88c94ed25731b30f7ad46b5

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit cbcd1fd307fe997189a3ee5580641955356856bf
Subproject commit 2c6049b1266a7739f4dca86da4e8c65b75797195

@ -1 +1 @@
Subproject commit 883c7a50ad3b82158e64d074c5578fe33ab3c452
Subproject commit 262b697f38d6b6f1e7462d3b3ab81d79b894e336