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

chore(agd): upgrade all orchestration vats to new liveslots #10764

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions a3p-integration/proposals/n:upgrade-next/initial.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};
Expand Down
8 changes: 8 additions & 0 deletions golang/cosmos/app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
mhofman marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
),
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,41 @@ 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}`);
console.log(name, `BUNDLE ID: `, ref.bundleID);
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',
},
produce: {},
},
},
options: { bundleRefs },
options: { bundleRefs, vatOptions },
});
Loading