-
Notifications
You must be signed in to change notification settings - Fork 745
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
Only one/few collators building blocks if parachain is underscheduled #6667
Comments
This does not sound like something we need to solve. Your problem statement assumes that we only have 3 collators. As soon as the slot_duration / core_count / collator_count does not match up anymore, someone else will author (e.g. in your example, if we have collator D and E, someone else will author). Same could happen if we have no elastic scaling but are only scheduled on a core every x blocks. |
Indeed it depends on this correlation. But we don't have any restriction AFAIK on the exact number of collators a parachain should have. So basically it seems a problem if the number of expected cores is a divisor of the number of collators
Agreed, but in my view this is another reason why this should be solved. Doesn't sounds too good if a core-sharing parachain that has one assignment every 5 blocks and 5 collators only uses one of the collators to author (which is a realistic scenario, right?). What if that one collator is down? Even if it's not, it will be reaping all of the block authoring rewards or could pick which transactions to include |
Fair enough, I think we can keep the issue open but I don't see it as high priority for now. |
Yeah, low priority for now, but will become higher once we have a implemented a transaction streaming solution. As for the solution, I think some flavor of @eskimor's proposal in #4813 is a good fix for the problem. The gist of it relevant to this issue here is in the |
Good catch and indeed one more reason to not decrease slot times too much, but instead let one collator build all the blocks for a given relay block. |
What about the case with core-sharing? I think this needs a separate solution |
Assume using the slot-based collator and a parachain with slot duration of 2 seconds.
In order to fully take advantage of elastic scaling, the parachain should have 3 cores scheduled at all times.
But what happens if it doesn't, for some reason (by accident or just the parachain decides to scale down based on lower demand)?
In this case, only one collator will be authoring blocks, which is not good.
This is because:
Collator A builds the first block.
Collator B's slot kicks in, but collator A already built a block for this core. So go back to sleep.
Collator C's slot kicks in, but collator A already built a block for this core. So go back to sleep.
Collator A's slot kicks in, there's a new relay chain block and a new opportunity to build a new block.
In the end, only collator A will builds blocks.
This can be fixed by having some dynamic slot duration based on the amount of scheduled cores.
CC: @sandreim @skunert
The text was updated successfully, but these errors were encountered: