Skip to content

Conversation

@random-zebra
Copy link

Bug introduced in #2308.
We are considering the total masternode count, inclusive of deterministic masternodes, only in GetNextMasternodeInQueueForPayment, but not in other places.
Fix this by updating directly the function CountEnabled, using the legacy-only count exclusively for the masternode list sync.

@random-zebra random-zebra added this to the 6.0.0 milestone Sep 21, 2021
@random-zebra random-zebra self-assigned this Sep 21, 2021
except when dealing with mnsync (only legacy list is synced via P2P)
CountEnabled is being called while holding CMasternodeMan::cs, by
SecondsSincePayment, and it locks CDeterministicMNManager::cs to get the
deterministic manager's tip height.
Pass the enabled masternode count to SecondsSincePayment, directly from
the caller, so the two locks are not held at the same time.
Since the count must always remain 0 when the legacy system is obsolete
@random-zebra random-zebra force-pushed the 202109_dmn_count_enabled branch from 0ca2ad7 to 52b7b9b Compare September 23, 2021 15:18
@random-zebra random-zebra force-pushed the 202109_dmn_count_enabled branch from 52b7b9b to 4e89bb2 Compare September 23, 2021 16:07
@random-zebra
Copy link
Author

Rebased.

@random-zebra random-zebra modified the milestones: 6.0.0, 5.4.0 Sep 23, 2021
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice discovery streak 👌. Several issues caught and solved at once :).
Reviewed up to 2730521

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 0f5064f with a topic.

About 4e89bb2:
From a readability perspective, what do you think about moving the IsMNValid function inside the DMN class instead of completely removing it?

When i read it, the first time, it was not so clear that IsMNPoSeBanned had the same meaning.
(maybe could even not call it "valid" and use "enabled" wording instead).

@furszy
Copy link

furszy commented Sep 29, 2021

Changed my mind after having a convo about it with zebra, all good over the IsMNPoSeBanned/IsMNValid topic.

@furszy furszy requested a review from Fuzzbawls September 29, 2021 20:53
Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code/Tests ACK 0f5064f

@furszy furszy merged commit 6472774 into PIVX-Project:master Oct 1, 2021
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.

3 participants