mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Compare commits
13 Commits
a0ca284e8f
...
dependency
| Author | SHA1 | Date | |
|---|---|---|---|
| ad63dcf85e | |||
| e9de16a6ae | |||
| b88bc50513 | |||
| 278d6206ab | |||
| 82cda6818c | |||
| 81259f7912 | |||
| f3a3a10251 | |||
| 356192d793 | |||
| 58b33ba2e8 | |||
| 00ba846f7b | |||
| 007527ef75 | |||
| 98438916ad | |||
| 966cef58de |
@ -219,25 +219,11 @@ class CircuitV2Transport(ITransport):
|
|||||||
# Get a relay from the list of discovered relays
|
# Get a relay from the list of discovered relays
|
||||||
relays = self.discovery.get_relays()
|
relays = self.discovery.get_relays()
|
||||||
if relays:
|
if relays:
|
||||||
# Prioritize relays with active reservations
|
# TODO: Implement more sophisticated relay selection
|
||||||
relays_with_reservations = []
|
# For now, just return the first available relay
|
||||||
other_relays = []
|
return relays[0]
|
||||||
|
|
||||||
for relay_id in relays:
|
|
||||||
relay_info = self.discovery.get_relay_info(relay_id)
|
|
||||||
if relay_info and relay_info.has_reservation:
|
|
||||||
relays_with_reservations.append(relay_id)
|
|
||||||
else:
|
|
||||||
other_relays.append(relay_id)
|
|
||||||
|
|
||||||
# Return first available relay with reservation, or fallback to others
|
|
||||||
if relays_with_reservations:
|
|
||||||
return relays_with_reservations[
|
|
||||||
attempts % len(relays_with_reservations)
|
|
||||||
]
|
|
||||||
elif other_relays:
|
|
||||||
return other_relays[attempts % len(other_relays)]
|
|
||||||
|
|
||||||
|
# Wait and try discovery
|
||||||
await trio.sleep(1)
|
await trio.sleep(1)
|
||||||
attempts += 1
|
attempts += 1
|
||||||
|
|
||||||
|
|||||||
1
newsfragments/732.deprecation.rst
Normal file
1
newsfragments/732.deprecation.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
update cryptographic dependencies: pycryptodome to ≥3.19.1, pynacl to ≥1.5.0, coincurve to ≥21.0.0
|
||||||
@ -17,7 +17,7 @@ maintainers = [
|
|||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base58>=1.0.3",
|
"base58>=1.0.3",
|
||||||
"coincurve>=10.0.0",
|
"coincurve>=21.0.0",
|
||||||
"exceptiongroup>=1.2.0; python_version < '3.11'",
|
"exceptiongroup>=1.2.0; python_version < '3.11'",
|
||||||
"grpcio>=1.41.0",
|
"grpcio>=1.41.0",
|
||||||
"lru-dict>=1.1.6",
|
"lru-dict>=1.1.6",
|
||||||
@ -28,7 +28,7 @@ dependencies = [
|
|||||||
"protobuf>=4.25.0,<5.0.0",
|
"protobuf>=4.25.0,<5.0.0",
|
||||||
"pycryptodome>=3.9.2",
|
"pycryptodome>=3.9.2",
|
||||||
"pymultihash>=0.8.2",
|
"pymultihash>=0.8.2",
|
||||||
"pynacl>=1.3.0",
|
"pynacl>=1.5.0",
|
||||||
"rpcudp>=3.0.0",
|
"rpcudp>=3.0.0",
|
||||||
"trio-typing>=0.0.4",
|
"trio-typing>=0.0.4",
|
||||||
"trio>=0.26.0",
|
"trio>=0.26.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user