Skip to content

fix(dash): make feed_qr_info resilient to missing rotation CL sigs#723

Closed
xdustinface wants to merge 2 commits intodashpay:fix/llmq-verification-status-classifierfrom
xdustinface:fix/qr-info-rotation-quorums
Closed

fix(dash): make feed_qr_info resilient to missing rotation CL sigs#723
xdustinface wants to merge 2 commits intodashpay:fix/llmq-verification-status-classifierfrom
xdustinface:fix/qr-info-rotation-quorums

Conversation

@xdustinface
Copy link
Copy Markdown
Collaborator

Rework MasternodeListEngine::feed_qr_info to handle QRInfos whose historical diff covers a block range in which no rotating DKG successfully committed. Previously such QRInfos hard-errored on RequiredRotatedChainLockSigsNotPresent. Now the call soft-skips affected entries via the MissingRotationChainLockSigs skip status, logs a per-slot debug, and returns Ok(None) when nothing could be stored.

Add validate_and_store_previous_cycle_quorums and the RotationChainLockSignatureSlot enum to align the per-cycle signature tuple correctly between current-cycle and previous-cycle storage paths. Gate rotated_quorums_per_cycle insertion behind an anti-clobber check so a partially verified cycle never replaces an already fully verified one.

Change the public signature of feed_qr_info from Result<()> to Result<Option<QRInfoFeedResult>> so callers can observe how many quorums were qualified or fully verified, which cycle (if any) was stored, and whether the cycle is now fully verified. Naming follows the convention that this is a return value tied to the call, not a separate persisted record.

Adds 3 new unit tests covering the soft-skip path, corrupt aggregate signature rejection, and the anti-clobber guarantee.

`QuorumValidationError` carries both "the quorum data is bad" cases and "the caller didn't supply the data we need to verify". `update_quorum_status` and the rotated-quorum lookup in `validation.rs` mapped several of the latter to `LLMQEntryVerificationStatus::Invalid`, misreporting unverifiable quorums as bad.

Add a `From<QuorumValidationError> for LLMQEntryVerificationStatus` impl that routes the infrastructure-data variants to `Skipped`, and let both call sites use `.into()`:

- `RequiredBlockHeightNotPresent` becomes `Skipped(MissedList)`.
- `RequiredSnapshotNotPresent` becomes `Skipped(UnknownBlock)`.
- `RequiredRotatedChainLockSigsNotPresent` becomes a new `Skipped(MissingRotationChainLockSigs)` variant for the QRInfo case where a historical diff covers a range with no successful rotating DKG, so `feed_qr_info` can't populate the 4-sig tuple.

All other variants still map to `Invalid`.
Rework `MasternodeListEngine::feed_qr_info` to handle QRInfos whose historical diff covers a block range in which no rotating DKG successfully committed. Previously such QRInfos hard-errored on `RequiredRotatedChainLockSigsNotPresent`. Now the call soft-skips affected entries via the `MissingRotationChainLockSigs` skip status, logs a per-slot debug, and returns `Ok(None)` when nothing could be stored.

Add `validate_and_store_previous_cycle_quorums` and the `RotationChainLockSignatureSlot` enum to align the per-cycle signature tuple correctly between current-cycle and previous-cycle storage paths. Gate `rotated_quorums_per_cycle` insertion behind an anti-clobber check so a partially verified cycle never replaces an already fully verified one.

Change the public signature of `feed_qr_info` from `Result<()>` to `Result<Option<QRInfoFeedResult>>` so callers can observe how many quorums were qualified or fully verified, which cycle (if any) was stored, and whether the cycle is now fully verified. Naming follows the convention that this is a return value tied to the call, not a separate persisted record.

Adds 3 new unit tests covering the soft-skip path, corrupt aggregate signature rejection, and the anti-clobber guarantee.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e643800c-49a1-4f6c-9a2e-fd0f8165eead

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 86.11825% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.69%. Comparing base (ca507a9) to head (050f00f).
⚠️ Report is 3 commits behind head on fix/llmq-verification-status-classifier.

Files with missing lines Patch % Lines
dash/src/sml/masternode_list_engine/mod.rs 87.46% 46 Missing ⚠️
dash/src/sml/llmq_entry_verification.rs 52.94% 8 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           fix/llmq-verification-status-classifier     #723      +/-   ##
===========================================================================
+ Coverage                                    70.58%   70.69%   +0.11%     
===========================================================================
  Files                                          320      320              
  Lines                                        68243    68528     +285     
===========================================================================
+ Hits                                         48168    48449     +281     
- Misses                                       20075    20079       +4     
Flag Coverage Δ
core 76.04% <86.11%> (+0.22%) ⬆️
ffi 43.37% <ø> (ø)
rpc 20.00% <ø> (ø)
spv 87.33% <ø> (+0.07%) ⬆️
wallet 69.63% <ø> (ø)
Files with missing lines Coverage Δ
dash/src/sml/masternode_list_engine/validation.rs 79.33% <100.00%> (+3.72%) ⬆️
...ash/src/sml/quorum_entry/qualified_quorum_entry.rs 90.00% <100.00%> (+19.41%) ⬆️
dash/src/sml/llmq_entry_verification.rs 22.50% <52.94%> (+22.50%) ⬆️
dash/src/sml/masternode_list_engine/mod.rs 81.17% <87.46%> (+2.65%) ⬆️

... and 7 files with indirect coverage changes

@xdustinface xdustinface force-pushed the fix/llmq-verification-status-classifier branch from 218cdcd to 7300318 Compare May 4, 2026 13:51
@github-actions github-actions Bot added the merge-conflict The PR conflicts with the target branch. label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@QuantumExplorer QuantumExplorer deleted the branch dashpay:fix/llmq-verification-status-classifier May 5, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR conflicts with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants