Direct Peers : Gossipsub V1.1 (#594)

* added basic structure for direct peers

* added direct connect heartbeat

* added logic to reject GRAFT from direct peers

* added invocation of direct_connect_heartbeat

* updated _get_peers_to_send to include direct peers

* fixed failing gossipsub core and demo tests

* fixed failing test_examples.py

* add tests for peer management

* fix lint

* update tests

* fixed direct_peers type and peer_records test

* fixed failing gossipsub direct peers test

* added reject graft test

* updated reconnection test

* added newsfragment

* improved reject graft test

* updated default value for direct peers

* renamed direct_connect_init_delay parameter

* reverted back to direct_connect_initial_delay param name

---------

Co-authored-by: Khwahish Patel <khwahish.p1@ahduni.edu.in>
This commit is contained in:
Mystical
2025-05-20 19:01:57 +05:30
committed by GitHub
parent 5b40e2551d
commit 4a53fc3111
8 changed files with 260 additions and 2 deletions

View File

@ -136,6 +136,7 @@ async def run(topic: str, destination: Optional[str], port: Optional[int]) -> No
degree=3, # Number of peers to maintain in mesh
degree_low=2, # Lower bound for mesh peers
degree_high=4, # Upper bound for mesh peers
direct_peers=None, # Direct peers
time_to_live=60, # TTL for message cache in seconds
gossip_window=2, # Smaller window for faster gossip
gossip_history=5, # Keep more history