Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Improve rendezvous protocol usage (#399)
# Description This pull request implements the following features: - [x] Add event handler cache implementation - [x] Renew rendezvous registration at expiration - [x] Re-discover from rendezvous servers on a set interval - [x] Renew discovered peer registrations when they expire - [x] Remove behavior where we add other peers to `external_addresses` - [x] Add check to not dial ourselves on rendezvous discovery - [x] Update dialing on rendezvous discovery to only dial peers we aren't already connected to - [x] Add rendezvous server `Dialing`, `PeerRegistered`, and `RegistrationExpired` event debug logs - [x] Separate `enable_rendezvous` config into `enable_rendezvous_server` and `enable_rendezvous_client` configs (server is opt-in, client is opt-out) - [x] Add `max_connected_peers` config - [x] Add `rendezvous_registration_ttl` and `rendezvous_discovery_interval` configs - [x] Test rendezvous register, discover, and connect - [x] Test disconnect after rendezvous connect - [x] Test registration expires and re-registration on expiration - [x] Test discovered registration expires and rediscovery attempted at expiration - [x] Test rediscovery on rendezvous discovery interval - [x] Add `extract_timestamps_where` and `count_lines_where` test utilities - [x] Update libp2p deprecated Kademlia and SwarmBuilder interfaces - [x] Update integration test fixtures to avoid overlapping ports ## Link to issue Implements #131. ## Type of change - [x] New feature (non-breaking change that adds functionality) - [x] Refactor (non-breaking change that updates existing functionality) - [x] Comments have been added/updated ## Test plan (required) We are adding tests to check existing functionality and a test to check registration renewals. --------- Co-authored-by: Zeeshan Lakhani <zeeshan.lakhani@gmail.com>
- Loading branch information