Skip to content

mempool: Reject same block vote double spends. #1597

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

Merged

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 4, 2019

This requires #1595 and #1596.

Currently, the memory pool policy is to allow votes which double spend the same ticket (up to a maximum amount) since it is possible that the same ticket is selected in competing branches and thus the double spend must be allowed and will resolve itself depending on which chain is ultimately extended.

A side effect of that is that it also currently accepts votes with different hashes but otherwise both spend the same ticket and vote on the same block. This can happen when there are multiple wallets casting the vote with different settings such as when one has been upgraded to a new stake version while the others have not or an improperly configured wallet where the vote choices have been set on one, but not the others.

Consequently, this modifies the policy to explicitly reject these duplicate votes while still allowing votes on competing branches.

It also adds tests to ensure the new functionality works as expected.

@davecgh davecgh added this to the 1.5.0 milestone Feb 4, 2019

Verified

This commit was signed with the committer’s verified signature.
davecgh Dave Collins
Currently, the memory pool policy is to allow votes which double spend
the same ticket (up to a maximum amount) since it is possible that the
same ticket is selected in competing branches and thus the double spend
must be allowed and will resolve itself depending on which chain is
ultimately extended.

A side effect of that is that it also currently accepts votes with
different hashes but otherwise both spend the same ticket and vote on
the same block.  This can happen when there are multiple wallets casting
the vote with different settings such as when one has been upgraded to a
new stake version while the others have not or an improperly configured
wallet where the vote choices have been set on one, but not the others.

Consequently, this modifies the policy to explicitly reject these
duplicate votes while still allowing votes on competing branches.

It also adds tests to ensure the new functionality works as expected.
@davecgh davecgh force-pushed the mempool_reject_same_block_vote_double_spends branch from 253763f to 457a797 Compare February 8, 2019 10:52
@davecgh davecgh merged commit 457a797 into decred:master Feb 8, 2019
@davecgh davecgh deleted the mempool_reject_same_block_vote_double_spends branch February 8, 2019 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants