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: upgrade v8, the priceAuthorityRegistry #10418

Merged
merged 2 commits into from
Nov 27, 2024
Merged

chore: upgrade v8, the priceAuthorityRegistry #10418

merged 2 commits into from
Nov 27, 2024

Conversation

Chris-Hibbert
Copy link
Contributor

closes: #10401

Description

Upgrade the priceAuthorityRegistry

Security Considerations

N/A

Scaling Considerations

N/A

Documentation Considerations

Does need to be mentioned in the upgrade description.

Testing Considerations

As issue #10401 directs, we verify that quoteWanted() continues to work.

Existing tests in z:acceptance verify that prices continue to be received by vaults.

Upgrade Considerations

This should be included in upgrade 19.

@Chris-Hibbert Chris-Hibbert added contract-upgrade oracle Related to on-chain oracles. force:integration Force integration tests to run on PR labels Nov 7, 2024
@Chris-Hibbert Chris-Hibbert self-assigned this Nov 7, 2024
@Chris-Hibbert Chris-Hibbert requested a review from a team as a code owner November 7, 2024 00:07
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

Looks correct, provided it doesn't put an Installation in agoricNames.installations.

I have a few suggestions and a question.

Comment on lines +10 to +11
registryRef: publishRef(
install('@agoric/vats/src/vat-priceAuthority.js'),
Copy link
Member

Choose a reason for hiding this comment

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

Will this update agoricNames.installation with a new zoe Installation? Since this isn't a contract, that would be odd.

Copy link
Contributor Author

@Chris-Hibbert Chris-Hibbert Nov 8, 2024

Choose a reason for hiding this comment

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

Oh! good point. I'll have to figure out how to pass the bundle through without installing a contract.

We use publishRef(install()) in the Zoe proposals. I don't know why that's okay, but it seems to be the standard approach.

Copy link
Member

Choose a reason for hiding this comment

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

We use publishRef(install()) in the Zoe proposals. I don't know why that's okay, but it seems to be the standard approach.

It was certainly the standard approach for the initial bootstrap of the system. Whether the idiom is appropriate for upgrades, I am not at all sure. @michaelfig , thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

publishRef(install(...)) is needed to create a bundlecap before running the getManifest* behaviours. This is appropriate for all circumstances when a contract needs to be taken from disk and its bundlecap passed in to the getManifest* call.

It's the getManifestForUpgradingRegistry that controls how those bundlecaps are passed to the behaviours. See below...

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 appropriate for all circumstances when a contract needs to be taken from disk and its bundlecap passed in to the getManifest* call.

@michaelfig: The issue @dckc is bringing up applies for non-contract vats. Is there a way to produce a bundleCap that can be used for pure vats that doesn't presume to install it as if it were a Zoe contract?

Copy link
Member

Choose a reason for hiding this comment

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

In const bundleRef = publishRef(install('entrypoint.js')), the install creates an on-chain bundleCap (not a Zoe installation) from entrypoint.js, and publishRef produces a VatSourceRef for it, all with no inherent dependency on Zoe.

The only time Zoe installations would be implicitly created and published under agoricNames.installation would be if your getManifest return value had an installations property, which it doesn't. Even if it did, the bundleRef still describes the underlying generic bundleCap, which has nothing to do with Zoe.

Other than that, you can put on your ocap reasoning cap to understand that the behaviours named by your manifest do not reference zoe, so they can't use Zoe. Furthermore, your behaviours correctly use the vat's adminNode to upgrade the non-contract vat to the bundleCap corresponding to the bundleRef.

Copy link
Member

Choose a reason for hiding this comment

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

This is appropriate for all circumstances when a contract needs to be taken from disk...

Sorry for the confusion; I mistyped. It should have been "... all circumstances when an [arbitrary JS module and its dependencies need] to be taken from disk...".

Comment on lines 7 to 15
* @param {BootstrapPowers & {
* consume: {
* vatAdminSvc: VatAdminSvc;
* vatStore: MapStore<
* string,
* import('@agoric/swingset-vat').CreateVatResults
* >;
* };
* }} powers
Copy link
Member

Choose a reason for hiding this comment

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

BootstrapPowers already has vatAdminSvc and vatStore defined this way, doesn't it?

Suggested change
* @param {BootstrapPowers & {
* consume: {
* vatAdminSvc: VatAdminSvc;
* vatStore: MapStore<
* string,
* import('@agoric/swingset-vat').CreateVatResults
* >;
* };
* }} powers
* @param {BootstrapPowers} powers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

agoricNames: par,
vatAdminSvc: par,
vatStore: par,
priceAuthority: 'par',
Copy link
Member

Choose a reason for hiding this comment

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

typo?

Suggested change
priceAuthority: 'par',
priceAuthority: par,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup.

Copy link

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

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: e8853cf
Status: ✅  Deploy successful!
Preview URL: https://217ae40b.agoric-sdk.pages.dev
Branch Preview URL: https://10401-registry.agoric-sdk.pages.dev

View logs

@Chris-Hibbert Chris-Hibbert added the automerge:squash Automatically squash merge label Nov 13, 2024
Comment on lines +10 to +11
registryRef: publishRef(
install('@agoric/vats/src/vat-priceAuthority.js'),
Copy link
Member

Choose a reason for hiding this comment

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

publishRef(install(...)) is needed to create a bundlecap before running the getManifest* behaviours. This is appropriate for all circumstances when a contract needs to be taken from disk and its bundlecap passed in to the getManifest* call.

It's the getManifestForUpgradingRegistry that controls how those bundlecaps are passed to the behaviours. See below...

Comment on lines +54 to +56
options: {
registryRef,
},
Copy link
Member

Choose a reason for hiding this comment

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

If the getManifest returns an installations: Record<InstallationName, BundleCap> property, that will cause the publishing of the bundleCaps in agoricNames.installation. However, you can see here that registryRef is just returned via options, not installations. No implicit publishing, just making it available to the upgradePriceAuthorityRegistry behaviour.

So, this part of the PR LGTM!

@Chris-Hibbert
Copy link
Contributor Author

This is going to show up twice, but I can't see that it got forwarded to anyone, so let me enter it again.

This is appropriate for all circumstances when a contract needs to be taken from disk and its bundlecap passed in to the getManifest* call.

@michaelfig: The issue @dckc is bringing up applies for non-contract vats. Is there a way to produce a bundleCap that can be used for pure vats that doesn't presume to install it as if it were a Zoe contract?

@Chris-Hibbert Chris-Hibbert removed the automerge:squash Automatically squash merge label Nov 14, 2024
@Chris-Hibbert Chris-Hibbert added the automerge:squash Automatically squash merge label Nov 14, 2024
@mergify mergify bot merged commit 1d5cb99 into master Nov 27, 2024
81 checks passed
@mergify mergify bot deleted the 10401-registry branch November 27, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:squash Automatically squash merge contract-upgrade force:integration Force integration tests to run on PR oracle Related to on-chain oracles.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vat Upgrade: v8-PriceAuthority
3 participants