Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
20b1f53
raptorq, overlay fec, overlay broadcasts handlers
yungwine Feb 24, 2024
3663409
add fec bcst creating, wip shard overlay
yungwine Mar 1, 2024
440ef59
bugfix
yungwine Mar 1, 2024
1e18ec2
Merge branch 'master' into rldp
yungwine Mar 1, 2024
5a0bdb8
fix curcular import
yungwine Mar 1, 2024
b942338
Merge remote-tracking branch 'origin/rldp' into rldp
yungwine Mar 1, 2024
c926f06
fix circular import
yungwine Mar 1, 2024
90efa09
fix overlay max peers
yungwine Mar 6, 2024
217343c
add broadcasts garbage collection
yungwine Mar 7, 2024
22d46dc
increase packets queue limit
yungwine Mar 13, 2024
4253f75
add adnl connection support
yungwine Apr 2, 2024
c8130a4
bugfix
yungwine Apr 7, 2024
3ca1fa9
Merge branch 'rldp' into patch
yungwine May 21, 2024
e8cc079
Merge pull request #25 from yungwine/patch
yungwine May 21, 2024
e38189a
fix OverlayManager
yungwine May 22, 2024
815cf63
fix connection to multiple peers
yungwine May 28, 2024
125c548
change log level
yungwine May 29, 2024
dc542b2
improve adnl peers pings
yungwine Jun 3, 2024
58ee30a
improve liteclient and balancer network stability
yungwine Jun 8, 2024
ab152bc
Merge branch 'master' into rldp
yungwine Jun 8, 2024
3e2db84
fix liteclient closing when peer dead
yungwine Jun 9, 2024
5ab00cf
Merge branch 'master' into rldp
yungwine Jun 9, 2024
99c9267
fix peer connection handling
yungwine Jun 10, 2024
599e3df
fix adnl peer disconnecting
yungwine Jun 11, 2024
c82d245
fix liteclient closing
yungwine Jun 12, 2024
cfba4a1
adnl optimizations
yungwine Jun 13, 2024
fb99550
overlay fix
yungwine Jun 13, 2024
e3e98be
make getting new peers more soft
yungwine Jun 13, 2024
08c451c
change log level
yungwine Jun 13, 2024
1df183b
move processing packet to separate method
yungwine Jun 15, 2024
74b3d44
do not raise error in udp client
yungwine Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
265 changes: 198 additions & 67 deletions pytoniq/adnl/adnl.py

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions pytoniq/adnl/dht.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
from pytoniq_core.tl import TlGenerator

from .adnl import Node, AdnlTransport
from .overlay import OverlayNode, OverlayTransport
from .overlay.overlay import OverlayNode, OverlayTransport


_default_tl_schemas = TlGenerator.with_default_schemas().generate()


class DhtError(Exception):
Expand Down Expand Up @@ -50,8 +53,7 @@ def from_dict(cls, transport: AdnlTransport, data: dict, check_signature=True) -

# check signature
if check_signature:
schemas = TlGenerator.with_default_schemas().generate()
signed_message = schemas.serialize(schema=schemas.get_by_name('dht.node'), data=data)
signed_message = _default_tl_schemas.serialize(schema=_default_tl_schemas.get_by_name('dht.node'), data=data)
if not verify_sign(pub_k, signed_message, signature):
raise Exception('invalid node signature!')

Expand Down Expand Up @@ -125,6 +127,8 @@ async def find_value(self, key: bytes, k: int = 6, timeout: int = 10):
await asyncio.wait_for(node.connect(), 1)
except asyncio.TimeoutError:
continue
except Exception:
continue
try:
resp = await node.find_value(key=key, k=k)
except asyncio.exceptions.TimeoutError:
Expand Down Expand Up @@ -256,8 +260,9 @@ async def get_overlay_node(self, node: dict, overlay_transport: OverlayTransport
port = node_addr['port']
pub_k = base64.b64encode(bytes.fromhex(resp['value']['key']['id']['key'])).decode()

node = OverlayNode(peer_host=host, peer_port=port, peer_pub_key=pub_k, transport=overlay_transport)
return node
onode = OverlayNode(peer_host=host, peer_port=port, peer_pub_key=pub_k, transport=overlay_transport)
onode.add_params(node['signature'], node['version'])
return onode

@classmethod
def from_config(cls, config: dict, adnl_transport: AdnlTransport):
Expand Down
227 changes: 0 additions & 227 deletions pytoniq/adnl/overlay.py

This file was deleted.

5 changes: 5 additions & 0 deletions pytoniq/adnl/overlay/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .overlay import OverlayTransport, OverlayNode, OverlayTransportError
from .broadcast import BroadcastSimple, InvalidBroadcast
from .fec_broadcast import BroadcastFecPart, BroadcastFec, InvalidBroadcastFec, create_fec_broadcast
from .overlay_manager import OverlayManager
from .shard_overlay import ShardOverlay
Loading