fix(release): correctly generate and apply engine-controller upgrade proposals#10458
fix(release): correctly generate and apply engine-controller upgrade proposals#10458pietrodimarco-dfinity wants to merge 2 commits into
Conversation
…roposals The engine-controller canister's `post_upgrade` takes `Option<EngineControllerInitArgs>` and traps when Candid-decoding an empty argument (no `DIDL` header). Upgrade proposals generated without an explicit argument therefore carry an empty arg, so on execution the install rolls back inside NNS root's fire-and-forget `change_nns_canister` while the proposal still reports as `Executed` -- the canister is silently never upgraded. Generate engine-controller upgrade proposals with an explicit `()` arg (the same mechanism already used for cycles-minting) so `post_upgrade` decodes to `None` and the upgrade actually applies.
There was a problem hiding this comment.
This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):
-
Update
unreleased_changelog.md(if there are behavior changes, even if they are
non-breaking). -
Are there BREAKING changes?
-
Is a data migration needed?
-
Security review?
How to Satisfy This Automatic Review
-
Go to the bottom of the pull request page.
-
Look for where it says this bot is requesting changes.
-
Click the three dots to the right.
-
Select "Dismiss review".
-
In the text entry box, respond to each of the numbered items in the previous
section, declare one of the following:
-
Done.
-
$REASON_WHY_NO_NEED. E.g. for
unreleased_changelog.md, "No
canister behavior changes.", or for item 2, "Existing APIs
behave as before.".
Brief Guide to "Externally Visible" Changes
"Externally visible behavior change" is very often due to some NEW canister API.
Changes to EXISTING APIs are more likely to be "breaking".
If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.
If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.
Reference(s)
For a more comprehensive checklist, see here.
GOVERNANCE_CHECKLIST_REMINDER_DEDUP
|
✅ No security or compliance issues detected. Reviewed everything up to 6494992. Security Overview
Detected Code Changes
|
`get_nns_canister_code_location` lacked a `code_location__engine_controller`
entry, so generating an engine-controller upgrade proposal failed under
`set -u` with an unbound-variable error on the `${!n}` indirect lookup.
Add the mapping to `rs/engine_controller` so proposal-text generation (and the
unreleased_changelog lookup) resolves correctly.
Two fixes so the NNS release tooling handles the
engine-controllercanistercorrectly end-to-end. (Follow-up to #10399, which added partial support.)
1. Map engine-controller to its source location (
functions.sh)get_nns_canister_code_locationhad nocode_location__engine_controllerentry, so generating an engine-controller upgrade proposal aborted under
set -uwith an unbound-variable error on the${!n}indirect lookup:Added the mapping to
rs/engine_controllerso proposal-text generation (andthe
unreleased_changelog.mdlookup) resolves.2. Pass
()upgrade arg for engine-controller (release-runscript)The canister's
post_upgradetakesOption<EngineControllerInitArgs>:An upgrade proposal generated without an argument carries an empty install
arg, which Candid cannot decode (no
DIDLheader), sopost_upgradetraps andthe upgrade rolls back. Because NNS root's
change_nns_canisterisfire-and-forget (it
spawns stop→install→start and replies immediately), theproposal is still recorded as Executed with no
failure_reason— thecanister is silently never upgraded.
Generate engine-controller proposals with an explicit
()arg (the samemechanism already used for
cycles-minting) sopost_upgradedecodes toNoneand the upgrade applies.Verification
Reproduced on a testnet:
status = Executed, but module hash and embeddedgit_commit_idunchanged (silent no-op).()arg → module hash andgit_commit_idupdated to the target commit.
cargo check -p release-runscriptpasses.