Skip to content

Conversation

@UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Dec 9, 2025

Issue being fixed or feature implemented

clang-tidy complains on develop https://github.com/dashpay/dash/actions/runs/20066954644/job/57558275807

#7004 follow-up

What was done?

Lambda captures are const by default, so std::move(work) inside the lambda had no effect. Add mutable to make the captured work non-const, allowing it to be properly moved.

How Has This Been Tested?

https://github.com/UdjinM6/dash/actions/runs/20079838716/job/57605752892

Breaking Changes

n/a

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@UdjinM6 UdjinM6 added this to the 23.1 milestone Dec 9, 2025
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Walkthrough

The change modifies a lambda function in CSigSharesManager::DispatchPendingSigns to include the mutable keyword in its capture specification. The lambda now explicitly allows modification of its by-value captures with [this, work = std::move(work)](int) mutable, whereas previously it was non-mutable. The current diff does not introduce any actual mutations within the lambda body. No functional behavior changes in the present code.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Special attention needed:
    • Verify that the mutable qualifier does not inadvertently enable unintended side effects within the lambda or affect the lifetime of the work object
    • Confirm that no future code changes are expected to rely on mutating the captured work variable, as none currently exist in the diff

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding mutable to a lambda to enable proper moving of the captured work variable, which directly matches the code modification.
Description check ✅ Passed The description is related to the changeset, explaining the clang-tidy issue, why the fix was needed (const capture preventing std::move), and providing testing evidence.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b668f8d and 7371f51.

📒 Files selected for processing (1)
  • src/llmq/signing_shares.cpp (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
src/**/*.{cpp,h,hpp,cc}

📄 CodeRabbit inference engine (CLAUDE.md)

Dash Core implementation must be written in C++20, requiring at least Clang 16 or GCC 11.1

Files:

  • src/llmq/signing_shares.cpp
src/{masternode,evo,llmq,governance,coinjoin}/**/*.{cpp,h}

📄 CodeRabbit inference engine (CLAUDE.md)

Use Dash-specific database implementations: CFlatDB for persistent storage (MasternodeMetaStore, GovernanceStore, SporkStore, NetFulfilledRequestStore) and CDBWrapper extensions for Evolution/DKG/InstantSend/Quorum/RecoveredSigs data

Files:

  • src/llmq/signing_shares.cpp
src/{masternode,llmq}/**/*.{cpp,h}

📄 CodeRabbit inference engine (CLAUDE.md)

BLS integration must be used for cryptographic foundation of advanced masternode features

Files:

  • src/llmq/signing_shares.cpp
src/llmq/**/*.{cpp,h}

📄 CodeRabbit inference engine (CLAUDE.md)

src/llmq/**/*.{cpp,h}: LLMQ quorums must support multiple configurations (50/60, 400/60, 400/85) for different services (ChainLocks, InstantSend, governance voting)
InstantSend implementation must provide distributed key generation for secure transaction locking with quorum consensus
ChainLocks implementation must prevent reorganizations and provide block finality through 51% attack prevention

Files:

  • src/llmq/signing_shares.cpp
src/{masternode,llmq,evo,coinjoin,governance}/**/*.{cpp,h}

📄 CodeRabbit inference engine (CLAUDE.md)

Use unordered_lru_cache for efficient caching with LRU eviction in Dash-specific data structures

Files:

  • src/llmq/signing_shares.cpp
🧠 Learnings (1)
📓 Common learnings
Learnt from: kwvg
Repo: dashpay/dash PR: 6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
🪛 GitHub Actions: Clang Diff Format Check
src/llmq/signing_shares.cpp

[error] 1668-1668: Clang format differences found. Run clang-format-diff.py -p1 or clang-format -i to fix formatting in this file.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: linux64_tsan-build / Build source
  • GitHub Check: mac-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: linux64_ubsan-build / Build source
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: linux64-build / Build source
  • GitHub Check: arm-linux-build / Build source
  • GitHub Check: win64-build / Build source
  • GitHub Check: linux64_nowallet-build / Build source
  • GitHub Check: Lint / Run linters
🔇 Additional comments (1)
src/llmq/signing_shares.cpp (1)

1671-1673: mutable on lambda capture correctly fixes the ineffective std::move

Adding mutable here is the right way to make work non-const inside the lambda so that std::move(work) actually triggers a move instead of a copy. This keeps the change tightly scoped to move semantics with no observable behavior change, which is appropriate for this follow-up fix.

If you’d like extra assurance, please double‑check the generated clang‑tidy output for this lambda to confirm the “std::move of const variable” warning is gone.

}

// Dispatch all signs to worker pool
for (auto& work : signs) {
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix clang-format diff reported by CI around this loop

CI reports a clang-format difference at this location. Please run the project’s configured clang-format (or clang-format-diff.py -p1 as suggested by CI) on src/llmq/signing_shares.cpp and commit the formatting changes so the pipeline passes.

🧰 Tools
🪛 GitHub Actions: Clang Diff Format Check

[error] 1668-1668: Clang format differences found. Run clang-format-diff.py -p1 or clang-format -i to fix formatting in this file.

🤖 Prompt for AI Agents
In src/llmq/signing_shares.cpp around line 1668 the for-loop formatting does not
match the project's clang-format settings; run the configured formatter (e.g.
clang-format on the file or clang-format-diff.py -p1 as suggested by CI) to
rewrite the loop and surrounding lines to match style, verify the diff, and
commit the formatted changes to the repo so the CI clang-format check passes.

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK 7371f51

Copy link
Collaborator

@kwvg kwvg left a comment

Choose a reason for hiding this comment

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

utACK 7371f51

@PastaPastaPasta PastaPastaPasta merged commit bac6bfa into dashpay:develop Dec 10, 2025
71 of 76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants