This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Try not eating into the slot (performance/block times) #5522
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.
Results on a loaded Versi (300 parachain validators, ~40 parachains):
Yellow area (5522-257c9d4d) : strict slots - when paras_inherent asks, we deliver.
Blue area (master-d5f16df7): Back to master with eating into slots
Purple area (5522-e13b16c4): Strict slots + unbounded send provisioner -> backing
Red area (5522-cf43dc6a): Strict slots + unbounded send proisioner -> backing + extended bitfield gossip duration
Full experiment
If you consider how much block times fluctuate within those areas, it becomes clear that for current Versi there is no significant difference between those setups.
It has to be noted that Versi was very loaded in this setup, mostly because of a overwhelmed dispute coordinator - it might make sense to repeat this experiment with a fixed dispute coordinator.
For why it makes no difference at all (strict slots vs. eating into a slot): I would expect relay chain blocks to be rather small and to propagate fast on Versi, meaning the eating into the slot likely never happens on Versi. We should probably add a metric triggering whenever we are eating into a slot, to confirm/disprove this. Another explanation would be, that it does not matter on Versi, because we only have toy parachains on Versi, no real load, no runtime upgrades, no message passing, networking is fast, ...
Why I am experimenting with strict slots in the first place is argued here ... I would expect this to make a difference on real networks, like Kusama, replicated here for completeness:
We might be able to get better properties, by being more strict and not cutting into the next slot.
This way, if a parachain does something that is slow (e.g. just big PoVs or issuing a runtime uprade), the following will happen:
This means after a slot with little time, we will have more time in the next slot. This even scales a bit, the less time we have now, the more we will have the next (because the block will be smaller).
So in my mind, by being stricter we might be able to help avoid long stalls and also in general end up with a better distributed load, which should also be beneficial to the system performance.
With the current scheme the following happens:
A parachains does something slow:
We will need to have a long sequence of small relay chain blocks for this to recover eventually, but the moment the parachain makes it, we will have a big block again and the game starts anew.
Those are some late night thoughts, but to me that sounds like a promising experiment: Don't eat into the slot.