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

This demonstrates a speedup in confirmation rate during initial boots… #3644

Merged
merged 3 commits into from
Apr 21, 2022

Conversation

clemahieu
Copy link
Contributor

…trapping due to conservative limiters in the confirmation_solicitor. Rather than limiting with a constant number, it limits based on feedback directly from network channels.

Rather than limiting on a per-channel basis, a lot of complexity can be removed with by limiting the total number of active elections based on feedback from the confirmation rate.

@clemahieu clemahieu added this to the V24.0 milestone Jan 4, 2022
@MajorChump
Copy link
Contributor

MajorChump commented Jan 4, 2022

This looks like the issue I found with announcements being dropped due to max_channel_requests being exceeded.

Looking at that PR it removes max_channel_requests from the flow, probably could clean the code up a little by removing

L60 auto const max_channel_requests (config.confirm_req_batches_max * nano::network::confirm_req_hashes_max);

And confirm_req_batches_max could be removed from config I think.

Reference: #3574 (comment)

@clemahieu clemahieu force-pushed the confirmation_limiter branch from e0b7f8f to 6dfa522 Compare January 5, 2022 03:24
@clemahieu clemahieu closed this Apr 19, 2022
@clemahieu clemahieu reopened this Apr 19, 2022
@clemahieu clemahieu force-pushed the confirmation_limiter branch from 3ba40f1 to 53dbeca Compare April 19, 2022 16:58
@clemahieu clemahieu marked this pull request as ready for review April 19, 2022 16:58
@zhyatt zhyatt requested review from dsiganos, theohax and thsfs April 19, 2022 17:04
@clemahieu clemahieu force-pushed the confirmation_limiter branch from 53dbeca to fd906fc Compare April 20, 2022 11:05
@clemahieu clemahieu force-pushed the confirmation_limiter branch from fd906fc to 9e39e23 Compare April 20, 2022 12:07
nano/node/transport/tcp.hpp Show resolved Hide resolved
@@ -70,7 +69,7 @@ bool nano::confirmation_solicitor::add (nano::election const & election_a)
if (!exists || !is_final || different)
{
auto & request_queue (requests[rep.channel]);
if (request_queue.size () < max_channel_requests)
if (!rep.channel->full ())
Copy link
Contributor

@dsiganos dsiganos Apr 20, 2022

Choose a reason for hiding this comment

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

Completely filling up the buffers is possibly not a good idea. It might starve other processes of network bandwidth. We are going from a value of 2 to thousands. How about half or quarter full?

@thsfs
Copy link
Contributor

thsfs commented Apr 20, 2022

Looks good to me, but @dsiganos suggestions make sense, it is worth to improve the function names he pointed out.

channel::full() was calling channel::max() instead of socket::full(),
which also exists. So it makes sense for consistency to rename it.
@clemahieu clemahieu merged commit 8942a9e into develop Apr 21, 2022
@clemahieu clemahieu deleted the confirmation_limiter branch April 21, 2022 08:53
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.

4 participants