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

Update discovery and update time to get latest information - Closes #2073 #2074

Closed
wants to merge 1 commit into from

Conversation

shuse2
Copy link
Member

@shuse2 shuse2 commented May 30, 2018

What was the problem?

Because peer information update only happens for random 100 peers, and only fetching the peer information every 30s, consensus calculation is most likely to be off.
It causes delegates not to be able to forge right away.

How did I fix it?

Revert the increased discovery time to 10s.

How to test it?

Observe update of peers happen every 10s.

Review checklist

@shuse2
Copy link
Member Author

shuse2 commented May 30, 2018

Since we have 10s window for forging, I think changing it to 5s is relevant.

@shuse2 shuse2 changed the base branch from development to 1.0.0-beta.8 May 30, 2018 10:03
@MaciejBaj
Copy link
Contributor

10 sec discovery time will be compatible with the 0.9.* version.
https://github.com/LiskHQ/lisk/blob/master/modules/peers.js#L575

@MaciejBaj
Copy link
Contributor

Please open the similar issue to #1943 which will refer to discovery time directly. We are obtaining to have the transparent flow of changes we've made during Betanet tests.

Copy link
Contributor

@MaciejBaj MaciejBaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please open the corresponding issue.

@4miners
Copy link
Contributor

4miners commented May 30, 2018

The process of updating information about peers, even with changes proposed in this PR - will still be less efficient than in 0.9.x. It's because in 0.9.x with every connection to other peer we also send our headers. In version 1.0.0 we need to make separate call to notify other peers about our headers peer.rpc.updateMyself, as described above we call that only for 100 peers. During peers discovery we're calling peer.rpc.status, which will perform one way (1.0.0) exchange of headers instead of two-way (0.9.x).

So proposed changes:

  • are not consistent with 0.9.x (they cannot be consistent because the way how it works is different)
  • will not fix issue described in What was the problem? section, it can mitigate it - slightly

@MaciejBaj
Copy link
Contributor

@4miners yes, the process of updating information about peers works differently now. The current PR mitigates only the discovery time interval being too big as revealed during Alphanet test rounds - setting it back to 10 sec and reverting changes introduced by #1944.

@jondubois
Copy link
Contributor

jondubois commented May 30, 2018

I think that this should fix the issue with peer headers being out of date (which causes the consensus to be miscalculated) but we still have the deeper issue that currently every node needs to get a status update from every other node in the network every x seconds; this behaviour gets more expensive as more nodes are added to the network.

Also, I'm not sure if updateMyself adds any value to our algorithm. What is the reason for having two different ways of sharing peer headers?

I think that this PR is not harmful and there is a good chance that it will solve our current problem but we should also solve the root issue at some point.

@shuse2
Copy link
Member Author

shuse2 commented May 30, 2018

Created #2076, and changed the closing issue.

As @4miners pointed, even if we change it back to 10s, it will not be the same result as 0.9.x, since protocol is totally different. Also, this is very inefficient and costly.

However, as @jondubois pointed out, I believe this has good chance to "fix" it. but we definitely need to think about the root cause.

Also,

updateMyself adds any value to our algorithm

I think I don't think we have good reason to keep it

@MaciejBaj
Copy link
Contributor

I've opened the issue #2078 that describes the headers propagation problem.

The discovery process is still valid and I think it's important not to change its interval from 10 sec to 30 sec in 1.0.0 version without the solid argumentation.

@MaciejBaj MaciejBaj changed the title Update discovery and update time to get latest information Update discovery and update time to get latest information - Closes #2073 Jun 2, 2018
@MaciejBaj
Copy link
Contributor

Close until #2080 solved.

@MaciejBaj MaciejBaj closed this Jun 6, 2018
@karmacoma karmacoma deleted the 2073-increase_peer_update_frequency branch September 5, 2018 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants