Bump nim-eth module and add async raises for eth2 discovery (#6344)

This commit is contained in:
Kim De Mey 2024-06-11 19:50:08 +02:00 committed by GitHub
parent 77d926525f
commit 741075aada
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -127,7 +127,7 @@ proc queryRandom*(
forkId: ENRForkID,
wantedAttnets: AttnetBits,
wantedSyncnets: SyncnetBits,
minScore: int): Future[seq[Node]] {.async.} =
minScore: int): Future[seq[Node]] {.async: (raises: [CancelledError]).} =
## Perform a discovery query for a random target
## (forkId) and matching at least one of the attestation subnets.
@ -143,7 +143,7 @@ proc queryRandom*(
peerForkId =
try:
SSZ.decode(eth2FieldBytes, ENRForkID)
except SszError as e:
except SerializationError as e:
debug "Could not decode the eth2 field of peer",
peer = n.record.toURI(), exception = e.name, msg = e.msg
continue
@ -156,7 +156,7 @@ proc queryRandom*(
let attnetsNode =
try:
SSZ.decode(attnetsBytes.get(), AttnetBits)
except SszError as e:
except SerializationError as e:
debug "Could not decode the attnets ERN bitfield of peer",
peer = n.record.toURI(), exception = e.name, msg = e.msg
continue
@ -170,7 +170,7 @@ proc queryRandom*(
let syncnetsNode =
try:
SSZ.decode(syncnetsBytes.get(), SyncnetBits)
except SszError as e:
except SerializationError as e:
debug "Could not decode the syncnets ENR bitfield of peer",
peer = n.record.toURI(), exception = e.name, msg = e.msg
continue

View File

@ -1550,7 +1550,7 @@ proc getLowSubnets(node: Eth2Node, epoch: Epoch): (AttnetBits, SyncnetBits) =
default(SyncnetBits)
)
proc runDiscoveryLoop(node: Eth2Node) {.async.} =
proc runDiscoveryLoop(node: Eth2Node) {.async: (raises: [CancelledError]).} =
debug "Starting discovery loop"
while true:

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit c482b4c5b658a77cc96b49d4a397aa6d98472ac7
Subproject commit c3f9160fd23010f65b1d4756cfd5c04272c20264