[Cirrus] Don't vote on old polls#709
Closed
quantumagi wants to merge 5 commits intostratisproject:release/1.1.0.0from
Closed
[Cirrus] Don't vote on old polls#709quantumagi wants to merge 5 commits intostratisproject:release/1.1.0.0from
quantumagi wants to merge 5 commits intostratisproject:release/1.1.0.0from
Conversation
Contributor
Author
|
The only "drawback" is that if a vote for given voting data does not complete within 10,000 blocks it can no longer be repeated/continued later on. This situation will remain in effect until we add the poll expiry mechanism. |
fassadlr
reviewed
Sep 15, 2021
| /// <remarks>All access should be protected by <see cref="locker"/>.</remarks> | ||
| private void CleanFinishedPollsLocked() | ||
| { | ||
| bool TooOldToVoteOn(Poll poll) |
Contributor
There was a problem hiding this comment.
Can you maybe add a comment here to say why we are including these?
fassadlr
reviewed
Sep 15, 2021
| // the action (removes the hash) and then reapplies it again. To allow for this scenario we have to exclude | ||
| // executed polls here. | ||
| List<Poll> finishedPolls = this.polls.Where(x => !x.IsPending && !x.IsExecuted).ToList(); | ||
| List<Poll> finishedPolls = this.polls.Where(x => TooOldToVoteOn(x) || (!x.IsPending && !x.IsExecuted)).ToList(); |
Contributor
There was a problem hiding this comment.
Can we add a info log here
To say why the vote is being excluded?
Contributor
Author
There was a problem hiding this comment.
I suggest we make it a debug log because I think it's going to pop up more than expected until such time as expiry is implemented.
fassadlr
approved these changes
Sep 16, 2021
Contributor
fassadlr
left a comment
There was a problem hiding this comment.
@quantumagi please hold off on merging whilst I'm testing on CirrusTest.
Contributor
Author
|
This is included in PR #707. |
This file contains hidden or 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
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.
See https://app.clickup.com/t/a11fjz.