Reduce validationUpgradeFrequency
One of the configuration for parachains is validationUpgradeFrequency
which is currently 14400 blocks (1 day). This means parachains there needs to be at least a day duration between two runtime upgrades for a parachains.
This is a very big limitations for parachain teams. It means if an upgrade is buggy (e.g. missed a migration, breaks transaction version unintentionally, some new feature doesn't work), the fix cannot be applied during this 1 day cooldown period.
While there are many technical reason on why this number cannot be too low, 24 hours was picked as a conservative number when launching the parachain feature. We should be able to reduce this number to a lower value to reduce the cooldown between parachains upgrades.
After a chat with Rob, he suggested we could reduce the cooldown time to 6 hours.
Comments (5)
We do need rate limiting on upgrades, so our devs must choose whatever method looks simplest and most maintainable. If 6 hours works then fine, but if we want faster upgrades then.. We could give parachains one free fast upgrade per 24 to 48 hours, but if they upgrade again too soon then their upgrade still succeeds but we prevent excessive upgrades using methods like: 1) We make the parachain pay for the extra upgrades' CPU time in DOT/KSM at the inflation rate. As a rough estimate, one upgrade consumes the entire network for maybe two slots, so they should burn the DOT/KSM inflation for two slots, like 40 DOTs now but adjusts in future. I'm worried this makes DoS attacking the system too cheap if parachain operators get compromised, especially if this money just comes from the bond, maybe already problematic on Kusama. 2) We pauses their chain for num_validators / 20 = 50 slots or roughly 10 min, under current parameters, which covers the CPU time of all validators to build the extra upgrade. We should ensure this pause approach wont disrupt consensus or messaging somehow. 3) We delay the upgrade being enactable, and optionally delay doing builds, unless the parachain has done few upgrades recently, so zero upgrades in the previous 4 days gives one extra fast upgrade, and zero upgrades in the previous 8 days gives two extra fast upgrades. All the above costs should be increase if upgrades cost more than 12 seconds to build, but we once discussed a 10 second build time limit and I forget what limits get imposed in practice.
How about just a simple credit system? Parachain will gain 1 credit per block. Each upgrade consumes 14400 credit. The max credit could be like 3 * 14400 so parachains can have multiple consecutive upgrades without using too much resources on relaychain. And maybe it can pay X DOT to purchase more credit just in case something really bad happened. But the technical future improvement discussion is better suited on http://github.com/paritytech/polkadot instead of here.