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

Implement ping/pong messages parsing and processing #430

Closed
roman-khimov opened this issue Oct 17, 2019 · 1 comment · Fixed by #456
Closed

Implement ping/pong messages parsing and processing #430

roman-khimov opened this issue Oct 17, 2019 · 1 comment · Fixed by #456
Assignees
Labels
feature Completely new functionality network P2P layer
Milestone

Comments

@roman-khimov
Copy link
Member

We don't currently support ping/pong functionality.

@roman-khimov roman-khimov added feature Completely new functionality protocol labels Oct 17, 2019
@roman-khimov roman-khimov added this to the v0.60.0 milestone Oct 17, 2019
@roman-khimov roman-khimov modified the milestones: v0.60.0, v0.61.0, v0.62.0 Oct 25, 2019
This was referenced Oct 27, 2019
@roman-khimov
Copy link
Member Author

BTW, C# guys now really do use pings for something real: neo-project/neo#1024

@roman-khimov roman-khimov modified the milestones: v0.70.0, v0.71.0 Nov 27, 2019
@roman-khimov roman-khimov modified the milestones: v0.71.0, v0.72.0 Dec 30, 2019
roman-khimov added a commit that referenced this issue Jan 20, 2020
It makes to sense to do both actions, pings are made for a different purpose.

Relates to #430.
roman-khimov added a commit that referenced this issue Jan 20, 2020
In reality it will never be true exactly in the case where we want this ping
mechanism to work --- when the node failed to get a block from the net. It
won't get the header either and thus its block height will be equal to header
height. The only moment when this condition is met is when the node does
initial synchronization and this synchronization works just fine without any
pings.

Relates to #430.
roman-khimov added a commit that referenced this issue Jan 20, 2020
We don't and we won't have synchronized clocks in the network so the only
timestamp that we can compare our local time with is the one made
ourselves. What this ping mechanism is used for is to recover from missing the
block broadcast, thus it's appropriate for it to trigger after X seconds of
the local time since the last block received.

Relates to #430.
roman-khimov added a commit that referenced this issue Jan 20, 2020
1) Make timeout a timeout, don't do magic ping counts.
2) Drop additional timer from the main peer's protocol loop, create it
   dynamically and make it disconnect the peer.
3) Don't expose the ping counter to the outside, handle more logic inside the
   Peer.

Relates to #430.
@roman-khimov roman-khimov added network P2P layer and removed protocol labels Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Completely new functionality network P2P layer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants