-
Notifications
You must be signed in to change notification settings - Fork 99
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
Record Upgrade Instructions for Classical Persistence #4676
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok to me but I don't quite understand why the number of instructions is so large?
Or is that just because its undefined and equal to UInt64.max = 18,446,744,073,709,551,615?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I get it now. LGTM. Nice work
Co-authored-by: Claudio Russo <claudio@dfinity.org>
Thank you for the review, Claudio! |
The |
Also support
Prim.rts_upgrade_instructions()
on classical persistence, to inspect the instructions consumed by the last upgrade (including stabilization plus destabilization) for performance measurements. This functionality is already supported with enhanced orthogonal persistence.Mechanism
Prim.rts_upgrade_instructions()
returns the sum of those costs.Backwards Compatibility
The record of upgrade instructions is optional in the stable memory. This is to ensure backwards compatibility to older Motoko programs that do not record this information. When upgrading from such an older Motoko program,
Prim.rts_upgrade_instructions()
returnsNat64.maximumValue
.Notes
Prim.rts_upgrade_instructions()
currently returns >0 after installation because some upgrade check needs to be performed there too.Prim
is only intended for internal use.