-
Notifications
You must be signed in to change notification settings - Fork 2.7k
try-runtime
- specifying runtime & cutting off unnecessary configuration burden
#12156
Comments
I overall love the idea. I must confess that I am not sure if this approach works though, because it does touch a bit of the service code that I am unfamiliar with. currently, one of the main points of confusion around try-runtime is exactly this: Which runtime is actually being used? This is specially complicated if you use I think this is definitely worth prototyping and exploring, and would be a great bonus of we can deliver it before Sub0. |
I would drop
Currently that is not really possible. You at least need |
please check out my PoC: #12193 |
I'm trying to change the way how local runtime is passed. Currently, we must pass path to a chainspec, build genesis storage and retrieve
:CODE:
from there. Not only it is the second time we build the storage (the first time is increate_runner
function in the client code), but we also do it completetly unnecessary.I would like to propose two things:
try-runtime
subcommands:enum Runtime
, which has three variants:Remote | Native | Local(Pathbuf)
with natural meaning:-
Remote
: we useWasm
execution with the runtime included in the scraped storage (and we do not have to overwrite anything)-
Native
: we useNative
execution with the code from the binary that is actually running (in case of spec-* mismatch we can panic)-
Local(Pathbuf)
: we useWasm
execution with the runtime read from local file atPathbuf
(which requires overwriting:CODE:
in the scraped storage)Of course, not every variant makes sense with every subcommand, but having a common way of specifying runtime + variant checks seems to be more friendly and straightforward than implicit, non-consistent approach.
sc_service::Configuration
andsc_cli::SharedParams
intry-runtime
- if I understand correctly, the only essential information that we use from it are:default_heap_pages
,max_runtime_instances
andruntime_cache_size
. We could 'move' these three arguments toSharedParams
and stop using both concepts at all. However, the problem is not gone:TryRuntimeCmd
will be still launched usingsc::cli::Runner
, which requiressc_service::Configuration
object. If I'm not mistaken,try-runtime
is a command that needs nothing more than an async environment (with some logging configured etc), and the whole overhead withsc_service::Configuration
is unneeded and possibly misleading.Unfortunately, I don't see any other way than providing some additional simplified/generalized methods / structs to the client like:
so that commands like
TryRuntime
can be launched like:As long as the former point seems to be quite feasible, I have many doubts with the latter one. In particular, I don't know exactly how much effort it requires.
@kianenigma please take a look
The text was updated successfully, but these errors were encountered: