Skip to content

Commit

Permalink
Move quorum intersection checker from scp to herder.
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Jun 19, 2019
1 parent 988ffe4 commit f6a6567
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 34 deletions.
8 changes: 4 additions & 4 deletions Builds/VisualStudio/stellar-core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ exit /b 0
<ClCompile Include="..\..\src\herder\TxSetFrame.cpp" />
<ClCompile Include="..\..\src\herder\Upgrades.cpp" />
<ClCompile Include="..\..\src\historywork\BatchDownloadWork.cpp" />
<ClCompile Include="..\..\src\scp\QuorumIntersectionCheckerImpl.cpp" />
<ClCompile Include="..\..\src\scp\test\QuorumIntersectionTests.cpp" />
<ClCompile Include="..\..\src\herder\QuorumIntersectionCheckerImpl.cpp" />
<ClCompile Include="..\..\src\herder\test\QuorumIntersectionTests.cpp" />
<ClCompile Include="..\..\src\work\BatchWork.cpp" />
<ClCompile Include="..\..\src\historywork\DownloadBucketsWork.cpp" />
<ClCompile Include="..\..\src\historywork\FetchRecentQsetsWork.cpp" />
Expand Down Expand Up @@ -600,8 +600,8 @@ exit /b 0
<ClInclude Include="..\..\src\herder\TxSetFrame.h" />
<ClInclude Include="..\..\src\herder\Upgrades.h" />
<ClInclude Include="..\..\src\historywork\BatchDownloadWork.h" />
<ClInclude Include="..\..\src\scp\QuorumIntersectionChecker.h" />
<ClInclude Include="..\..\src\scp\QuorumIntersectionCheckerImpl.h" />
<ClInclude Include="..\..\src\herder\QuorumIntersectionChecker.h" />
<ClInclude Include="..\..\src\herder\QuorumIntersectionCheckerImpl.h" />
<ClInclude Include="..\..\src\work\BatchWork.h" />
<ClInclude Include="..\..\src\historywork\DownloadBucketsWork.h" />
<ClInclude Include="..\..\src\historywork\FetchRecentQsetsWork.h" />
Expand Down
16 changes: 8 additions & 8 deletions Builds/VisualStudio/stellar-core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -933,11 +933,11 @@
<ClCompile Include="..\..\src\util\test\BitSetTests.cpp">
<Filter>util\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\scp\test\QuorumIntersectionTests.cpp">
<Filter>scp\tests</Filter>
<ClCompile Include="..\..\src\herder\test\QuorumIntersectionTests.cpp">
<Filter>herder\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\scp\QuorumIntersectionCheckerImpl.cpp">
<Filter>scp</Filter>
<ClCompile Include="..\..\src\herder\QuorumIntersectionCheckerImpl.cpp">
<Filter>herder</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -1619,11 +1619,11 @@
<ClInclude Include="..\..\lib\util\cbitset_portability.h">
<Filter>util</Filter>
</ClInclude>
<ClInclude Include="..\..\src\scp\QuorumIntersectionChecker.h">
<Filter>scp</Filter>
<ClInclude Include="..\..\src\herder\QuorumIntersectionChecker.h">
<Filter>herder</Filter>
</ClInclude>
<ClInclude Include="..\..\src\scp\QuorumIntersectionCheckerImpl.h">
<Filter>scp</Filter>
<ClInclude Include="..\..\src\herder\QuorumIntersectionCheckerImpl.h">
<Filter>herder</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/herder/HerderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "herder/HerderPersistence.h"
#include "herder/HerderUtils.h"
#include "herder/LedgerCloseData.h"
#include "herder/QuorumIntersectionChecker.h"
#include "herder/TxSetFrame.h"
#include "ledger/LedgerManager.h"
#include "ledger/LedgerTxn.h"
Expand All @@ -21,7 +22,6 @@
#include "main/PersistentState.h"
#include "overlay/OverlayManager.h"
#include "scp/LocalNode.h"
#include "scp/QuorumIntersectionChecker.h"
#include "scp/Slot.h"
#include "transactions/TransactionUtils.h"
#include "util/Logging.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include "crypto/Hex.h"
#include "crypto/SHA.h"
#include "herder/QuorumIntersectionChecker.h"
#include "lib/catch.hpp"
#include "main/Config.h"
#include "scp/QuorumIntersectionChecker.h"
#include "test/test.h"
#include "util/Logging.h"
#include "util/Math.h"
Expand All @@ -21,7 +21,7 @@ using VQ = xdr::xvector<QS>;
using VK = xdr::xvector<PublicKey>;
using std::make_shared;

TEST_CASE("quorum intersection basic 4-node", "[scp][quorumintersection]")
TEST_CASE("quorum intersection basic 4-node", "[herder][quorumintersection]")
{
QuorumTracker::QuorumMap qm;

Expand All @@ -41,7 +41,7 @@ TEST_CASE("quorum intersection basic 4-node", "[scp][quorumintersection]")
}

TEST_CASE("quorum intersection 6-node with subquorums",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
QuorumTracker::QuorumMap qm;

Expand Down Expand Up @@ -80,7 +80,8 @@ TEST_CASE("quorum intersection 6-node with subquorums",
REQUIRE(qic->networkEnjoysQuorumIntersection());
}

TEST_CASE("quorum non intersection basic 6-node", "[scp][quorumintersection]")
TEST_CASE("quorum non intersection basic 6-node",
"[herder][quorumintersection]")
{
QuorumTracker::QuorumMap qm;

Expand All @@ -104,7 +105,7 @@ TEST_CASE("quorum non intersection basic 6-node", "[scp][quorumintersection]")
}

TEST_CASE("quorum non intersection 6-node with subquorums",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
QuorumTracker::QuorumMap qm;

Expand Down Expand Up @@ -146,7 +147,7 @@ TEST_CASE("quorum non intersection 6-node with subquorums",
REQUIRE(!qic->networkEnjoysQuorumIntersection());
}

TEST_CASE("quorum plausible non intersection", "[scp][quorumintersection]")
TEST_CASE("quorum plausible non intersection", "[herder][quorumintersection]")
{
QuorumTracker::QuorumMap qm;

Expand Down Expand Up @@ -341,7 +342,7 @@ interconnectOrgsBidir(xdr::xvector<xdr::xvector<PublicKey>> const& orgs,
}

TEST_CASE("quorum intersection 4-org fully-connected, elide all minquorums",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// Generate a typical all-to-all multi-org graph that checks quickly: every
// quorum is a fair bit larger than half the SCC, so it will actually trim
Expand All @@ -356,7 +357,7 @@ TEST_CASE("quorum intersection 4-org fully-connected, elide all minquorums",
}

TEST_CASE("quorum intersection 3-org 3-node open line",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// Network: org0 <--> org1 <--> org2
//
Expand All @@ -373,7 +374,7 @@ TEST_CASE("quorum intersection 3-org 3-node open line",
}

TEST_CASE("quorum intersection 3-org 2-node open line",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// Network: org0 <--> org1 <--> org2
//
Expand All @@ -389,7 +390,7 @@ TEST_CASE("quorum intersection 3-org 2-node open line",
}

TEST_CASE("quorum intersection 3-org 3-node closed ring",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// Network: org0 <--> org1 <--> org2
// ^ ^
Expand All @@ -408,7 +409,7 @@ TEST_CASE("quorum intersection 3-org 3-node closed ring",
}

TEST_CASE("quorum intersection 3-org 3-node closed one-way ring",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// Network: org0 --> org1 --> org2
// ^ |
Expand All @@ -432,7 +433,7 @@ TEST_CASE("quorum intersection 3-org 3-node closed one-way ring",
}

TEST_CASE("quorum intersection 3-org 2-node closed one-way ring",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// Network: org0 --> org1 --> org2
// ^ |
Expand All @@ -456,7 +457,7 @@ TEST_CASE("quorum intersection 3-org 2-node closed one-way ring",
}

TEST_CASE("quorum intersection 3-org 2-node 2-of-3 asymmetric",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// +-------------------+
// | v
Expand Down Expand Up @@ -485,7 +486,7 @@ TEST_CASE("quorum intersection 3-org 2-node 2-of-3 asymmetric",
}

TEST_CASE("quorum intersection 8-org core-and-periphery dangling",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// This configuration "looks kinda strong" -- there's a fully-connected
// "core" org set and the "periphery" orgs are all set to 3/3 between their
Expand Down Expand Up @@ -531,7 +532,7 @@ TEST_CASE("quorum intersection 8-org core-and-periphery dangling",
}

TEST_CASE("quorum intersection 8-org core-and-periphery balanced",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// This configuration strengthens the previous just a bit by making each of
// the core orgs have _two_ periphery relationships, in a specific
Expand Down Expand Up @@ -583,7 +584,7 @@ TEST_CASE("quorum intersection 8-org core-and-periphery balanced",
}

TEST_CASE("quorum intersection 8-org core-and-periphery unbalanced",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// This configuration weakens the previous again, just a _tiny_ bit,
// by un-balancing the periphery-org structure. It's enough to re-introduce
Expand Down Expand Up @@ -630,7 +631,7 @@ TEST_CASE("quorum intersection 8-org core-and-periphery unbalanced",
}

TEST_CASE("quorum intersection 6-org 1-node 4-null qsets",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// Generating the following topology with dependencies from the core nodes
// org0..org1 bidirectionally to one another, but also one-way outwards to
Expand Down Expand Up @@ -683,7 +684,7 @@ TEST_CASE("quorum intersection 6-org 1-node 4-null qsets",
}

TEST_CASE("quorum intersection 4-org 1-node 4-null qsets",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
// Generating the following topology with dependencies from the core nodes
// org0..org1 bidirectionally to one another, but also one-way outwards to
Expand Down Expand Up @@ -728,7 +729,7 @@ TEST_CASE("quorum intersection 4-org 1-node 4-null qsets",
}

TEST_CASE("quorum intersection 6-org 3-node fully-connected",
"[scp][quorumintersection]")
"[herder][quorumintersection]")
{
auto orgs = generateOrgs(6, {3});
auto qm = interconnectOrgs(orgs, [](size_t i, size_t j) { return true; });
Expand All @@ -739,7 +740,7 @@ TEST_CASE("quorum intersection 6-org 3-node fully-connected",
}

TEST_CASE("quorum intersection scaling test",
"[scp][quorumintersectionbench][!hide]")
"[herder][quorumintersectionbench][!hide]")
{
// Same as above but with 3-or-5-own-node orgs, so more possible nodes,
// bigger search space for performance testing.
Expand Down
2 changes: 1 addition & 1 deletion src/history/InferredQuorumUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

#include "herder/Herder.h"
#include "herder/QuorumIntersectionChecker.h"
#include "history/HistoryManager.h"
#include "main/Application.h"
#include "main/Config.h"
#include "scp/QuorumIntersectionChecker.h"
#include "util/Logging.h"
#include "util/XDROperators.h"
#include "xdr/Stellar-SCP.h"
Expand Down

8 comments on commit f6a6567

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

saw approval from MonsieurNicolas
at graydon@f6a6567

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

merging graydon/stellar-core/bug-2152-move-quorum-intersection-checker = f6a6567 into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

graydon/stellar-core/bug-2152-move-quorum-intersection-checker = f6a6567 merged ok, testing candidate = 75bcfca6

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

saw approval from MonsieurNicolas
at graydon@f6a6567

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

merging graydon/stellar-core/bug-2152-move-quorum-intersection-checker = f6a6567 into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

graydon/stellar-core/bug-2152-move-quorum-intersection-checker = f6a6567 merged ok, testing candidate = e0377b5

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

fast-forwarding master to auto = e0377b5

Please sign in to comment.