Skip to content

Commit e993a7a

Browse files
committed
Params: speed-up llmq_test
1 parent 839f14d commit e993a7a

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

src/chainparams.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ static Consensus::LLMQParams llmq_test = {
6767
.minSize = 2,
6868
.threshold = 2,
6969

70-
.dkgInterval = 60, // one DKG per hour
71-
.dkgPhaseBlocks = 6,
72-
.dkgMiningWindowStart = 30, // dkgPhaseBlocks * 5 = after finalization
73-
.dkgMiningWindowEnd = 40,
70+
.dkgInterval = 20, // one every 20 minutes
71+
.dkgPhaseBlocks = 2,
72+
.dkgMiningWindowStart = 10, // dkgPhaseBlocks * 5 = after finalization
73+
.dkgMiningWindowEnd = 15,
7474
.dkgBadVotesThreshold = 2,
7575

7676
.signingActiveQuorumCount = 2, // just a few ones to allow easier testing
7777

7878
.keepOldConnections = 3,
7979
.recoveryMembers = 3,
8080

81-
.cacheDkgInterval = 180,
81+
.cacheDkgInterval = 60,
8282
};
8383

8484
static Consensus::LLMQParams llmq50_60 = {

src/test/evo_deterministicmns_tests.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,13 +1076,11 @@ BOOST_FIXTURE_TEST_CASE(dkg_pose_and_qfc_invalid_paths, TestChain400Setup)
10761076
ProcessQuorum(llmq::quorumBlockProcessor.get(), qfc, &dummyNode);
10771077
BOOST_CHECK(llmq::quorumBlockProcessor->HasMinableCommitment(::SerializeHash(qfc)));
10781078

1079-
// Generate blocks up to be able to mine a null qfc at block 450
1080-
for (size_t i = 0; i < 21; i++) {
1081-
CreateAndProcessBlock({}, coinbaseKey);
1082-
chainTip = chainActive.Tip();
1083-
BOOST_CHECK_EQUAL(chainTip->nHeight, ++nHeight);
1084-
}
1085-
BOOST_CHECK_EQUAL(nHeight, 448);
1079+
// Generate blocks up to be able to mine a null qfc at block 430
1080+
CreateAndProcessBlock({}, coinbaseKey);
1081+
chainTip = chainActive.Tip();
1082+
BOOST_CHECK_EQUAL(chainTip->nHeight, ++nHeight);
1083+
BOOST_CHECK_EQUAL(nHeight, 428);
10861084

10871085
// Coverage for the following qfc paths:
10881086
// 1) Mine a qfc with an invalid height, which should end up being rejected.
@@ -1110,7 +1108,7 @@ BOOST_FIXTURE_TEST_CASE(dkg_pose_and_qfc_invalid_paths, TestChain400Setup)
11101108
CreateBlock({nullQfcTx}, coinsbaseScript, true, false, false));
11111109
ProcessBlockAndCheckRejectionReason(pblock_invalid, "bad-qc-not-allowed", nHeight);
11121110

1113-
// One more block, 449.
1111+
// One more block, 429.
11141112
CreateAndProcessBlock({}, coinbaseKey);
11151113
chainTip = chainActive.Tip();
11161114
BOOST_CHECK_EQUAL(chainTip->nHeight, ++nHeight);
@@ -1133,7 +1131,7 @@ BOOST_FIXTURE_TEST_CASE(dkg_pose_and_qfc_invalid_paths, TestChain400Setup)
11331131
BOOST_CHECK_EQUAL(chainTip->nHeight, ++nHeight);
11341132
nullQfcTx = CreateNullQfcTx(quorumHash, nHeight + 1);
11351133
}
1136-
BOOST_CHECK_EQUAL(nHeight, 451);
1134+
BOOST_CHECK_EQUAL(nHeight, 431);
11371135

11381136
// 6) Try to relay the valid qfc to the mempool, which should end up on a rejection.
11391137
CTransactionRef qcTx;
@@ -1173,7 +1171,7 @@ BOOST_FIXTURE_TEST_CASE(dkg_pose_and_qfc_invalid_paths, TestChain400Setup)
11731171
ProcessBlockAndCheckRejectionReason(pblock_invalid, "bad-qc-quorum-hash-not-active-chain", nHeight);
11741172

11751173
// 7d) Mine a qfc with an old quorum hash, which should end up being rejected.
1176-
int old_quorum_hash_height = nHeight - (nHeight % params.dkgInterval) - params.dkgInterval * 4;
1174+
int old_quorum_hash_height = nHeight - (nHeight % params.dkgInterval) - params.cacheDkgInterval - params.dkgInterval;
11771175
uint256 old_quorum_hash = chainActive[old_quorum_hash_height]->GetBlockHash();
11781176
nullQfcTx = CreateNullQfcTx(old_quorum_hash, nHeight + 1);
11791177
pblock_invalid = std::make_shared<CBlock>(CreateBlock({nullQfcTx}, coinsbaseScript, true, false, false));
@@ -1214,13 +1212,13 @@ BOOST_FIXTURE_TEST_CASE(dkg_pose_and_qfc_invalid_paths, TestChain400Setup)
12141212
punished_mn = deterministicMNManager->GetListAtChainTip().GetMN(invalidmn_proTx);
12151213
BOOST_CHECK_EQUAL(punished_mn->pdmnState->nPoSePenalty, 65);
12161214

1217-
// New DKG starts at block 480. Mine till block 481 and create another valid 2-of-3 commitment
1218-
for (size_t i = 0; i < 28; i++) {
1215+
// New DKG starts at block 440. Mine till block 441 and create another valid 2-of-3 commitment
1216+
for (size_t i = 0; i < 8; i++) {
12191217
CreateAndProcessBlock({}, coinbaseKey);
12201218
chainTip = chainActive.Tip();
12211219
BOOST_CHECK_EQUAL(chainTip->nHeight, ++nHeight);
12221220
}
1223-
BOOST_CHECK_EQUAL(nHeight, 481);
1221+
BOOST_CHECK_EQUAL(nHeight, 441);
12241222
quorumHash = chainActive[nHeight - (nHeight % params.dkgInterval)]->GetBlockHash();
12251223
quorumIndex = mapBlockIndex.at(quorumHash);
12261224
members = deterministicMNManager->GetAllQuorumMembers(Consensus::LLMQ_TEST, quorumIndex);

0 commit comments

Comments
 (0)