diff --git a/a3p-integration/README.md b/a3p-integration/README.md index 192f3b40042..0fd7dbfc5e6 100644 --- a/a3p-integration/README.md +++ b/a3p-integration/README.md @@ -60,7 +60,7 @@ For a chain software upgrade proposal, the `type` is `"Software Upgrade Proposal - `sdkImageTag` is the docker image tag to use that contains the upgraded chain software. It has a value of `unreleased`, which is the tag for the image that is built from the enclosing `agoric-sdk` repository. -- `planName` is the "upgrade name" included in the proposal which must match the value in the upgraded chain software. In the `master` branch its value is `UNRELEASED_UPGRADE`. In the release branches, it's `agoric-upgrade-NN`. +- `planName` is the "upgrade name" included in the proposal which must match the value in the upgraded chain software. In the `master` branch its value is `UNRELEASED_A3P_INTEGRATION`. In the release branches, it's `agoric-upgrade-NN`. - `upgradeInfo` contains other details passed to the governance proposal. In particular, it can have a `coreProposals` field which instructs the chain @@ -115,7 +115,7 @@ The `yarn build` script automates 3 steps: ## Generate a docker image with the `agoric-sdk` chain software -The chain software upgrade proposal contained in this end-to-end integration test performs an upgrade of the agoric-3 synthetic chain to an `UNRELEASED_UPGRADE` plan name (or the corresponding upgrade plan name for release branches). It loads the docker image `ghcr.io/agoric/agoric-sdk:unreleased` for the software implementing that upgrade (both in the `master` branch or in release branches). +The chain software upgrade proposal contained in this end-to-end integration test performs an upgrade of the agoric-3 synthetic chain to an `UNRELEASED_A3P_INTEGRATION` plan name (or the corresponding upgrade plan name for release branches). It loads the docker image `ghcr.io/agoric/agoric-sdk:unreleased` for the software implementing that upgrade (both in the `master` branch or in release branches). The upgrade handler is implemented by the code in the enclosing `agoric-sdk` repository. After any change to the chain software or vat code upgraded through core proposals, the image must be regenerated. This is automatically done by the `build:sdk` script, but can also be performed manually using: @@ -202,7 +202,7 @@ That's because you didn't create an image from the local `agoric-sdk`. Run `yarn If you get an error like, ``` -panic: UPGRADE "UNRELEASED_UPGRADE" NEEDED at height: 1101: {"coreProposals":["@agoric/builders/scripts/vats/init-network.js"]} +panic: UPGRADE "UNRELEASED_A3P_INTEGRATION" NEEDED at height: 1101: {"coreProposals":["@agoric/builders/scripts/vats/init-network.js"]} ``` Means your SDK image is different than the one expected by the upgrade proposal. To build the correct image, run `yarn build:sdk`. diff --git a/a3p-integration/package.json b/a3p-integration/package.json index 2872b5eac7e..71207d38918 100644 --- a/a3p-integration/package.json +++ b/a3p-integration/package.json @@ -1,7 +1,7 @@ { "private": true, "agoricSyntheticChain": { - "fromTag": "use-upgrade-15" + "fromTag": "latest" }, "scripts": { "build": "yarn run build:sdk && yarn run build:submissions && yarn run build:synthetic-chain", diff --git a/a3p-integration/proposals/README.md b/a3p-integration/proposals/README.md new file mode 100644 index 00000000000..bf661f0caea --- /dev/null +++ b/a3p-integration/proposals/README.md @@ -0,0 +1,96 @@ +# Draft proposals + +## How to publish a proposal once approved + +`a3p-integration` holds draft proposals to test in agoric-sdk that they perform +as expected. Once a proposal has been approved by BLD stakers it executes on +chain and the proposal is no longer a draft. That requires moving it to the +agoric-3-proposals repo to become part of the `latest` image. + +Steps: +1. Get the upgrade branch +2. Build the submissions +3. Migrate the proposal +4. Update the `latest` iamge + +### Get the proposal's branch + +We need the actual proposal that was sent to stakers. In the case of upgrades +(chain-halting) it will be a dedicated release branch. (E.g. +https://github.com/Agoric/agoric-sdk/tree/dev-upgrade-16/). If you're +publishing an "upgrade" proposal and it's called `a:upgrade-next`, keep looking; +that is only a draft. + +### Build the submissions + +The proposals use `sdk-generate` to ensure that CI is always testing the latest +version. But to publish we need a fixed version, to match the software upgrade +that the BLD stakers decided on. + +To build that artifact, +``` +cd a3p-integration +scripts/build-all-submissions.sh +``` + +It's best practice for each output directory to end in `-submission` to make the +migration simpler. For example, +``` + "sdk-generate": [ + "vats/probe-zcf-bundle.js probe-submission", + "vats/test-localchain.js localchaintest-submission" + ], +``` + +### Migrate the proposal + +Figure out the serial number of the proposal that was voted on. Keep a link to +it to reference. + +In agoric-3-proposals, make a new `proposals/NN:PROPOSAL_NAME` directory where +NN is the proposal's serial number. If the proposal is a chain-halting upgrade +then it would be `NN:upgrade-KK` where KK is the agoric-sdk upgrade handler +serial number. + +Copy the contents of the agoric-sdk proposal to this new directory. + +Verify that `planName` references the go upgrade handler. + +Remove `sdk-generate` from package.json (because the files are already generated +and will be checked in with the PR). + +Change `releaseNotes` to reference that actual release notes. [For example](https://github.com/Agoric/agoric-3-proposals/blob/c70cf299b0efc3758991639a03b92cc33867a5bf/proposals/65%3Aupgrade-13/package.json#L3), +``` + "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/agoric-upgrade-13", +``` + +Change `sdkImageTag` to the number mentioned in the release notes (search for +`ghcr.io/agoric/agoric-sdk:`) [For example](https://github.com/Agoric/agoric-3-proposals/blob/c70cf299b0efc3758991639a03b92cc33867a5bf/proposals/65%3Aupgrade-13/package.json#L3C1-L4C1), +``` + "sdkImageTag": "39", +``` + +# Update the `latest` image + +Once you have the new proposal in agoric-3-propals, send a PR to merge it into +the repo. The PR's CI will test it and once the PR is merged it will update the +`latest` image. + +## How to revise this directory after + +Once `latest` has changed, if it was a Software Upgrade Proposal then the +upgrade handler in master will fail. If that poses a problem, you can set +a3p-integration `agoricSyntheticChain.fromTag` to a specific version instead +of `latest`. See https://ghcr.io/agoric/agoric-3-proposals for the available +tags. + +You need to revise `a:upgrade-next` to be able to apply on top of the last +upgrade. In master it should already have these values, which should be +maintained: +``` + "releaseNotes": false, + "sdkImageTag": "unreleased", + "planName": "UNRELEASED_A3P_INTEGRATION", +``` + +But you will have to remove from `app.go` whatever proposals were already executed. diff --git a/a3p-integration/proposals/a:upgrade-next/README.md b/a3p-integration/proposals/a:upgrade-next/README.md index 478b94307fc..ff63376893f 100644 --- a/a3p-integration/proposals/a:upgrade-next/README.md +++ b/a3p-integration/proposals/a:upgrade-next/README.md @@ -1,6 +1,6 @@ # Proposal to upgrade the chain software -The `UNRELEASED_UPGRADE` software upgrade may include core proposals defined in +The `UNRELEASED_A3P_INTEGRATION` software upgrade may include core proposals defined in its upgrade handler. See `CoreProposalSteps` in the `unreleasedUpgradeHandler` in [golang/cosmos/app/app.go](../../../golang/cosmos/app/app.go). diff --git a/a3p-integration/proposals/a:upgrade-next/package.json b/a3p-integration/proposals/a:upgrade-next/package.json index 06868e9bea8..c3bd2a7c3c1 100644 --- a/a3p-integration/proposals/a:upgrade-next/package.json +++ b/a3p-integration/proposals/a:upgrade-next/package.json @@ -7,7 +7,6 @@ "coreProposals": [] }, "sdk-generate": [ - "vats/probe-zcf-bundle.js probe-submission", "vats/test-localchain.js localchaintest-submission", "vats/upgrade-bank.js upgrade-bank", "vats/upgrade-provisionPool.js upgrade-provisionPool", diff --git a/a3p-integration/proposals/a:upgrade-next/probeZcfBundleCap.test.js b/a3p-integration/proposals/a:upgrade-next/probeZcfBundleCap.test.js deleted file mode 100644 index 75237d2f013..00000000000 --- a/a3p-integration/proposals/a:upgrade-next/probeZcfBundleCap.test.js +++ /dev/null @@ -1,36 +0,0 @@ -import test from 'ava'; - -import { - evalBundles, - getIncarnation, - getVatDetails, -} from '@agoric/synthetic-chain'; - -const SUBMISSION_DIR = 'probe-submission'; - -test('upgrade Zoe to verify ZcfBundleCap endures', async t => { - await null; - t.assert((await getIncarnation('zoe')) === 2, 'zoe incarnation must be one'); - - // Before the test, the Wallet Factory should be using the legacy ZCF - const detailsBefore = await getVatDetails('walletFactory'); - t.true(detailsBefore.incarnation >= 2, 'wf incarnation must be >= 2'); - - await evalBundles(SUBMISSION_DIR); - - const detailsAfter = await getVatDetails('walletFactory'); - t.is( - detailsAfter.incarnation, - detailsBefore.incarnation + 2, - 'wf incarnation must increase by 2', - ); - - // The test restarts the WalletFactory, so it'll use the recently assigned - // ZCF bundle. It then restarts Zoe, so it'll revert to whichever ZCF bundle - // made it to persistent store. We then restart the Wallet Factory and see if - // it's gone back to the ZCF that Zoe initially knew about. If we could get the - // ZCF bundleID here from the probe, we'd explicitly check for that. Instead, - // we have to be content that it did indeed use the newly assigned bundle in - // manual tests. - t.not(detailsAfter.bundleID, detailsBefore.bundleID); -}); diff --git a/a3p-integration/proposals/a:upgrade-next/provisioning-test-submission/send-script-permit.json b/a3p-integration/proposals/a:upgrade-next/provisioning-test-submission/send-script-permit.json deleted file mode 100644 index 27ba77ddaf6..00000000000 --- a/a3p-integration/proposals/a:upgrade-next/provisioning-test-submission/send-script-permit.json +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/a3p-integration/proposals/a:upgrade-next/provisioning-test-submission/send-script.tjs b/a3p-integration/proposals/a:upgrade-next/provisioning-test-submission/send-script.tjs deleted file mode 100644 index f27af8cccd5..00000000000 --- a/a3p-integration/proposals/a:upgrade-next/provisioning-test-submission/send-script.tjs +++ /dev/null @@ -1,28 +0,0 @@ -#! false node --ignore-this-line -/* global E */ - -/// -/// - -/** - * Send a payment by looking up deposit facet via namesByAddress. - * - * see ./post.test.js - * - * @param {BootstrapPowers} powers - */ -const sendIt = async powers => { - const addr = '{{ADDRESS}}'; - const { - consume: { namesByAddress, zoe }, - instance: { - consume: { reserve }, - }, - } = powers; - const pf = E(zoe).getPublicFacet(reserve); - const anInvitation = await E(pf).makeAddCollateralInvitation(); - const addressDepositFacet = E(namesByAddress).lookup(addr, 'depositFacet'); - await E(addressDepositFacet).receive(anInvitation); -}; - -sendIt; diff --git a/a3p-integration/proposals/a:upgrade-next/provisioning.test.js b/a3p-integration/proposals/a:upgrade-next/provisioning.test.js deleted file mode 100644 index e31ffbb89a8..00000000000 --- a/a3p-integration/proposals/a:upgrade-next/provisioning.test.js +++ /dev/null @@ -1,51 +0,0 @@ -// @ts-check - -import test from 'ava'; -import { readFile, writeFile } from 'node:fs/promises'; - -import { - getIncarnation, - getUser, - evalBundles, - waitForBlock, - agoric, -} from '@agoric/synthetic-chain'; - -const SUBMISSION_DIR = 'provisioning-test-submission'; - -/** - * @param {string} fileName base file name without .tjs extension - * @param {Record} replacements - */ -const replaceTemplateValuesInFile = async (fileName, replacements) => { - let script = await readFile(`${fileName}.tjs`, 'utf-8'); - for (const [template, value] of Object.entries(replacements)) { - script = script.replaceAll(`{{${template}}}`, value); - } - await writeFile(`${fileName}.js`, script); -}; - -test.serial(`provisioning vat was upgraded`, async t => { - const incarnation = await getIncarnation('provisioning'); - - t.is(incarnation, 1); -}); - -test.serial(`send invitation via namesByAddress`, async t => { - const addr = await getUser('gov1'); - - await replaceTemplateValuesInFile(`${SUBMISSION_DIR}/send-script`, { - ADDRESS: addr, - }); - - await evalBundles(SUBMISSION_DIR); - - await waitForBlock(2); // enough time for invitation to arrive? - const update = await agoric.follow('-lF', `:published.wallet.${addr}`); - t.is(update.updated, 'balance'); - t.notDeepEqual(update.currentAmount.value, []); - t.log('balance value', update.currentAmount.value); - t.log('balance brand', update.currentAmount.brand); - // XXX agoric follow returns brands as strings - t.regex(update.currentAmount.brand, /Invitation/); -}); diff --git a/golang/cosmos/app/app.go b/golang/cosmos/app/app.go index bb5dfc4e8bf..23ff199fc1e 100644 --- a/golang/cosmos/app/app.go +++ b/golang/cosmos/app/app.go @@ -875,14 +875,8 @@ func NewAgoricApp( } if upgradeNamesOfThisVersion[upgradeInfo.Name] && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{ - packetforwardtypes.ModuleName, // Added PFM - vlocalchain.ModuleName, // Agoric added vlocalchain - vtransfer.ModuleName, // Agoric added vtransfer - }, - Deleted: []string{ - "lien", // Agoric removed the lien module - }, + Added: []string{}, + Deleted: []string{}, } // configure store loader that checks if version == upgradeHeight and applies store upgrades diff --git a/golang/cosmos/app/upgrade.go b/golang/cosmos/app/upgrade.go index 519083ddf4c..a7e052176de 100644 --- a/golang/cosmos/app/upgrade.go +++ b/golang/cosmos/app/upgrade.go @@ -167,21 +167,7 @@ func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Conte if isFirstTimeUpgradeOfThisVersion(app, ctx) { // Each CoreProposalStep runs sequentially, and can be constructed from // one or more modules executing in parallel within the step. - CoreProposalSteps = []vm.CoreProposalStep{ - // Upgrade Zoe + ZCF - vm.CoreProposalStepForModules("@agoric/builders/scripts/vats/replace-zoe.js"), - // Revive KREAd characters - vm.CoreProposalStepForModules("@agoric/builders/scripts/vats/revive-kread.js"), - - // upgrade the provisioning vat - vm.CoreProposalStepForModules("@agoric/builders/scripts/vats/replace-provisioning.js"), - // Enable low-level Orchestration. - vm.CoreProposalStepForModules( - "@agoric/builders/scripts/vats/init-network.js", - "@agoric/builders/scripts/vats/init-localchain.js", - "@agoric/builders/scripts/vats/init-transfer.js", - ), - } + CoreProposalSteps = []vm.CoreProposalStep{} priceFeedSteps, err := upgradePriceFeedCoreProposalSteps(targetUpgrade) if err != nil { return nil, err