Remove ValidateMasternodeWinner in favour of IsTransactionValid - #58
Open
kerryoncrypto wants to merge 1 commit into
Open
Remove ValidateMasternodeWinner in favour of IsTransactionValid#58kerryoncrypto wants to merge 1 commit into
kerryoncrypto wants to merge 1 commit into
Conversation
Contributor
|
Thank you for bringing this to attention. Reusing existing code certainly would be better. But in this case The best approach would be a combination of both checking a wide set of masternodes and enforcing masternode tiers. We will have to check if |
Author
|
Oh, you're right! I've missed this fact about the tiered MNs... |
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
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.
Hello Telos-Team,
I know this PR will be a bit hard as you have spent much work for
CMasternodePayments::ValidateMasternodeWinner()so far, but there is already such functionality on the source-code that just have to used the right way.This PR removes
CMasternodePayments::ValidateMasternodeWinner()from the code and re-arms theCMasternodePayments::IsTransactionValid()-Check with yourSPORK_17_MASTERNODE_PAYMENT_CHECK-Spork.Just like
ValidateMasternodeWinner()assuresIsTransactionValid()that there is a masternode-payment on the stake-transaction and has the right value spent. But in contrast to your implementation it is a bit more vague on the masternode that has to be paid. Your implementation requires that one specific masternode is paid which implies that the masternode-assets have to be the same on every node validating this transaction. As the number of masternodes grows and the synchronization-process is a bit laggy this is something that cannot be guaranteed and therefore should be avoided.IsTransactionValidadds a bit fuzz and allows a wider set of masternodes to be paid and therefore is likely to fail less. The function is taken from PIVX-upstream, used by most other masternode-coins and can be assumed to be safe - at least it's safe to assume that the payee is a valid masternode.I'm looking forward for your feedback!
P.S.: It would be better to have this done via the already present but unused spork-key-mechanism (see
SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT), but for the moment this PR is more like the update you intended first.