There are a number of system calls (installing, creating canisters, snapshots) that have a sender_canister_version parameter. I don’t see much explanation of what this is in the obvious places and/or I’m still not understanding what it does. Can someone explain it?
Why not just make an ICRC standard to explain it to us?
Found this in the spec: The Internet Computer Interface Specification | Internet Computer
Regarding sender_canister_version
specifically, it’s mentioned in this section: The Internet Computer Interface Specification | Internet Computer
I don’t see canister_version in any of the settings or statuses.
It might make sense as a filter to say “only upgrade this canister if it is still version X”, but it is usually sender_canister_version. How does the receiving function know what my canister version is(or is this coming from the system_canister aaaaaa-aa?) and is the version of that virtual canister?
sender_canister_version
is the version of the canister that sent the management canister request, not the one that is being managed. It’s helpful in cases one wants to perform some kind of verification.
E.g. imagine in an SNS you have SNS root upgrade some other canister as a result of an adopted proposal – having the sender_canister_version
allows you to know which version the SNS root was running on when it made the upgrade.
This is also stored in canister history for the same reason, it allows someone to inspect what version a canister was running when it made changes to another canister.
How does one obtain their own canister_version from inside the canister?
You can use the ic0.canister_version system API for this.