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

Add AssetReserve to Upgrade 19 with A3P test coverage #10541

Merged
merged 22 commits into from
Dec 17, 2024

Conversation

iomekam
Copy link
Contributor

@iomekam iomekam commented Nov 20, 2024

closes: #10399

Description

Adds the upgrade of the reserve to upgrade 19. To ensure that this upgrade will succeed, we've also added test coverage in A3P. One caveat we discovered while testing was that the adminFacet that's produced with the reserveKit was referencing the adminFacet of the governor. Luckily, we were able to get the adminFacet of the reserve contract by calling getAdminFacet on the governor's creatorFacet.

Upgrade Considerations

This PR adds the reserve to the list of vat upgrades for upgrade-19. These upgrades are currently commented out as we are still in the process of getting upgrade-18 out the door. We've added A3P tests to ensure that the upgrade is successful and that assets are still in the reserve after the upgrade.

Copy link

cloudflare-workers-and-pages bot commented Nov 20, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 95f6cf3
Status: ✅  Deploy successful!
Preview URL: https://c7c1c1f0.agoric-sdk.pages.dev
Branch Preview URL: https://iomekam-ar-upgrade-tests.agoric-sdk.pages.dev

View logs

@iomekam iomekam marked this pull request as ready for review November 20, 2024 21:01
@iomekam iomekam requested a review from a team as a code owner November 20, 2024 21:01
Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a helpful test, but we shouldn't close #10399 until we have an upgrade set up in upgrade.go, and tests in a3p-integration.

One of the things I'm looking forward to seeing in a3p-integration is that the vstorage records look reasonable after the upgrade.

@iomekam iomekam marked this pull request as draft December 6, 2024 17:02
@iomekam iomekam changed the title Add allocation checks for asset reserve vat upgrade tests Add AssetReserve to Upgrade 19 with A3P test coverage Dec 11, 2024
@iomekam iomekam added the force:integration Force integration tests to run on PR label Dec 11, 2024
@iomekam iomekam marked this pull request as ready for review December 11, 2024 19:04
@@ -5,3 +5,4 @@ addUsdOlives/
upgradeProvisionPool/
upgradeAgoricNames/
publishTestInfo/
upgradeAssetReserve/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should end with a linefeed.

const { assetReserveRef } = options.options;

assert(assetReserveRef.bundleID);
tracer(`ASSET RESERBE BUNDLE ID: `, assetReserveRef);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Comment on lines +56 to +62
reserveKitWriter.reset();
reserveKitWriter.resolve(
harden({
...reserveKit,
adminFacet,
}),
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as you're doing this, might as well clean up the original, (we want those proposals to be usable to start a new chain, or to copy, even if we won't run them again on mainNet) and add a comment here as to why this fix is necessary.

Comment on lines 10 to 12
test('test upgraded board', async t => {
// agoricProposal.sdk-generate in package.json generates this proposal
await evalBundles('testUpgradedBoard');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah this file should be deleted entirely!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This proposal file often goes in agoric-sdk/packages/vats, and the package.json tells it to construct this directory.

A more recent model for tests, followed by valueVow, is to put the script and proposal in the same file in ...packages/builders/scripts/testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a proposal specific to testing the upgrade. I followed the similar pattern of depositLemons, which also lives within the p:upgrade-19 directory

errorMessage: 'psm-IST-USD_LEMONS instance not observed.',
});

await evalBundles(ADD_COLLAOTRAL_DIR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

});

await evalBundles(ADD_COLLAOTRAL_DIR);
// await evalBundles(UPGRADE_AR_DIR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be dropped, right? The actual upgrade is happening on line 79.

@Chris-Hibbert
Copy link
Contributor

tests are failing

  ✘ [fail]: add collatoral to reserve Rejected promise returned by test
    ....
  ✘ [fail]: upgrade

Comment on lines +63 to +66
const { feeMint } = await provideAll(baggage, {
feeMint: () => zcf.registerFeeMint('Fee', privateArgs.feeMintAccess),
});

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the feeMint wasn't already in the baggage, which is why takeFeeMint() was failing, how did provideAll solved the "no contact with other vats during the first crank of the new incarnation"? Does provideAll somehow delay the execution of zcf.registerFeeMint to another crank?

cc @Chris-Hibbert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feeMint was already in baggage. It was failing because we were upgrading the governor contract instead of the reserve contract, which I assume has a different baggage attached to it. provideAll just abstracts the logic of creating the item in baggage on the first incarnation and then checking the value on future upgrades.


t.log(vatDetailsAfter);
t.is(incarnation, 1, 'incorrect incarnation');
t.pass();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t.pass() is only necessary when there are no tests. There are a few t.is(), and a t.truthy(), so this isn't helpful.

@iomekam iomekam added the automerge:squash Automatically squash merge label Dec 16, 2024
Copy link
Contributor

mergify bot commented Dec 17, 2024

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@mergify mergify bot merged commit bfca51a into master Dec 17, 2024
81 checks passed
@mergify mergify bot deleted the iomekam-ar-upgrade-tests branch December 17, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:squash Automatically squash merge force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contract Upgrade: v36-Reserve
3 participants