forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
refactor: avoid return by reference and prefer return by value #6955
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
Open
PastaPastaPasta
wants to merge
10
commits into
dashpay:develop
Choose a base branch
from
PastaPastaPasta:refac/return-value
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
379168c
refac: Replace return types with std::optional for recovered signatur…
PastaPastaPasta 52748fc
refac: Update methods to return std::optional for DKG-related data re…
PastaPastaPasta 95e9f43
refac: Change session info retrieval methods to return std::optional
PastaPastaPasta de63190
chore: clang format
PastaPastaPasta 4a55cd5
fix: improve logging format in CSigSharesManager
PastaPastaPasta e05d96a
fix: add src/llmq/dkgtypes.h
PastaPastaPasta d007f01
fix: include <memory>
PastaPastaPasta 96e3eb1
fix: minor fixes
PastaPastaPasta 5b7c51e
chore: avoid extra nesting
PastaPastaPasta d9393a8
refactor: drop unused imports
PastaPastaPasta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: can probably drop
and something else once dkgtypes.h is split
@coderabbitai, validate list of included headers for this PR
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.
@coderabbitai please review this 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.
🧩 Analysis chain
🏁 Script executed:
Length of output: 3176
@PastaPastaPasta, @knst is correct! After analyzing the includes in
src/llmq/dkgsession.h, I can confirm that the following includes are now redundant and can be removed:#include <bls/bls_ies.h>- This can be dropped because:CBLSIESMultiRecipientObjects<CBLSSecretKey>(line 144)dkgtypes.halready includesbls/bls_ies.hdkgtypes.h#include <util/underlying.h>- This can be dropped because:dkgsession.hdkgtypes.halready includes itCurrent necessary includes:
llmq/commitment.h- used for CFinalCommitmentllmq/dkgtypes.h- provides CDKGContribution, CDKGComplaint, CDKGJustification, CDKGPrematureCommitment (stored as full objects in std::map members, can't be forward-declared)batchedlogger.h- base class for CDKGLoggerbls/bls.h- BLS types (CBLSId, CBLSSecretKey, BLSVerificationVectorPtr, etc.)bls/bls_worker.h- CBLSWorker& memberevo/types.h- CDeterministicMN typessaltedhasher.h- Uint256HashSet typesync.h- Mutex, GUARDED_BYoptional- std::optional usageunordered_set- std::unordered_setWould you like me to create an issue to track the removal of these redundant includes?
🧬 Code Graph Analysis Results
File: src/llmq/dkgsessionmgr.h
File: src/llmq/dkgsessionhandler.h
File: src/llmq/dkgsession.h
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/dkgsession.cpp
File: src/llmq/signing_shares.h (contextual; not from dkgsession.h)
File: src/llmq/params.h (contextual)
Note: If you want, I can extract and present any of these snippets in full from the provided references, or tailor a focused subset to a specific area of interest (e.g., contribution flow, verification flow, or finalization).
🧠 Learnings used