Skip to content

Commit b595f9e

Browse files
codablockUdjinM6
authored andcommitted
Fix LLMQ signing integration tests (#2640)
* Fix cleanup of old recovered sigs When iterating the db, we should also include entries that match exactly the end time. * Fix key not found error * Raise AssertionError in case wait_for_quorum_phase/wait_for_quorum_commitment time out
1 parent 5977486 commit b595f9e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

qa/rpc-tests/test_framework/test_framework.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -408,21 +408,23 @@ def wait_for_quorum_phase(self, phase, check_received_messages, check_received_m
408408
all_ok = False
409409
break
410410
if all_ok:
411-
break
411+
return
412412
sleep(0.1)
413+
raise AssertionError("wait_for_quorum_phase timed out")
413414

414415
def wait_for_quorum_commitment(self, timeout = 5):
415416
t = time()
416417
while time() - t < timeout:
417418
all_ok = True
418419
for node in self.nodes:
419420
s = node.quorum("dkgstatus")["session"]["llmq_10"]
420-
if not s["receivedFinalCommitment"]:
421+
if "receivedFinalCommitment" not in s or not s["receivedFinalCommitment"]:
421422
all_ok = False
422423
break
423424
if all_ok:
424-
break
425+
return
425426
sleep(0.1)
427+
raise AssertionError("wait_for_quorum_commitment timed out")
426428

427429
def mine_quorum(self, expected_valid_count=10):
428430
quorums = self.nodes[0].quorum("list")

src/llmq/quorums_signing.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ void CRecoveredSigsDb::CleanupOldRecoveredSigs(int64_t maxAge)
119119
{
120120
std::unique_ptr<CDBIterator> pcursor(db.NewIterator());
121121

122+
static const uint256 maxUint256 = uint256S("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
122123
auto start = std::make_tuple('t', (uint32_t)0, (uint8_t)0, uint256());
123-
auto end = std::make_tuple('t', (uint32_t)(GetAdjustedTime() - maxAge), (uint8_t)0, uint256());
124+
auto end = std::make_tuple('t', (uint32_t)(GetAdjustedTime() - maxAge), (uint8_t)255, maxUint256);
124125
pcursor->Seek(start);
125126

126127
std::vector<std::pair<Consensus::LLMQType, uint256>> toDelete;

0 commit comments

Comments
 (0)