-
Notifications
You must be signed in to change notification settings - Fork 1.2k
governance: add threading annotations, add default values, adjust constructors #4465
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
governance: add threading annotations, add default values, adjust constructors #4465
Conversation
|
I don't understand these test failures... Help wanted :) |
4b39759 to
a01374a
Compare
UdjinM6
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.
mac build fails https://gitlab.com/dashpay/dash/-/jobs/1631527804
a01374a to
97c3c7a
Compare
|
We'll see how the mac build likes that. Pay special attention to 21abbc7 (will try to resolve todo in a near future PR), would like your feedback / ensure I'm not crazy when it comes to livecycles / saftey there |
|
This pull request has conflicts, please rebase. |
|
This pull request has conflicts, please rebase. |
|
rebased |
97c3c7a to
bcf64f9
Compare
|
I figured e80b67f would resolve these compilation errors, but I guess I'm missing something... |
|
This pull request has conflicts, please rebase. |
458532e to
8d5c586
Compare
UdjinM6
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.
mac build complains (werror) + see below
| void CGovernanceObject::UpdateLocalValidity() | ||
| { | ||
| LOCK(cs_main); | ||
| LOCK(cs); |
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.
👀
| return false; | ||
| } | ||
| if (fCheckCollateral && !IsCollateralValid(strError, fMissingConfirmations)) { | ||
| if (fCheckCollateral && !WITH_LOCK(cs_main, return IsCollateralValid(strError, fMissingConfirmations))) { |
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.
that's probably a deadlock
| // RETRIEVE TRANSACTION IN QUESTION | ||
|
|
||
| if (!GetTransaction(nCollateralHash, txCollateral, Params().GetConsensus(), nBlockHash)) { | ||
| if (LOCK(cs); !GetTransaction(nCollateralHash, txCollateral, Params().GetConsensus(), nBlockHash)) { |
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.
- that's also a deadlock potentially
- cs should be held already as per
EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main)in .h, maybe addAssertLockHelds for both locks at the start of the method
| govobj.GetDataAsPlainString(), govobj.GetObjectType()); | ||
|
|
||
| if (govobj.GetObjectType() == GOVERNANCE_OBJECT_TRIGGER && !triggerman.AddNewTrigger(nHash)) { | ||
| if (govobj.GetObjectType() == GOVERNANCE_OBJECT_TRIGGER && !WITH_LOCK(governance.cs, return triggerman.AddNewTrigger(nHash))) { |
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.
for all governance.cs locks for triggerman here and below in this file - we hold cs already, no need to lock twice (I know you did this to silence werror probably but it feels like a wrong way to fix it)
|
This Pull Request may conflict if the Pull Requests below are merged first. #4649 |
|
This pull request has conflicts, please rebase. |
No description provided.