CCF icon indicating copy to clipboard operation
CCF copied to clipboard

Allow JS runtime options to be set individually

Open eddyashton opened this issue 2 years ago • 5 comments

We currently have a single proposal to set JS runtime options, and all options must be provided. I think it would be simpler if this took a partial object, and only updated the fields it was provided. On the C++ side, this would mean setting default values at struct construction time, so that we have sane defaults whether-or-not there is a governance-controlled value in the KV.

Motivation is from adding another option here (max_cached_interpreters), and realising how much code is involved in configuring that, even to restore it to a default.

eddyashton avatar Aug 17 '23 15:08 eddyashton

@lynshi brought up the possibility of having patch-style actions when we discussed idempotent actions at first https://github.com/microsoft/CCF/discussions/2169#discussioncomment-339465

achamayou avatar Aug 17 '23 16:08 achamayou

For the current use case, we may just set it in a separate proposal. Not written above but I meant to:

There's also some duplication of default values. I think that could be minimised by pushing stuff through C++, materialising default values, and similar. It's all in my head, and unimportant, and I'm sure I won't forget it...

eddyashton avatar Aug 17 '23 16:08 eddyashton

+1 for materialising default values in the KV, which I think can be done as a standalone change before adding a patch mechanism to governance (which may be of interest to applications too, in fact).

achamayou avatar Sep 29 '23 08:09 achamayou

Added to programmability API in #6241, but not present in js_generic.

achamayou avatar Jun 14 '24 10:06 achamayou

Brain dump: this can be a new action in the sample constitution, which calls the existing patch logic internally.

achamayou avatar Jun 27 '24 13:06 achamayou

This is now supported for user-space applications, which is the main recommended way of implementing JS endpoints #6201.

achamayou avatar Feb 06 '25 10:02 achamayou