diff --git a/a3p-integration/proposals/n:upgrade-next/initial.test.js b/a3p-integration/proposals/n:upgrade-next/initial.test.js index c68207a949b..a0b54b3316d 100644 --- a/a3p-integration/proposals/n:upgrade-next/initial.test.js +++ b/a3p-integration/proposals/n:upgrade-next/initial.test.js @@ -4,11 +4,11 @@ import '@endo/init/debug.js'; import { getVatDetails } from '@agoric/synthetic-chain'; const vats = { - network: { incarnation: 1 }, - ibc: { incarnation: 1 }, - localchain: { incarnation: 1 }, - orchestration: { incarnation: 0 }, - transfer: { incarnation: 1 }, + network: { incarnation: 2 }, + ibc: { incarnation: 2 }, + localchain: { incarnation: 2 }, + orchestration: { incarnation: 1 }, + transfer: { incarnation: 2 }, walletFactory: { incarnation: 5 }, zoe: { incarnation: 3 }, }; diff --git a/golang/cosmos/app/upgrade.go b/golang/cosmos/app/upgrade.go index fbf9657db91..49d35c071d4 100644 --- a/golang/cosmos/app/upgrade.go +++ b/golang/cosmos/app/upgrade.go @@ -247,6 +247,14 @@ func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Conte ), ) + // Upgrade vats using Vows in Upgrade 18 in order to use a new liveslots that + // avoids a memory leak in watchPromise. + CoreProposalSteps = append(CoreProposalSteps, + vm.CoreProposalStepForModules( + "@agoric/builders/scripts/vats/upgrade-orchestration.js", + ), + ) + // CoreProposals for Upgrade 19. These should not be introduced // before upgrade 18 is done because they would be run in n:upgrade-next // diff --git a/packages/builders/scripts/vats/upgrade-orch-core.js b/packages/builders/scripts/vats/upgrade-orchestration.js similarity index 79% rename from packages/builders/scripts/vats/upgrade-orch-core.js rename to packages/builders/scripts/vats/upgrade-orchestration.js index 47a0a6d437d..30225270932 100644 --- a/packages/builders/scripts/vats/upgrade-orch-core.js +++ b/packages/builders/scripts/vats/upgrade-orchestration.js @@ -3,15 +3,18 @@ import { makeHelpers } from '@agoric/deploy-script-support'; /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ export const defaultProposalBuilder = async ({ publishRef, install }) => harden({ - sourceSpec: '@agoric/vats/src/proposals/upgrade-orch-core-proposal.js', + sourceSpec: '@agoric/vats/src/proposals/upgrade-vats-generic-proposal.js', getManifestCall: [ - 'getManifestForUpgradingOrchCore', + 'getManifestForUpgradingVats', { bundleRefs: { ibc: publishRef(install('@agoric/vats/src/vat-ibc.js')), network: publishRef(install('@agoric/vats/src/vat-network.js')), localchain: publishRef(install('@agoric/vats/src/vat-localchain.js')), transfer: publishRef(install('@agoric/vats/src/vat-transfer.js')), + orchestration: publishRef( + install('@agoric/orchestration/src/vat-orchestration.js'), + ), }, }, ], diff --git a/packages/vats/src/proposals/upgrade-orch-core-proposal.js b/packages/vats/src/proposals/upgrade-vats-generic-proposal.js similarity index 59% rename from packages/vats/src/proposals/upgrade-orch-core-proposal.js rename to packages/vats/src/proposals/upgrade-vats-generic-proposal.js index 3d57869e9bd..b2023758e29 100644 --- a/packages/vats/src/proposals/upgrade-orch-core-proposal.js +++ b/packages/vats/src/proposals/upgrade-vats-generic-proposal.js @@ -11,13 +11,18 @@ import { E } from '@endo/far'; * }; * }} powers * @param {object} options - * @param {{ bundleRefs: { [vatName: string]: VatSourceRef } }} options.options + * @param {{ + * bundleRefs: { [vatName: string]: VatSourceRef }; + * vatOptions?: { + * [vatName: string]: import('@agoric/swingset-vat').VatUpgradeOptions; + * }; + * }} options.options */ -export const upgradeOrchCore = async ( +export const upgradeVatsGeneric = async ( { consume: { vatAdminSvc, vatStore } }, options, ) => { - const { bundleRefs } = options.options; + const { bundleRefs, vatOptions = {} } = options.options; for await (const [name, ref] of Object.entries(bundleRefs)) { assert(ref.bundleID, `bundleID missing for ${name}`); @@ -25,13 +30,16 @@ export const upgradeOrchCore = async ( const bundleCap = await E(vatAdminSvc).getBundleCap(ref.bundleID); const { adminNode } = await E(vatStore).get(name); - await E(adminNode).upgrade(bundleCap, {}); + await E(adminNode).upgrade(bundleCap, vatOptions[name] || {}); } }; -export const getManifestForUpgradingOrchCore = (_powers, { bundleRefs }) => ({ +export const getManifestForUpgradingVats = ( + _powers, + { bundleRefs, vatOptions }, +) => ({ manifest: { - [upgradeOrchCore.name]: { + [upgradeVatsGeneric.name]: { consume: { vatAdminSvc: 'vatAdminSvc', vatStore: 'vatStore', @@ -39,5 +47,5 @@ export const getManifestForUpgradingOrchCore = (_powers, { bundleRefs }) => ({ produce: {}, }, }, - options: { bundleRefs }, + options: { bundleRefs, vatOptions }, });