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

Bug 2267 quorum intersection pick any scc with a quorum #2279

Conversation

graydon
Copy link
Contributor

@graydon graydon commented Sep 18, 2019

Description

Resolves #2267 in a different way than #2278. Simpler: just pick the first quorum-containing SCC we find, and fail if there's more than one (as we were already doing). Avoids artificially picking an SCC with no quorums that happens to just be "big".

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v5.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

@graydon
Copy link
Contributor Author

graydon commented Sep 18, 2019

@fixxxedpoint is this more along the correct line of behaviour?

@@ -674,18 +674,19 @@ void
QuorumIntersectionCheckerImpl::buildSCCs()
{
mTSC.calculateSCCs();
mMaxSCC.clear();
mScanSCC.clear();
for (auto const& scc : mTSC.mSCCs)
Copy link

Choose a reason for hiding this comment

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

I would just remove that loop together with mScanSCC class variable and "merge" it with that main loop in networkEnjoysQuorumIntersection(). Name suggests it is only responsible for building SCCs and the whole thing will be also more easier to understand (as we talked before, you don't need to search for that greatest element). It is not a big deal but current version also iterates all SCCs twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fixxxedpoint Well, mScanSCC is used in a couple other helper methods throughout the implementation, I can't easily eliminate it entirely without turning it into a parameter I have to pass everywhere; but I can merge the setup loops as you suggest. Will do so. Otherwise I just wanted to double check: style issues aside, this at least looks correct to you?

Thanks again for all the input and hand-holding; I just want to make sure I'm faithfully transplanting your work here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Update: actually making the variable local / sinking it into a member into the helper class was relatively low-impact; patch updated with the results!)

@graydon graydon force-pushed the bug-2267-quorum-intersection-pick-any-scc-with-a-quorum branch from 2a8810e to c2d9b9e Compare September 21, 2019 22:37
Copy link

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

This looks correct and good to me! 👍

@MonsieurNicolas MonsieurNicolas added this to In progress in v12.1.0 via automation Sep 23, 2019
@MonsieurNicolas
Copy link
Contributor

r+ c2d9b9e

latobarita added a commit that referenced this pull request Oct 2, 2019
…ck-any-scc-with-a-quorum

Bug 2267 quorum intersection pick any scc with a quorum

Reviewed-by: MonsieurNicolas
@latobarita latobarita merged commit c2d9b9e into stellar:master Oct 2, 2019
v12.1.0 automation moved this from In progress to Done Oct 2, 2019
@graydon graydon deleted the bug-2267-quorum-intersection-pick-any-scc-with-a-quorum branch January 3, 2020 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v12.1.0
  
Done
Development

Successfully merging this pull request may close these issues.

Potentially incorrect quorum intersection check (Version: 11.4.0)
5 participants