From cfd8c7519095e635348e5b41037076fe62ece707 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 15 Feb 2023 12:38:28 -0600 Subject: [PATCH] fix(swingset): add placeholders for upgrade/stopvat work This makes room inside processUpgradeVat() for the new cleanup steps that we want to add. refs #6650 refs #7001 refs #6694 refs #6696 --- packages/SwingSet/src/kernel/kernel.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/SwingSet/src/kernel/kernel.js b/packages/SwingSet/src/kernel/kernel.js index 1884af60894e..3c18f803653e 100644 --- a/packages/SwingSet/src/kernel/kernel.js +++ b/packages/SwingSet/src/kernel/kernel.js @@ -823,6 +823,11 @@ export default function buildKernel( const vd1 = vatWarehouse.kernelDeliveryToVatDelivery(vatID, kd1); const status1 = await deliverAndLogToVat(vatID, kd1, vd1); + // TODO: send BOYD to the vat, to give it one last chance to clean + // up, drop imports, and delete durable data. If we ever have a + // vat that is so broken it can't do BOYD, we can make that + // optional. #7001 + // make arguments for vat-vat-admin.js vatUpgradeCallback() /** * @param {SwingSetCapData} _errorCD @@ -873,8 +878,17 @@ export default function buildKernel( return results; } - // stopVat succeeded, so now we stop the worker, delete the - // transcript and any snapshot + // stopVat succeeded. finish cleanup on behalf of the worker. + + // TODO: walk c-list for all decided promises, reject them all #6694 + + // TODO: getNonDurableObjectExports, synthesize abandonVSO, + // execute it as if it were a syscall. (maybe distinguish between + // reachable/recognizable exports, abandon the reachable, retire + // the recognizable) #6696 + + // cleanup done, now we stop the worker, delete the transcript and + // any snapshot await vatWarehouse.resetWorker(vatID); const source = { bundleID };