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

Avoid ZeroCollators error in solochains #708

Merged
merged 4 commits into from
Oct 2, 2024

Conversation

tmpolaczyk
Copy link
Contributor

In dancebox, the pallet_collator_assignment has a check to ensure that we never return an assignment with 0 collators, because that would brick the chain. But in dancelight, that's not a problem because validators are stored in another pallet. So we can safely handle the case of 0 collators, by returning an empty assignment.

So we will no longer see this log when starting a dancelight node:

2024-10-01 17:03:07 Error in collator assignment, will keep previous assignment. ZeroCollators    

Also add tests to ensure this doesn't panic.

Copy link
Collaborator

@girazoki girazoki left a comment

Choose a reason for hiding this comment

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

thank you @tmpolaczyk looks good to me

@tmpolaczyk tmpolaczyk added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade 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 Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

Coverage Report

(master)

@@                         Coverage Diff                         @@
##           master   tomasz-zero-collators-solochain      +/-   ##
===================================================================
+ Coverage   66.66%                            66.70%   +0.04%     
  Files         297                               297              
+ Lines       51830                             51893      +63     
===================================================================
+ Hits        34551                             34613      +62     
+ Misses      17279                             17280       +1     
Files Changed Coverage
/solo-chains/runtime/dancelight/src/lib.rs 66.67% (-0.06%) 🔽

Coverage generated Wed Oct 2 11:20:18 UTC 2024

@tmpolaczyk tmpolaczyk merged commit b883104 into master Oct 2, 2024
38 checks passed
@tmpolaczyk tmpolaczyk deleted the tomasz-zero-collators-solochain branch October 2, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade 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.

2 participants