fix(dash): make feed_qr_info resilient to missing rotation CL sigs#723
Conversation
`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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
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
|
218cdcd to
7300318
Compare
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
Rework
MasternodeListEngine::feed_qr_infoto handle QRInfos whose historical diff covers a block range in which no rotating DKG successfully committed. Previously such QRInfos hard-errored onRequiredRotatedChainLockSigsNotPresent. Now the call soft-skips affected entries via theMissingRotationChainLockSigsskip status, logs a per-slot debug, and returnsOk(None)when nothing could be stored.Add
validate_and_store_previous_cycle_quorumsand theRotationChainLockSignatureSlotenum to align the per-cycle signature tuple correctly between current-cycle and previous-cycle storage paths. Gaterotated_quorums_per_cycleinsertion behind an anti-clobber check so a partially verified cycle never replaces an already fully verified one.Change the public signature of
feed_qr_infofromResult<()>toResult<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.