Skip to content

LLMQ: Handle empty contribution batches - #1929

Open
navidR wants to merge 1 commit into
firoorg:masterfrom
navidR:dev/navidr/dkg-empty-contribution-batch
Open

LLMQ: Handle empty contribution batches#1929
navidR wants to merge 1 commit into
firoorg:masterfrom
navidR:dev/navidr/dkg-empty-contribution-batch

Conversation

@navidR

@navidR navidR commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Handle contribution batches that become empty after filtering, and complete empty BLS verification requests immediately. This prevents DKG phase processing from waiting indefinitely and adds focused regression coverage.

Upstream: Dash PR #7486.

@codeant-ai

codeant-ai Bot commented Aug 30, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR fcf775b Aug 30, 2026 · 14:55 14:58

@codeant-ai

codeant-ai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T14:56:29.946590Z fcf775b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Aug 30, 2026
@codeant-ai

codeant-ai Bot commented Aug 30, 2026

Copy link
Copy Markdown

User description

Handle contribution batches that become empty after filtering, and complete empty BLS verification requests immediately. This prevents DKG phase processing from waiting indefinitely and adds focused regression coverage.


CodeAnt-AI Description

Prevent empty DKG contribution batches from getting stuck

What Changed

  • Empty contribution verification requests now finish immediately with no results
  • DKG processing skips verification when all pending contributors have become invalid
  • Added regression coverage for empty verification batches in both supported verification modes

Impact

✅ DKG sessions no longer wait indefinitely on empty contribution batches
✅ Empty BLS verification requests complete immediately
✅ Reliable handling of contributors invalidated after queuing

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7c6ff771-2aa5-4f50-9202-2ef2b2dbfe1d

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0c771 and fcf775b.

📒 Files selected for processing (3)
  • src/bls/bls_worker.cpp
  • src/llmq/quorums_dkgsession.cpp
  • src/test/bls_tests.cpp

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of empty contribution-share verification requests.
    • Prevented unnecessary verification attempts when all pending contributions are skipped.
    • Improved stability during quorum contribution processing.
  • Tests

    • Added coverage for empty contribution-share verification in both supported modes.

Walkthrough

The change adds early returns for empty contribution verification inputs in the BLS worker and DKGS session. A BLS test verifies that empty aggregated and non-aggregated inputs invoke the callback with an empty result.

Changes

Empty contribution verification handling

Layer / File(s) Summary
Worker empty-input guard and validation
src/bls/bls_worker.cpp, src/test/bls_tests.cpp
AsyncVerifyContributionShares now invokes the callback immediately with an empty result when vvecs is empty. Tests cover aggregated and non-aggregated calls.
DKG empty-member guard
src/llmq/quorums_dkgsession.cpp
VerifyPendingContributions now returns when no member indexes remain after pending members are excluded.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fcf77

Empty contribution batches now complete without stalling DKG processing, while non-empty verification behavior remains unchanged. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description explains the intended fix, its effect on DKG processing, and the added regression coverage. It does not use the template headings, but it provides the required intention and code-chang…
Title check ✅ Passed The title clearly identifies the main change: handling empty contribution batches in LLMQ processing.
Full details: Description check

Explanation

The description explains the intended fix, its effect on DKG processing, and the added regression coverage. It does not use the template headings, but it provides the required intention and code-change information.

  • Fix all pre-merge checks with AI
✨ 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.

@codeant-ai

codeant-ai Bot commented Aug 30, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. When vvecs is empty but skShares is not, this returns an empty result and silently accepts mismatched input instead of rejecting it.

Api mismatch · src/bls/bls_worker.cpp:729-732

@reubenyap reubenyap left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reviewed both synchronous and asynchronous empty-input behavior and traced the DKG path where every queued contributor becomes invalid before verification. The member-index, verification-vector, and secret-share collections are built in lockstep; the new guard safely drains the moved queue and avoids constructing the verifier with zero inputs. The focused tests and full CI matrix are green; I found no actionable defect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants