Skip to content
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

The flag --enhanced-orthogonal-persistence should allow using any type as stable #4880

Open
vporton opened this issue Feb 2, 2025 · 2 comments

Comments

@vporton
Copy link

vporton commented Feb 2, 2025

When --enhanced-orthogonal-persistence, it should be allowed to declare stable variables of non-stable types. Presently, it is not allowed.

Should any type whatsoever be compatible with stable, or with some exceptions?

In other words, should every type become stable, when --enhanced-orthogonal-persistence?

@ggreif
Copy link
Contributor

ggreif commented Feb 2, 2025

Only shared (i.e. mobile) types can be declared as types of stable bindings. That doesn't include function types (these are also not comparable). Since EOP doesn't involve serialisation, we have a few ideas to relax the shared requirement. One way would be to have manifestly named functions in the Wasm, and use those names to rediscover them in the upgraded canister. I am not sure about the status of these thoughts and their realisability is, @luc-blaeser can surely tell more.

@crusso
Copy link
Contributor

crusso commented Feb 20, 2025

Actually, Gabor is not quite right. The set of stable types is considerably larger than shared types and includes mutable arrays and records with mutable fields. Some types are still excluded namely non-shared functions, async values, errors and data structures involving them (including typical objects)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants