Closed ggwpez closed 1 year ago
unstable
module seems like the most reasonable path forward for now. frame_support::unstable::pallet_prelude
, but once paritytech/substrate#14137 is done, it can be neatly packaged in that.frame::unstable
is being used, and if so, raise a warning. unstable doesn’t means insecure right? if that’s the case, why do we need warnings? you need to implicitly import from unstable module to use it and I think that’s enough
I think it's more like "could change at any time"
Maybe the word "experimental" would be better
- something like an
unstable
module seems like the most reasonable path forward for now.
How should this work for things that require changes to any Config
trait?
IMO, as annoying as features can be, they are probably the best way forward.
IMO, as annoying as features can be, they are probably the best way forward.
Yeah I agree that unless this is only occurring within pallets, in which case we have outer macro pattern powers and can make up a syntax, something like a feature is unfortunately our best bet.
If we're doing features, IMO an easy albeit backwards way to do this is to mark all the experimental things as deprecated, with a deprecation message saying they are experimental, but if the experimental
feature is present, we don't emit the deprecation attribute.
So to opt in to using something experimental, you simply enable the experimental feature and now you won't get deprecation warnings on any of those things.
A simpler approach ofc is to just only emit those things if the experimental feature is present, but doing it this way might aid easier discovery of experimental features while they are still being worked on, which is something that I think we want
Please don't abuse deprecation message. Only mark deprecated features deprecated.
unstable doesn’t means insecure right? if that’s the case, why do we need warnings? you need to implicitly import from unstable module to use it and I think that’s enough
Independently of whether we go for the features or the modules solution, this is a very good point and it would simplify things. I guess it was meant read explicitly import, in this or in the features case the developer is already aware of the experimental
feature.
Maybe the word "experimental" would be better
+1 on this one, it sounds less scary
Having thought about this a bit, I am leaning toward backing using a feature flag for this.
Having thought about this a bit, I am leaning toward backing using a feature flag for this.
Yes, me too, I think it's the best way to go.
And consensus seems to be we call it "experimental" instead of "unstable"
So its settled then; we use an experimental
feature that is never enabled per default.
We can even apply this to pallets and non-FRAME crates :tada:
We could use https://github.com/paritytech/substrate/pull/14311 as an example to try it out.
I believe we need to update the Substrate CI to run experimental tests? It seems that the test CI is configured outside of this repo, what's the way to go about tweaking that?
No, the CI is configured in here: https://github.com/paritytech/substrate/blob/master/scripts/ci/gitlab/pipeline/test.yml
There you will need to change/add a new job.
@juangirini @ggwpez @paritytech/frame-coders any reason to not close this?
@ggwpez https://github.com/paritytech/substrate/pull/14311 should have close this issue, right? or is there anything else that you want to do?
Yea it should be good. There were some follow up discussions on how to separate feature-gates and modules, but we can reopen it then.
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:
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 https://github.com/rust-lang/rust/issues/62398try-runtime
andruntime-benchmarks
though.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:
unstable
module. For example we could use that for the VersionedRuntimeUpgrade or theMulti Block Migrations
.cc @kianenigma @sam0x17 @juangirini