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

feat: implement ExperimentalStableMemory.stableVarQuery for estimating stable variable storage requirements during upgrade #365

Merged
merged 3 commits into from
Jun 3, 2022

Conversation

crusso
Copy link
Contributor

@crusso crusso commented Apr 15, 2022

Expose ExperimentalStableMemory.stableVarQuery for estimating stable variable storage requirements during upgrade

 ExperimentalStableMemory.stableVarQuery : () -> (shared query () -> async {size : Nat64})

Returns a query that, when called, returns the number of bytes of (real) IC stable memory that would be occupied by persisting its current stable variables before an upgrade.
This function may be used to monitor or limit real stable memory usage.
The query computes the estimate by running the first half of an upgrade, including any preupgrade system method.
Like any other query, its state changes are discarded so no actual upgrade (or other state change) takes place.
The query can only be called by the enclosing actor and will trap for other callers.

@crusso crusso changed the title feat: expose stableVarInfo feat: expose stableVarQuery for estimating stable variable storage requirements during upgrade Jun 3, 2022
@crusso crusso requested a review from chenyan-dfinity June 3, 2022 02:01
@crusso crusso marked this pull request as ready for review June 3, 2022 02:01
@crusso
Copy link
Contributor Author

crusso commented Jun 3, 2022

  • bump motoko-base in motoko

@ggreif ggreif changed the title feat: expose stableVarQuery for estimating stable variable storage requirements during upgrade feat: expose stableVarQuery for estimating stable variable storage requirements during upgrade Jun 3, 2022
@crusso crusso changed the title feat: expose stableVarQuery for estimating stable variable storage requirements during upgrade feat: implement ExperimentStableMemory.stableVarQuery for estimating stable variable storage requirements during upgrade Jun 3, 2022
@crusso crusso changed the title feat: implement ExperimentStableMemory.stableVarQuery for estimating stable variable storage requirements during upgrade feat: implement ExperimentalStableMemory.stableVarQuery for estimating stable variable storage requirements during upgrade Jun 3, 2022
@crusso crusso merged commit 1f807c1 into next-moc Jun 3, 2022
@crusso crusso deleted the claudio/next-moc-var-info branch June 3, 2022 13:52
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

Successfully merging this pull request may close these issues.

2 participants