forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Dash LLMQ backports #2946
Merged
Fuzzbawls
merged 13 commits into
PIVX-Project:master
from
panleone:dsah_llmq_backports_4
Nov 9, 2024
Merged
Dash LLMQ backports #2946
Fuzzbawls
merged 13 commits into
PIVX-Project:master
from
panleone:dsah_llmq_backports_4
Nov 9, 2024
Conversation
This file contains 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
When ProcessMessageBatchedSigShares returns false, it's interpreted as if an invalid/malicious message was received, causing a ban. So, we should return "!ban" instead of just "ban".
The local node might be the bad one actually as it might not have catched up with the chain. In that case, LLMQs might be different for the sending and receiving node.
Don't pass CEvoDB to CDKGSessionHandler and CDKGSession Was never used. Introduce global llmq::llmqDb instance of CDBWrapper This DB is for LLMQ related data that is not part of on-chain consensus. This for example included LLMQ secret key shares and recovered signatures. Don't use CEvoDB in CDKGSessionManager and instead use llmqDb Contributions are not part of on-chain consensus and shouldn't be stored in CEvoDB. Use llmqDb for CRecoveredSigsDb Instead of creating its own CDBWrapper internally. Add key prefix to "rs_" for CRecoveredSigsDb keys This avoids future conflicts with other data stored in llmqDb Add HasVotedOnId/GetVoteForId to CSigningManager These just pass through to CRecoveredSigsDb Use unordered_lru_cache in CRecoveredSigsDb
* use AssertLockHeld(cs) instead of relying on comments * actually use `clsig` in `EnforceBestChainLock()` * fix log output in `EnforceBestChainLock()` * drop comments
* Move ChainLock signing into TrySignChainTip and call it periodically * Cheaper/Faster bailout from TrySignChainTip when already signed before
* Print which DKG type aborted * Don't directly call EnforceBestChainLock and instead schedule the call Calling EnforceBestChainLock might result in switching chains, which in turn might end up calling signals, so we get into a recursive call chain. Better to call EnforceBestChainLock from the scheduler. * Regularly call EnforceBestChainLock and reset error flags on locked chain * Don't invalidate blocks from CChainLocksHandler::TrySignChainTip As the name of this method implies, it's trying to sign something and not enforce/invalidate chains. Invalidating blocks is the job of EnforceBestChainLock. * Only call ActivateBestChain when tip != best CL tip * Fix unprotected access of bestChainLockBlockIndex and bail out if its null * Fix ChainLocks tests after changes in enforcement handling * Only invoke NotifyChainLock signal from EnforceBestChainLock This ensures that NotifyChainLock is not prematurely called before the block is fully connected. * Use a mutex to ensure that only one thread executes ActivateBestChain It might happen that 2 threads enter ActivateBestChain at the same time start processing block by block, while randomly switching between threads so that sometimes one thread processed the block and then another one processes it. A mutex protects ActivateBestChain now against this race. * Rename local copy of bestChainLockBlockIndex to currentBestChainLockBlockIndex * Don't call ActivateBestChain when best CL is part of the main chain
* Add support for log category to CBatchedLogger * Use "llmq" logging category in LLMQ code * Use "chainlocks" logging category in ChainLocks code * Log errors without logging category
… be sent (PIVX-Project#2783) * Introduce "qsendrecsigs" to indicate that plain recovered sigs should be sent Full nodes, including masternodes, will send this message automatically. Other node implementations (e.g. SPV) are usually not interested and would not send this message. * Use std::atomic<bool> instead of std::atomic_bool Not related to this PR, but a small enough change to include it here as well.
…UTH peers (PIVX-Project#2798) * Pass CNode* to IsMasternodeQuorumNode and let it also check verifiedProRegTxHash This makes IsMasternodeQuorumNode return true on incoming peer connections as well. * Let GetMasternodeQuorumNodes also take verifiedProRegTxHash into account This makes it return NodeIds for incoming peer connections as well. * Remove AddParticipatingNode and the need for it This was needed in the past when we were unable to identify incoming connections from other quorum members. Now that we have MNAUTH, we can easily identify all connected members. * Don't track interestedIn quorums in CSigSharesNodeState anymore Same as with the previous commit, we're now able to easily identify which nodes to announce sig shares to. * Remove unused CConnman::GetMasternodeQuorumAddresses
Duddino
approved these changes
Nov 6, 2024
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 901976a
Consistent with upstream changes
Draft
Liquid369
approved these changes
Nov 6, 2024
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 901976a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
each commit backports a different PR. The PR number is in the commit message.
There are also 3 extra (trivial) commits added by me