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.
(For some Reason git closed the old PR while I was force pushing a new version.)
With the current system users can update their vote to a given proposal with the condition that the new vote is sent at least 1 hour after the old vote, this can lead to a possible vulnerability:
Let's consider the following scenario: a malicious node generates and propagates two votes (x,y), with x vote and y time stamp, to the same proposal for example A=(YES, 15:00) and B=(NO, 15:01).
What happens in this case to consensus? There are two possibilities:
If a node receive first the vote A and then the vote B it will accept A and reject B since the time difference is only one minute.
If a node receive first the vote B and then the vote A it will accept B and reject A since the time difference would be -1 minute.
Hence in this scenario nodes will not agree on final votes and this would lead to a fork at the superblock.
With this pull request I want to fix this vulnerability with the following: