Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New networking API #1312

Merged
merged 34 commits into from Oct 11, 2019

Conversation

@mfornet
Copy link
Collaborator

mfornet commented Sep 13, 2019

  • Adding edge on handshake.
  • Broadcasting edges / other messages.
  • Sync network view.

Continue in #1379

  • Remove edge.
  • Routing Messages. (Missing tests). Needs to refactor messages which are routed, from message which are directed. Also make clear distinction from message that are relevant for networking and messages that should be handled by client.
  • If we receive an edge about us, but this is not an active peer, broadcast edge removal.
@mfornet mfornet force-pushed the networking branch from 6997fcc to 1986754 Sep 16, 2019
@coqbot coqbot removed the needs: rebase label Sep 19, 2019
@mfornet mfornet marked this pull request as ready for review Sep 19, 2019
@mfornet mfornet changed the title WIP: New networking API New networking API Sep 19, 2019
chain/client/src/client.rs Outdated Show resolved Hide resolved
chain/client/src/client.rs Outdated Show resolved Hide resolved
chain/network/src/routing.rs Outdated Show resolved Hide resolved
chain/client/src/client.rs Outdated Show resolved Hide resolved
chain/network/src/peer_manager.rs Outdated Show resolved Hide resolved
chain/network/src/routing.rs Outdated Show resolved Hide resolved
pub fn remove_edge(&mut self, peer0: &PeerId, peer1: &PeerId) {
if self.contains_edge(&peer0, &peer1) {
self.remove_directed_edge(&peer0, &peer1);
self.remove_directed_edge(&peer1, &peer0);

This comment has been minimized.

Copy link
@SkidanovAlex

SkidanovAlex Sep 24, 2019

Member

Either check contains_edge for both, or for none?
It's weird to check the existence of the edge in one direction but to remove from both.

This comment has been minimized.

Copy link
@mfornet

mfornet Sep 25, 2019

Author Collaborator

But it is an undirected graph

chain/network/src/routing.rs Show resolved Hide resolved
chain/network/src/routing.rs Show resolved Hide resolved
mfornet added 2 commits Sep 25, 2019
- Tests for network primitive behaviors
- Ping/Pong message skeleton for test routing
- Handshake update to take into account signing new edge
Now new edges are created during handshake. Signatures
exchange happens in this phase.
Simple test is passing.
@mfornet mfornet referenced this pull request Sep 28, 2019
3 of 9 tasks complete
Fix banning from PeerManager/Peer.
@mfornet mfornet referenced this pull request Sep 28, 2019
mfornet added 2 commits Sep 28, 2019
Remove useless genesis check (it was repeated).
@mfornet mfornet referenced this pull request Sep 30, 2019
4 of 7 tasks complete
mfornet added 2 commits Sep 30, 2019
mfornet added 7 commits Oct 1, 2019
@mfornet mfornet force-pushed the networking branch from 09b95c3 to d527726 Oct 10, 2019
benches,
calculate_distance_3_3,
calculate_distance_10_10,
// calculate_distance_100_100,

This comment has been minimized.

Copy link
@bowenwang1996

bowenwang1996 Oct 10, 2019

Member

why is this commented out?

This comment has been minimized.

Copy link
@mfornet

mfornet Oct 10, 2019

Author Collaborator

It is too slow yet, that is in my list of performance optimization.

@mfornet mfornet force-pushed the networking branch from 2558b41 to 6f6aa46 Oct 10, 2019
mfornet added 2 commits Oct 11, 2019
@mfornet mfornet merged commit 16159be into staging Oct 11, 2019
1 check passed
1 check passed
gitlab-ci
Details
Kouprin added a commit that referenced this pull request Oct 17, 2019
* Extract routing table out of peer manager

* Build Routing Table interface

* WIP Build new networking API.

Making compiler not complain.

* Fix compiler error

* Add announce account through broadcast

* Implement basic api off Routing Table

* All check

* Add tests and benchmark for graph

* Remove hash from `sign_announce_account`

* Addressing format issues

* WIP: Add network syncing

- Tests for network primitive behaviors
- Ping/Pong message skeleton for test routing
- Handshake update to take into account signing new edge

* Update handshake

Now new edges are created during handshake. Signatures
exchange happens in this phase.
Simple test is passing.

* Add broadcast and sync.

Fix banning from PeerManager/Peer.

* Track all TODO(MarX) in github.

Remove useless genesis check (it was repeated).

* Fix compile error and warnings.

* Dummy commit

* Address PR comments

* Increase test time

* Use implemented empty key

* Increase test time

* Fix peer_handshake test

* Remove ASD comments

* Clean routing table with empty entries

* Remove some logging

* Increase time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.