-
Notifications
You must be signed in to change notification settings - Fork 500
feat: EXC-2060: Introduce environment variables #5796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
🤖 Here's your preview: https://qslrt-byaaa-aaaam-aejga-cai.icp0.io |
This comment was marked as resolved.
This comment was marked as resolved.
this sounds pretty cool, where can i learn more about it? searching on slack or drive didn't yield any results :( |
Co-authored-by: mraszyk <[email protected]>
To avoid the conflicts:
|
Just as documentation, I've updated ICRC-105 to specify how to handle environment variable and their changes. Ideally(as with other replica changes) we'd love a lifecycle event to make this much less complicated to track. While I see that the hash of these changes are covered in the canister history API, the aim of 105 is to make full transparency of all config(software or environment variables), installs, configs, etc first class citizens in the ICRC-3 log. Enumeration is not a must as hopefully the developer knows which variables he is using and can review any changes to the hash, but enumeration would certainly be welcome. See more: dfinity/ICRC#105 |
Depending on the size limits on canister environment variables, this could bloat up the canister history size substantially. Hence, a hash is preferrable (analogously to the WASM module hash that must also be reproduced separately). |
What do you mean more concretely? And what would the workflow look like? |
From: While we are here, there are a number of 'other' hooks that would be very helpful and one topic that would be worth discussing here in regards to the work I've been doing on ICRC-105. dfinity/ICRC#105 The 'spirit' of ICRC-105 is to give public utility canisters a spot in the ICRC-3 log to record any configuration, upgrade, or installation changes that may be relevant to the execution of the canister. The ideal 'best-case' scenario would be that given an ICRC-105 + ICRC-3 canister, the set of used wasms, properly recorded ICRC-3 block(proper being that they recorded all information relevant to the deterministic execution program/state changes) that one could reconstruct the state of the canister from the ICRC-3 log. This means we need to record any change to the canister the would affect how the code runs. Since you can write any code there may be a number of unknown unknowns that a dev would be responsible for, but it would be nice to take care of the known possible changes via canister life cycle events. The obvious events would be
One that is not so obvious would be something that fires if the version of the replica changes. I'm not sure what the process or workflow is there, but I would imagine that if a replica version is updated it might include code that could change the way a canister behaves(something like the cycle cost of certain operations or even system API level information). It may not be a great feature to have every canister on the subnet firing an event each time a new replica version starts up, but perhaps this could fire the first time that canister is called in the future? |
@skilesare Thanks for your input. We’ll keep it in mind as feedback for future development. However, at this stage, it falls outside the scope of this specific feature. |
* Add env_var_name_exists * review * .
This reverts commit 90c46b2.
Canister environment variables doc
This PR introduces environment variables for canisters. It adds support for environment variables in canister settings, allowing runtime configuration without code changes.
Changes
TODO: add changelog
* Added support for canister environment variables in canister settings
* New System API for accessing environment variables:
-
ic0.env_var_count
-
ic0.env_var_name_size
-
ic0.env_var_name_copy
-
ic0.env_var_value_size
* New
SettingChange
variant in canister history setting details