This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Move Schedule
from storage to the Config
trait
#8433
Labels
I7-refactor
Code needs refactoring.
Z2-medium
Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
The
Schedule
is a struct that sees a lot of changes to its fields. The main reason is that every new contract callable function needs a new field. For this reason we made its fields private in #8359. Otherwise we would be burning through major version numbers every time we add a new function. This is not enough, though. Because theSchedule
is in storage and also a parameter to theupdate_schedule
dispatchable it is still exposed as a public API.In order to solve this issue we remove the
Schedule
from storage and instead make it configurable through theConfig
type. This will drop the functionality to update theSchedule
without a runtime upgrade, though. I argue that this feature wouldn't be that useful because the weight prices are already automatically adjusted depending on chain utilization. Larger changes would need some code changes in most cases. Any objections @pepyakin ?CurrentSchedule
item from the pallet.Schedule: Get<Schedule>
as an associated type toConfig
debug_println
when called via RPC instead of relying on a genesis config as a toggle.Schedule
fields public in order to allow customization.Making the fields private does not help us with avoiding major version bumps because the public
WeightInfo
trait still needs to change. We just accept the fact that we will have new major version numbers and expect runtimes to bump the version number and re-run benchmarks. Most of the time that will be everything that is to it.Partly fixed by #8359 and #8773
The text was updated successfully, but these errors were encountered: