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 collators not producing blocks when selected candidates is zero #2231

Merged
merged 6 commits into from
Apr 21, 2023

Conversation

tmpolaczyk
Copy link
Contributor

What does it do?

Fix collators not producing blocks when selected candidates is zero.

What important points reviewers should know?

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

@tmpolaczyk tmpolaczyk added B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit not-breaking Does not need to be mentioned in breaking changes labels Apr 14, 2023
@crystalin crystalin requested a review from girazoki April 14, 2023 15:16
@girazoki girazoki requested a review from librelois April 14, 2023 15:23
@girazoki
Copy link
Collaborator

girazoki commented Apr 14, 2023

I'm unsure whether I am missing something, so I would like to see a test proving this. Also adding @librelois to the review. I think the pr is correct though

The proposed test should: potentially insert manually candidates with less than minStk on storage, go to a round session change, and call this runtime API. I think this would prove that the we are doing correct things

@tmpolaczyk
Copy link
Contributor Author

Added test for the generic case when compute_top_candidates returns an empty vec, by doing:

  • Initialize candidate pool with only Alice as a collator
  • Make Alice call go_offline, resulting in no candidates
  • Ensure that Alice still can author blocks

@tmpolaczyk tmpolaczyk merged commit fb0c237 into master Apr 21, 2023
@tmpolaczyk tmpolaczyk deleted the tomasz-zero-candidates branch April 21, 2023 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit not-breaking Does not need to be mentioned in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants