-
Notifications
You must be signed in to change notification settings - Fork 300
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
multi: No stake height checks in check tx inputs. #1457
Merged
davecgh
merged 1 commit into
decred:master
from
davecgh:blockchain_no_stake_enable_height_checks_check_tx_inputs
Sep 14, 2018
Merged
multi: No stake height checks in check tx inputs. #1457
davecgh
merged 1 commit into
decred:master
from
davecgh:blockchain_no_stake_enable_height_checks_check_tx_inputs
Sep 14, 2018
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
Test results from
|
62de5d1
to
736ffc4
Compare
dnldd
approved these changes
Sep 14, 2018
736ffc4
to
2c49d38
Compare
matheusd
approved these changes
Sep 14, 2018
This removes a redundant check for validating that votes and revocations are not in a block before they are allowed from CheckTransactionInputs since it has nothing to do with validation of transaction inputs and it's an impossible condition to hit in the block validation path because the same check is done much earlier in the validation process. It should also be noted that the checks this removes are also more permissive than they need to be because the first vote is not allowed until stake validation height, which is after stake enabled height. There is no effect on consensus because, as previously mentioned, the more restrictive checks earlier in the process prevent these checks from ever being exercised. However, the mempool previously relied on this duplicate check to reject early votes and revocations, so this adds the checks, with the corrected heights, directly to the mempool early in the process where they more naturally belong. It is more efficient to reject the transactions in that scenario earlier before doing more work as well.
alexlyp
approved these changes
Sep 14, 2018
2c49d38
to
b6c088d
Compare
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.
This relies on #1456.
This removes a redundant check for validating that votes and revocations are not in a block before they are allowed from
CheckTransactionInputs
since it has nothing to do with validation of transaction inputs and it's an impossible condition to hit in the block validation path because the same check is done much earlier in the validation process.It should also be noted that the checks this removes are also more permissive than they need to be because the first vote is not allowed until stake validation height, which is after stake enabled height. There is no effect on consensus because, as previously mentioned, the more restrictive checks earlier in the process prevent these checks from ever being exercised.
However, the
mempool
previously relied on this duplicate check to reject early votes and revocations, so this adds the checks, with the corrected heights, directly to themempool
early in the process where they more naturally belong. It is more efficient to reject the transactions in that scenario earlier before doing more work as well.This is work towards #1145.