simplification of peerset api (#2123)
* Introduction of PeersetHandle * integrate PeersetHandle with the rest of the codebase * fix compilation errors * more tests for peerset, fixed overwriting bug in add_reserved_peer * Slots data structure and bugfixes for peerset * bend to pressure * updated lru-cache to 0.1.2 and updated linked-hash-map to 0.5.2 * peerset discovered list is now a LinkedHashMap * fix review suggestions * split back Peerset and PeersetHandle * test for Peerset::discovered * applied review suggestions * fixes to peerset::incoming * peerset disconnects are all instantaneous * instantaneous drop in peerset finished * Peerset::set_reserved_only can also reconnect nodes * Peerset scores cache uses lru-cache * remove redundant function call and comment from Peerset::on_set_reserved_only * add_peer returns SlotState enum * apply review suggestions * is_reserved -> is_connected_and_reserved
Showing
- Cargo.lock 129 additions, 131 deletionsCargo.lock
- core/network-libp2p/src/behaviour.rs 1 addition, 1 deletioncore/network-libp2p/src/behaviour.rs
- core/network-libp2p/src/custom_proto/behaviour.rs 8 additions, 8 deletionscore/network-libp2p/src/custom_proto/behaviour.rs
- core/network-libp2p/src/service_task.rs 4 additions, 4 deletionscore/network-libp2p/src/service_task.rs
- core/network/src/service.rs 4 additions, 4 deletionscore/network/src/service.rs
- core/peerset/Cargo.toml 2 additions, 6 deletionscore/peerset/Cargo.toml
- core/peerset/src/lib.rs 560 additions, 146 deletionscore/peerset/src/lib.rs
- core/peerset/src/slots.rs 148 additions, 0 deletionscore/peerset/src/slots.rs
Please register or sign in to comment