-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: add mutable to make the captured work non-const, allowing it to be properly moved
#7058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… to be properly moved
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
WalkthroughThe change modifies a lambda function in Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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 |
There was a problem hiding this 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
📒 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:mutableon lambda capture correctly fixes the ineffectivestd::moveAdding
mutablehere is the right way to makeworknon-const inside the lambda so thatstd::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::moveof const variable” warning is gone.
| } | ||
|
|
||
| // Dispatch all signs to worker pool | ||
| for (auto& work : signs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 7371f51
kwvg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 7371f51
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. Addmutableto make the capturedworknon-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: