[FRAME/Meta/PM] "experimental" FRAME
features #14345
Description
Analogous to the deprecation process it would be nice to have an on-ramp for new features in FRAME.
This could be used to introduce new feature in a non-semver way, so that we can start integrating them before stabilizing the design.
I think it could increase our development velocity since we can iterate quicker on features without having to worry too much of breaking downstream. Currently I often try to keep breaking changes to a minimum - even when a feature is not used outside of Parity yet…
Possible implementations
There were some internal discussions about how to achieve this. Some ideas:
- A) Some attribute macro like
frame_unstable(id)
or similar and a matchingallow_unstable(id)
whereID
is the identifier of the issue, similar to rust nightly features. This would be the more fine-grained and elegant solution - although not sure how achievable without something like allow(deprecated) is too coarse-grained, should take a path rust-lang/rust#62398 - B) Rust compiler features where we have one feature that guards all unstable features. This would need to be propagated to all dependencies… we already have enough problems just from
try-runtime
andruntime-benchmarks
though. - C) Simplest would be to have a
frame_support::unstable
module, that export all unstable types. Or in the future justframe::unstable
. The unstable features should not be accessible through another path. We can do this inframe_support
since the modules can be madepub(super)
, such that theunstable
module can export them.
Inside of pallets we have more control and could opt for a better DevEx. For example with the upcoming Task API we could mark that as unstable and emit a warning that can be silenced through pallet(unstable)
or something.
Process
Without making this too cooperate-style bureaucratic I think we should still have some kind of process. For example:
- Put new non-trivial traits and types, where future changes are expected, into the
unstable
module. For example we could use that for the VersionedRuntimeUpgrade or theMulti Block Migrations
. - Start integrating the feature to discover sharp edges and improvements.
- Set a deadline for further changes and move it out to the normal FRAME crates afterwards.
- Maybe announce the feature somehow.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status