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

fix/Do not vote for the same validators list twice #2443

Merged

Conversation

carpawell
Copy link
Member

Closes #2365.

@carpawell
Copy link
Member Author

@AnnaShaleva, @roman-khimov, ping me if you think that we need to make it more accurate with GetNextBlockValidators or even with GetAccountState (and check whether an alphabet contract has voted for the required validator).

@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #2443 (7fc3c93) into master (782f658) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

❗ Current head 7fc3c93 differs from pull request most recent head 1eb6273. Consider uploading reports for the commit 1eb6273 to get more accurate results

@@            Coverage Diff             @@
##           master    #2443      +/-   ##
==========================================
- Coverage   29.47%   29.43%   -0.04%     
==========================================
  Files         399      399              
  Lines       30381    30410      +29     
==========================================
- Hits         8954     8952       -2     
- Misses      20684    20715      +31     
  Partials      743      743              
Files Changed Coverage Δ
pkg/innerring/state.go 0.00% <0.00%> (ø)
pkg/morph/client/client.go 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

pkg/innerring/state.go Outdated Show resolved Hide resolved
@carpawell carpawell marked this pull request as draft July 18, 2023 15:53
@carpawell carpawell force-pushed the fix/do-not-vote-for-committee branch 2 times, most recently from e77a8d1 to d0fe1b5 Compare July 24, 2023 18:28
@carpawell carpawell marked this pull request as ready for review July 24, 2023 18:31
pkg/morph/client/client.go Outdated Show resolved Hide resolved
pkg/morph/client/client.go Outdated Show resolved Hide resolved
@carpawell carpawell force-pushed the fix/do-not-vote-for-committee branch 3 times, most recently from 303ab1d to 8467193 Compare July 25, 2023 14:53
@@ -419,6 +421,30 @@ func (c *Client) IsValidScript(script []byte, signers []transaction.Signer) (res
return result.State == vmstate.Halt.String(), nil
}

// AccountVote returns a key the provided account has voted with its NEO
// tokens for. Nil key with no error is returned if the account has no NEO.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nil key with no error is returned if the account has no NEO or when account has some NEO and didn't voted for anyone.

It returns a vote made by a NEO holder. Does not cache NEO contract reader
cause its creation needs no network and the whole `morph.Client` is likely
to be refactored soon.

Signed-off-by: Pavel Karpy <[email protected]>
@carpawell carpawell force-pushed the fix/do-not-vote-for-committee branch from 8467193 to 1eb6273 Compare July 27, 2023 12:34
@roman-khimov roman-khimov merged commit 12e8b08 into nspcc-dev:master Jul 27, 2023
7 of 8 checks passed
@carpawell carpawell deleted the fix/do-not-vote-for-committee branch July 28, 2023 08:33
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.

Do not vote for the same node on IR start
3 participants