Replies: 4 comments 7 replies
-
So in a way we actually want two runtimes to be built .... One stable one and the staging one with an incremented version number. Stable will be the default (native) and we can upgrade test networks to the staging one via sudo and see whether it works. Or what procedure do we have in mind for actually testing the upgrade? |
Beta Was this translation helpful? Give feedback.
-
We could add an error variant that tells you if a runtime api function was actually found. Then you could match and act on this? |
Beta Was this translation helpful? Give feedback.
-
I think this will work. You won't have exact versions but you'll know that your runtime is 'not recent enough'. |
Beta Was this translation helpful? Give feedback.
-
We should find a way to make the staging api more like a first class citizen and less relying on assumptions. To resume what we need:
@bkchr is this doable in general and do you see any issue introducing such concept in substrate? |
Beta Was this translation helpful? Give feedback.
-
We discussed a way to have staging functions inside the runtime api of Polkadot. The full discussion is here but I'll resume it with a few sentences. The purpose is to push functionality which we want to deploy on a real test network but not to confuse it with stable api functions. What we did was to prefix the function names with a
Staging
prefix, add implementation to the desired runtimes (e.g. the test ones - Westend and Rococo) and useunimplemented!()
for the rest.This approach sort of worked. However we ran into a limitation. Adding staging functions breaks the versioning because we don't bump the version after we add a staging function. Due to this misuse we lose the possibility to check if the Runtime contains the staging code that we need on the node. This means that we can't push changes to the test network and handle old runtimes gracefully as for example we can do with stable (versioned) runtime api. We need a way to overcome this.
One option is to bump the version with each new call we add/change. This will solve the version check problem but I suspect it will be a pain to maintain because the versions will increase rapidly.
Another option which we like (by saying we - I mean the Parachains team as a Substrate user) is to be able to toggle the staging functions on and off 'somehow' and have separate version for them so that it doesn't interfere with the stable one too much. I understand though that this deviates a lot from the current philosophy of the runtime api.
So can we talk about what's the best way to give the staging runtime api an actual version which is independent from the stable one and have the Runtime report it when the a staging (feature) flag is set?
@bkchr @rphmeier
Beta Was this translation helpful? Give feedback.
All reactions