Skip to content
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

gitbe: Duplicate votes in the votes journal #882

Closed
lukebp opened this issue May 17, 2019 · 2 comments · Fixed by #873
Closed

gitbe: Duplicate votes in the votes journal #882

lukebp opened this issue May 17, 2019 · 2 comments · Fixed by #873
Assignees

Comments

@lukebp
Copy link
Member

lukebp commented May 17, 2019

15 duplicate votes made it into the votes journal of the Decentralized Treasury Spending proposal. The bug that allowed for this has existed since Politeia launched, but this is the first time that any duplicate votes made it into the politeiad git repo for any proposal. politeiad replays all vote journals on startup and explicitly checks for duplicate votes. This allowed for the bug to be caught as soon a the first duplicate vote made it into the repo.

politeiad has a memory cache of all cast votes. When a user casts a vote, politeiad checks the memory cache to see if the vote already exists. If it does not exist, the vote is writen to the votes journal then added to the memory cache. This memory cache read/write operation was not atomic. If a user submitted the same vote request multiple times, concurrently, it was possible for a duplicate vote to be added to the votes journal before the memory cache was properly updated.

[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 01d884b7d4dc548440248c0c84c70e8316e27249266a84f92e24514c3c4ef8fe
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 23dc9e4434000e858079936cb8754b89cbaec0717a62074e286bfe7361d0ddfd
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 577b5ef6f05cf15345f4956a0dbca4146e9e0a5fa8eb7e6e5148b58d8d068bc8
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 5bddf520ab2eaceacaab73322974836f08ecf3d106bafd7853af9e462b7f564d
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 6e52eef236550cbcb9a9be8d595e83ae2a2f565abc7f0841847b9c22e0f7a575
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 6fd47a131f25dc9895ec2143fb1bce18ed73ed69fa60fe738752f199ee6d476b
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 7b9c16f3e196bf9dd0c2a964a280e7b217cc9e5ac1cc094242a437d9b37abd17
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 8ec22a3f2ab0e484f901dd10b6131e55bf75faba4e0fdaf2ab563807707f4ebb
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 92d2b1c82314b34d3a2a4346a50590de584c984f39ca0d3c3d6f866ff685359e
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f 9da7a19050bbc85dde91e90404c4a17c2c7c92bc1fea16faeedee71dc00f5b1c
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f a7dfc88441b8e8586973d124003fbe4b2d249ded70d2e57d5f6f5b9c9240d15a
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f ad88536e164805f238341a93d32ff9f9ab248b1385a7b7b290c1a0c5013f0b5f
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f b62023bdd1c00988986644e253aa6562c63bb9beb79632688e6eb8fd921dec2e
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f bc5916318baddc15b4ac1165edca098868d01df03c888bebdb683d4a5ec24688
[ERR] GITB: duplicate cast vote c96290a2478d0a1916284438ea2c59a1215fe768a87648d04d45f6b7ecb82c3f e62159acf2fe707287dbd5378cbe1de9e509783e1ef682a0b679c5247f57cf04
@xaur
Copy link

xaur commented Jul 8, 2019

What's the impact of those 15 duplicates that made it into the repo? Are they simply discarded from the score calculation?

@xaur
Copy link

xaur commented Jul 8, 2019

Found an answer to my previous question in #893 :

Removing this query does mean that the 15 duplicate votes that made it into the "Decentralize Treasury Spending" proposal vote journal will be added to the cache and reflected in the vote total. I don't consider this to be a huge issue since the proposal passed with a 97.49% approval rating. Documenting the 15 duplicate votes in the Politeia Digest and Decred Journal should be sufficient.

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 a pull request may close this issue.

2 participants