Skip to content

Commit

Permalink
chore(agd): upgrade all orchestration vats to new liveslots (#10764)
Browse files Browse the repository at this point in the history
refs: #10758, #10756
closes: #10762

## Description

Upgrade the Orchestration (both Core and API) vats to use liveslots with the #10758 fix for a `watchPromise` memory leak (#10756).

### Security Considerations

No code change to the vat user code in question, just to the liveslots it relies on.

### Scaling Considerations

Should flatten the memory growth curve.

### Documentation Considerations

No changes to existing data.

### Testing Considerations

The upgraded vats should be monitored for memory growth.

### Upgrade Considerations

n/a
  • Loading branch information
mergify[bot] authored Dec 24, 2024
2 parents d575daa + 2253ae6 commit e543d46
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
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
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 },
});

0 comments on commit e543d46

Please sign in to comment.