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
[Core] CheckColdStakeFreeOutput: skip SPORK checks if mnsync incomplete #1331
Merged
furszy
merged 1 commit into
PIVX-Project:master
from
random-zebra:2020_mnsync-checkmain
Feb 17, 2020
Merged
[Core] CheckColdStakeFreeOutput: skip SPORK checks if mnsync incomplete #1331
furszy
merged 1 commit into
PIVX-Project:master
from
random-zebra:2020_mnsync-checkmain
Feb 17, 2020
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
Fuzzbawls
approved these changes
Feb 13, 2020
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.
good catch
utACK bd62481
furszy
approved these changes
Feb 17, 2020
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 bd62481
furszy
added a commit
that referenced
this pull request
Feb 17, 2020
…sync incomplete bd62481 [Core] CheckColdStakeFreeOutput: skip SPORK checks if mnsync incomplete (random-zebra) Pull request description: Currently `CheckBlock` skips the masternode (or budget) payment check in coinstakes when `IsInitialBlockDownload()` returns true (essentially when the current best block time is older than nMaxTipAge seconds). Since, in order to verify the block payee, the masternode list needs to be up to date, `IsBlockPayeeValid`also skips the checks when mnsync has not finished. `CheckColdStakeFreeOutput` however, does not, so, when the spork list is not updated, SPORK_13 and SPORK_9 cannot be verified (in case of budget payment blocks) resulting in CheckBlock failures with ``` ERROR: CheckColdStakeFreeOutput: Wrong cold staking outputs: ``` (Unless the user doesn't manually set a lower nMaxTipAge to force IsInitialBlockDownload to true). This fixes it. ACKs for top commit: Fuzzbawls: utACK bd62481 furszy: utACK bd62481 Tree-SHA512: aa52ac0c9bc597d7bceec88924fd6f264aa3588915eb1052dd28f32e133d16d2ab6527a67ef90004619c08fd613adf9f4c69bb1ee30dfd2fe2529862b39669c9
random-zebra
added a commit
that referenced
this pull request
Mar 25, 2020
…plete aa5dc7b [Consensus] Strict check amounts in CCSFO for mnsync incomplete (random-zebra) d6a1060 [Consensus] CheckColdStakeFreeOutput when mnsync not complete (random-zebra) Pull request description: Follow up to #1331 for the same bug. **Problem:** if the finalized budgets and the masternode list are not synchronized, the output returned from `IsBudgetPaymentBlock` is unreliable. For the moment we fix it by checking that the sum of the stake input value and block reward is at least equal to the sum of the values of non-free outputs. A better approach, for the future, would be probably to outright prevent any call to `CheckBlock` when `IsInitialBlockDownload` is false but mnSync is not fully completed yet. Top commit has no ACKs. Tree-SHA512: cd2e765b865172a55bd8b05d132d356078b1956da6449c819ebdcedd1291d412fdf4249ac5e0d1e7db808c9c3543451df085791ed743e7441618368a07fad6c6
akshaynexus
pushed a commit
to ZENZO-Ecosystem/ZENZO-Core
that referenced
this pull request
Mar 30, 2020
…sync not complete aa5dc7b [Consensus] Strict check amounts in CCSFO for mnsync incomplete (random-zebra) d6a1060 [Consensus] CheckColdStakeFreeOutput when mnsync not complete (random-zebra) Pull request description: Follow up to PIVX-Project#1331 for the same bug. **Problem:** if the finalized budgets and the masternode list are not synchronized, the output returned from `IsBudgetPaymentBlock` is unreliable. For the moment we fix it by checking that the sum of the stake input value and block reward is at least equal to the sum of the values of non-free outputs. A better approach, for the future, would be probably to outright prevent any call to `CheckBlock` when `IsInitialBlockDownload` is false but mnSync is not fully completed yet. Top commit has no ACKs. Tree-SHA512: cd2e765b865172a55bd8b05d132d356078b1956da6449c819ebdcedd1291d412fdf4249ac5e0d1e7db808c9c3543451df085791ed743e7441618368a07fad6c6
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.
Currently
CheckBlock
skips the masternode (or budget) payment check in coinstakes whenIsInitialBlockDownload()
returns true (essentially when the current best block time is older than nMaxTipAge seconds).Since, in order to verify the block payee, the masternode list needs to be up to date,
IsBlockPayeeValid
also skips the checks when mnsync has not finished.CheckColdStakeFreeOutput
however, does not, so, when the spork list is not updated, SPORK_13 and SPORK_9 cannot be verified (in case of budget payment blocks) resulting in CheckBlock failures with(Unless the user doesn't manually set a lower nMaxTipAge to force IsInitialBlockDownload to true).
This fixes it.