-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
peer_state: Robust state machine transitions (#251)
This PR refactors the peer state. Previously the `AddressStore` and `PeerState` where intertwined. The `AddressStore` contained an optional `ConnectionID`, while the `PeerState` states contained a mandatory score. This PR separates the address store and the peer state, while moving the logic of the peer state transitioning to a separate module. While at it, have added documentation and testing for state machine transitions. Changes include: - Secondary connection from the PeerContext is merged into the `PeerState` - Connection Ids are removed from the Address Store - Transport manager is refactored to use the new state machine, this keeps a minimal code around in the manager ### Testing Done - added extra tests to the peer state - tested with subp2p-explorer for discovering kusama This builds upon #250 for a bigger refactor effort to track addresses in a healthier Aims at improving: - #239 - #238 - #237 --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Dmitry Markin <[email protected]>
- Loading branch information
1 parent
2ef3751
commit f112b59
Showing
5 changed files
with
1,416 additions
and
1,147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.