@@ -43,10 +43,12 @@ class TestSCP : public SCPDriver
4343 uint32_t mIncrementBallotTimeoutMS = 1000 ;
4444 uint32_t mInitialNominationTimeoutMS = 1000 ;
4545 uint32_t mIncrementNominationTimeoutMS = 1000 ;
46+ bool const mProtocolAllowsEmptyTxSetValues ;
4647
4748 TestSCP (NodeID const & nodeID, SCPQuorumSet const & qSetLocal,
48- bool isValidator = true )
49+ bool isValidator = true , bool protocolAllowsEmptyTxSetValues = true )
4950 : mSCP (*this , nodeID, isValidator, qSetLocal)
51+ , mProtocolAllowsEmptyTxSetValues (protocolAllowsEmptyTxSetValues)
5052 {
5153 mPriorityLookup = [&](NodeID const & n) {
5254 return (n == mSCP .getLocalNodeID ()) ? 1000 : 1 ;
@@ -165,13 +167,17 @@ class TestSCP : public SCPDriver
165167 bool
166168 isParallelTxSetDownloadEnabled () const override
167169 {
168- return true ;
170+ // Leave unimplemented. A node's parallel downloading setting only
171+ // affects higher level systems (such as PendingEnvelopes).
172+ // NominationProtocol and BallotProtocol only reason about whether the
173+ // protocol supports empty-tx-set values
174+ releaseAssert (false );
169175 }
170176
171177 bool
172178 protocolAllowsEmptyTxSetValues () const override
173179 {
174- return true ;
180+ return mProtocolAllowsEmptyTxSetValues ;
175181 }
176182
177183 void
@@ -861,7 +867,9 @@ TEST_CASE("ballot protocol core5", "[scp][ballotprotocol]")
861867
862868 uint256 qSetHash = sha256 (xdr::xdr_to_opaque (qSet));
863869
864- TestSCP scp (v0SecretKey.getPublicKey (), qSet);
870+ bool const protocolAllowsEmptyTxSetValues = GENERATE (false , true );
871+ TestSCP scp (v0SecretKey.getPublicKey (), qSet, /* isValidator*/ true ,
872+ protocolAllowsEmptyTxSetValues);
865873
866874 auto test = [&](TestSCP& scp) {
867875 scp.storeQuorumSet (std::make_shared<SCPQuorumSet>(qSet));
@@ -2651,7 +2659,8 @@ TEST_CASE("ballot protocol core5", "[scp][ballotprotocol]")
26512659 SECTION (" non validator watching the network" )
26522660 {
26532661 SIMULATION_CREATE_NODE (NV );
2654- TestSCP scpNV (vNVSecretKey.getPublicKey (), qSet, false );
2662+ TestSCP scpNV (vNVSecretKey.getPublicKey (), qSet, false ,
2663+ protocolAllowsEmptyTxSetValues);
26552664 scpNV.storeQuorumSet (std::make_shared<SCPQuorumSet>(qSet));
26562665 uint256 qSetHashNV = scpNV.mSCP .getLocalNode ()->getQuorumSetHash ();
26572666
@@ -2680,7 +2689,8 @@ TEST_CASE("ballot protocol core5", "[scp][ballotprotocol]")
26802689
26812690 SECTION (" restore ballot protocol" )
26822691 {
2683- TestSCP scp2 (v0SecretKey.getPublicKey (), qSet);
2692+ TestSCP scp2 (v0SecretKey.getPublicKey (), qSet, /* isValidator*/ true ,
2693+ protocolAllowsEmptyTxSetValues);
26842694 scp2.storeQuorumSet (std::make_shared<SCPQuorumSet>(qSet));
26852695 SCPBallot b (2 , xValue);
26862696 SECTION (" prepare" )
@@ -2725,7 +2735,9 @@ TEST_CASE("ballot protocol core3", "[scp][ballotprotocol]")
27252735
27262736 uint256 qSetHash = sha256 (xdr::xdr_to_opaque (qSet));
27272737
2728- TestSCP scp (v0SecretKey.getPublicKey (), qSet);
2738+ bool const protocolAllowsEmptyTxSetValues = GENERATE (false , true );
2739+ TestSCP scp (v0SecretKey.getPublicKey (), qSet, /* isValidator*/ true ,
2740+ protocolAllowsEmptyTxSetValues);
27292741
27302742 auto test = [&](TestSCP& scp) {
27312743 scp.storeQuorumSet (std::make_shared<SCPQuorumSet>(qSet));
@@ -2872,7 +2884,9 @@ TEST_CASE("ballot protocol core3", "[scp][ballotprotocol]")
28722884 SECTION (" node without self - quorum timeout" )
28732885 {
28742886 SIMULATION_CREATE_NODE (NodeNS);
2875- TestSCP scpNNS (vNodeNSSecretKey.getPublicKey (), qSet);
2887+ TestSCP scpNNS (vNodeNSSecretKey.getPublicKey (), qSet,
2888+ /* isValidator*/ true ,
2889+ protocolAllowsEmptyTxSetValues);
28762890 scpNNS.storeQuorumSet (std::make_shared<SCPQuorumSet>(qSet));
28772891 uint256 qSetHashNodeNS =
28782892 scpNNS.mSCP .getLocalNode ()->getQuorumSetHash ();
@@ -2929,9 +2943,11 @@ TEST_CASE("nomination tests core5", "[scp][nominationprotocol]")
29292943 expectedLeaders.end ()));
29302944 };
29312945
2946+ bool const protocolAllowsEmptyTxSetValues = GENERATE (false , true );
29322947 SECTION (" nomination - v0 is top" )
29332948 {
2934- TestSCP scp (v0SecretKey.getPublicKey (), qSet);
2949+ TestSCP scp (v0SecretKey.getPublicKey (), qSet, /* isValidator*/ true ,
2950+ protocolAllowsEmptyTxSetValues);
29352951
29362952 auto test = [&](TestSCP& scp) {
29372953 uint256 qSetHash0 = scp.mSCP .getLocalNode ()->getQuorumSetHash ();
@@ -3045,7 +3061,9 @@ TEST_CASE("nomination tests core5", "[scp][nominationprotocol]")
30453061 }
30463062 SECTION (" nomination - restored state" )
30473063 {
3048- TestSCP scp2 (v0SecretKey.getPublicKey (), qSet);
3064+ TestSCP scp2 (v0SecretKey.getPublicKey (), qSet,
3065+ /* isValidator*/ true ,
3066+ protocolAllowsEmptyTxSetValues);
30493067 scp2.storeQuorumSet (
30503068 std::make_shared<SCPQuorumSet>(qSet));
30513069
@@ -3282,7 +3300,8 @@ TEST_CASE("nomination tests core5", "[scp][nominationprotocol]")
32823300 }
32833301 SECTION (" v1 is top node" )
32843302 {
3285- TestSCP scp (v0SecretKey.getPublicKey (), qSet);
3303+ TestSCP scp (v0SecretKey.getPublicKey (), qSet, /* isValidator*/ true ,
3304+ protocolAllowsEmptyTxSetValues);
32863305
32873306 auto test = [&](TestSCP& scp) {
32883307 uint256 qSetHash0 = scp.mSCP .getLocalNode ()->getQuorumSetHash ();
0 commit comments