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

Separate vote generation process #1302

Merged
merged 15 commits into from Oct 18, 2018

Conversation

Projects
None yet
4 participants
@clemahieu
Copy link
Collaborator

commented Oct 14, 2018

This patch decouples vote generation from quorum solicitation. Previously both were done in one large announce loop which on average would delay vote generation by 1/2 the announcement interval.

Now we announce votes as soon as a local decision is made i.e. a block is inserted in to the ledger.

clemahieu added some commits Oct 13, 2018

Creating the vote_generator class which encapsulates the process of b…
…undling and announcing votes. Votes are collected in either bundles of the maximum size, 12, or however many are available after a time cutoff.
Strengthen the node.block_confirm test which was locally confirming t…
…he block through the active_block loop instead of ensuring it was confirmed through actual network traffic.
Previously node_receive_quorum was built around the assumption that t…
…he announce loop would continue to announce votes. Instead the test should be built so that it will continue to solicit votes if quorum is not met.
@PlasmaPower

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2018

I wouldn't remove the announcements in rai::active_transactions::announce_votes.

@clemahieu

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 14, 2018

Why?

@PlasmaPower

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2018

We could ignore them for the first interval, but I think they're important for ensuring confirmation.

@clemahieu

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 14, 2018

Not having received quorum doesn’t imply our created vote was missed. If our vote was missed someone would solicit it with confirm_req, receive the reply, then relay it out to the network.

@PlasmaPower

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2018

If a lot of other peoples' votes are missing, most likely it's due to network congestion, which means that our votes are likely missing too.

@clemahieu

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 14, 2018

Congestion would be better solved at the transport layer. Currently its unreliable but if we switch to a reliable one it would waste bandwidth.

@rkeene rkeene added this to the V17.0 milestone Oct 14, 2018

clemahieu added some commits Oct 15, 2018

We don't need a write transaction to generate votes and scope the dat…
…abase transaction to close before re-acquiring the vote_generator lock.
Show resolved Hide resolved rai/node/voting.hpp Outdated
void rai::vote_generator::send (std::unique_lock<std::mutex> & lock_a)
{
std::vector<rai::block_hash> hashes_l;
hashes_l.reserve (12);

This comment has been minimized.

Copy link
@rkeene

rkeene Oct 15, 2018

Contributor

The value "12" should be computed somewhere as the max block size (currently 508) minus the overhead, divided by hash size so that it semantically matches "could_fit"

clemahieu added some commits Oct 17, 2018

Naming vote thread.
Using boost instead of std thread to match other thread usage.

@clemahieu clemahieu merged commit 8e42efb into master Oct 18, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@clemahieu clemahieu deleted the vote_generator branch Oct 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.