Skip to content

Commit b3e4105

Browse files
thepastaclawclaude
andcommitted
test: derive DKG lookahead from RPC default in feature_llmq_evo
Address CodeRabbit feedback on the dkginfo test: name the previously hardcoded values and document their C++ sources (llmq_test_platform dkgInterval in src/llmq/params.h, WORK_DIFF_DEPTH in src/llmq/snapshot.h), and drop the explicit lookahead argument since 'quorum dkginfo' already defaults lookahead_blocks to llmq::WORK_DIFF_DEPTH. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0b83dc4 commit b3e4105

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test/functional/feature_llmq_evo.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,24 @@ def run_test(self):
8686

8787
self.log.info("Test 'quorum dkginfo' upcoming platform DKG participation uses only EvoNodes")
8888
nodes = [self.nodes[0]] + [mn.get_node(self) for mn in self.mninfo]
89+
# Mirrors llmq_test_platform.dkgInterval (src/llmq/params.h) and
90+
# llmq::WORK_DIFF_DEPTH (src/llmq/snapshot.h): the quorum work block is
91+
# mined work_diff_depth blocks before the quorum height, so mine up to
92+
# that point to make the upcoming DKG predictable.
8993
dkg_interval = 24
94+
work_diff_depth = 8
9095
tip = self.nodes[0].getblockcount()
9196
blocks_to_next_dkg = dkg_interval - (tip % dkg_interval)
92-
blocks_to_mine = blocks_to_next_dkg - 8
97+
blocks_to_mine = blocks_to_next_dkg - work_diff_depth
9398
if blocks_to_mine > 0:
9499
self.generate(self.nodes[0], blocks_to_mine, sync_fun=lambda: self.sync_blocks(nodes))
95100

96101
tip = self.nodes[0].getblockcount()
97102
expected_quorum_height = tip - (tip % dkg_interval) + dkg_interval
98103
predicted_members = {}
99104
for mn in self.mninfo:
100-
dkg_info = mn.get_node(self).quorum("dkginfo", mn.proTxHash, 8)
105+
# lookahead_blocks defaults to llmq::WORK_DIFF_DEPTH, exactly covering the upcoming DKG
106+
dkg_info = mn.get_node(self).quorum("dkginfo", mn.proTxHash)
101107
upcoming_platform = [d for d in dkg_info["upcoming_dkgs"] if d["llmqType"] == 106]
102108
assert_equal(len(upcoming_platform), 1)
103109
predicted_platform = upcoming_platform[0]

0 commit comments

Comments
 (0)