Skip to content
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 backport #2947

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Dash backport #2947

wants to merge 14 commits into from

Conversation

Duddino
Copy link
Member

@Duddino Duddino commented Nov 6, 2024

No description provided.

codablock and others added 14 commits November 5, 2024 08:40
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
Implement quorum merkle roots for DIP4 coinbases and add quorums to MNLISTDIFF
@Duddino Duddino self-assigned this Nov 6, 2024
@Duddino Duddino marked this pull request as draft November 6, 2024 14:08
@Duddino
Copy link
Member Author

Duddino commented Nov 6, 2024

Depends on #2946

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

Successfully merging this pull request may close these issues.

4 participants