Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/llmq/signing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,9 @@ bool IsQuorumActive(Consensus::LLMQType llmqType, const CQuorumManager& qman, co
// we allow one more active quorum as specified in consensus, as otherwise there is a small window where things could
// fail while we are on the brink of a new quorum
const auto& llmq_params_opt = Params().GetLLMQ(llmqType);
assert(llmq_params_opt.has_value());
if (!llmq_params_opt.has_value()) {
return false;
}
Comment on lines 651 to +654

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Suggestion: Restore the direct unknown-type regression test

No test at the current head calls IsQuorumActive with an LLMQ type for which GetLLMQ returns nullopt, so the new early-return branch is not directly covered. The test removed by e42e666 reached this guard before ScanQuorums for both an unknown value and a real but unregistered enum value; it passed with this change and would abort on the previous assertion. Restore that focused test so a future refactor cannot silently reintroduce the assertion or otherwise break the defensive behavior this PR adds.

source: ['claude', 'codex']

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adding a test for this seems not needed

auto quorums = qman.ScanQuorums(llmqType, llmq_params_opt->keepOldConnections);
return std::ranges::any_of(quorums, [&quorumHash](const auto& q) { return q->qc->quorumHash == quorumHash; });
}
Expand Down
Loading