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

Specify a bundle to use when upgrading auctions #9937

Merged
merged 5 commits into from
Aug 21, 2024
Merged

Conversation

Chris-Hibbert
Copy link
Contributor

closes: #9936

Description

Upload new auction code for the coreEval.

Security Considerations

N/A

Scaling Considerations

none

Documentation Considerations

none

Testing Considerations

Added a test that the new vat has a different bundle ID. I couldn't find any accessible behavioral differences to test.

Upgrade Considerations

verify that upgrade happened.

@Chris-Hibbert Chris-Hibbert added contract-upgrade auction next-release about next agoric-sdk or endo release labels Aug 21, 2024
@Chris-Hibbert Chris-Hibbert requested a review from dckc August 21, 2024 18:58
@Chris-Hibbert Chris-Hibbert self-assigned this Aug 21, 2024
Copy link

cloudflare-workers-and-pages bot commented Aug 21, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: b0df701
Status: ✅  Deploy successful!
Preview URL: https://94da373a.agoric-sdk.pages.dev
Branch Preview URL: https://9936-auctionbundle.agoric-sdk.pages.dev

View logs

@Chris-Hibbert Chris-Hibbert added the force:integration Force integration tests to run on PR label Aug 21, 2024
Comment on lines 70 to 78
await E.when(
installationP,
installation =>
E(E(agoricNamesAdmin).lookupAdmin('installation')).update(
'auctioneer',
installation,
),
err => console.error(`🚨 failed to update vaultFactory installation`, err),
);
Copy link
Member

@dckc dckc Aug 21, 2024

Choose a reason for hiding this comment

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

Using the promise space is supposed to take care of agoricNames for you:

Suggested change
await E.when(
installationP,
installation =>
E(E(agoricNamesAdmin).lookupAdmin('installation')).update(
'auctioneer',
installation,
),
err => console.error(`🚨 failed to update vaultFactory installation`, err),
);
produceInstallation.reset();
produceInstallation.resolve(installationP);

combined with:

    installation: {
      produce: { auction: produceInstallation },
    },

I'm not 100% sure these are equivalent. thinking it over.

Copy link
Member

Choose a reason for hiding this comment

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

Reviewing the code for makePromiseSpaceForNameHub, I see that

  • using the promise space updates agoricNames as a side-effect, so they stay in sync, but
  • updating agoricNames directly does _not _ update the promise space, so if someone later tries to use installation.consume.auctioneer, they'll get the old installation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fix the code in upgradeVaults as well.

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 turned into a major clean-up.

@dckc this means upgrade-vaults.js needs a fresh review.

} = powers;
},
{ options },
) => {
Copy link
Member

Choose a reason for hiding this comment

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

I'm struggling to understand this change. Is it just formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's mostly formatting. The old code had access to the name powers within the body. That was used in some proposals in order to pass all the powers to sub-proposals. That isn't happening here, so I reverted to the more conventional (for proposals) format of expanding powers in the parameter list, rather than passing it through and expanding it in the body.

It was just (bad?) luck that the differ matches the expansion of powers in the param list with the identical one in the body.

I would have accepted a suggestion that it was unrelated to this PR, but now that I'm changing the expansion of powers in order to get installation.produce.VaultFactory, I'll leave it in as cleanup related to that.

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.

I think it's worth keeping the installation promise space in sync with agoricNames

function newAuctioneerFromNewBundle(details) {
for (const detail of details) {
// contract vat names are based on bundleID
const originalAuctionVatName = 'zcf-b1-a5683-auctioneer';
Copy link
Member

Choose a reason for hiding this comment

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

seems like this should be hoisted out of the loop.

not critical

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point.

await E.when(
installationP,
installation =>
E(E(agoricNamesAdmin).lookupAdmin('installation')).update(
Copy link
Member

Choose a reason for hiding this comment

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

I would expect agoricNamesAdmin to disappear from the permit of the auction part. I wonder why I don't see it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

upgradeVaults.js still uses it for the auction instance at line 226. Should that use promise space instead?

add-auction.js added it in b6e0739, but dropped it in 37505e3.

Copy link
Member

Choose a reason for hiding this comment

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

upgradeVaults.js still uses it for the auction instance at line 226. Should that use promise space instead?

yes.

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

economicCommitteeCreatorFacet: electorateCreatorFacet,
auctioneerKit: legacyKitP,
},
produce: { newAuctioneerKit, auctionsUpgradeComplete },
Copy link
Member

Choose a reason for hiding this comment

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

in discussion, we agreed newAuctioneerKit should go away in favor of the auctionsUpgradeComplete sync point and replacing auctioneerKit ( with reset, resolve ).

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

@@ -179,14 +193,23 @@ export const ADD_AUCTION_MANIFEST = harden({
auctioneer: true,
Copy link
Member

Choose a reason for hiding this comment

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

don't need to consume the auctioneer installation

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

@Chris-Hibbert Chris-Hibbert requested a review from dckc August 21, 2024 22:31
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 good.

Comment on lines +51 to +53
const installationP = E(zoe).installBundleID(bundleID);
produceVaultInstallation.reset();
produceVaultInstallation.resolve(installationP);
Copy link
Member

Choose a reason for hiding this comment

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

The publishRef / install stuff in builders/scripts/*.js is supposed to take care of this installBundleId and reset / resolve.

But the only cost to doing it this way is 1 cross-vat call and a bit of allocation / GC. And there's benefit in clarity.

And it looks like the reset is missing from the other code path:

installationEntries.map(([key, value]) => {
produceInstallations[key].resolve(value);
return E(installAdmin).update(key, value);

let installationP;
const installationP = E(zoe).installBundleID(bundleID);
produceVaultInstallation.reset();
produceVaultInstallation.resolve(installationP);

await auctionsUpgradeComplete;
auctionsUpgradeCompleteProducer.reset();
Copy link
Member

Choose a reason for hiding this comment

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

It's a little surprising that the vaults upgrade is producing auctionsUpgradeComplete. Now I remember: this is why. A bit more docs might be nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think your earlier suggestion of a naming convention is good.

My theory here is that names like fooProcessCompletion should be considered to be single-use flags and should be cleaned up once consumed.

@Chris-Hibbert Chris-Hibbert added the automerge:squash Automatically squash merge label Aug 21, 2024
@mergify mergify bot merged commit b6379da into master Aug 21, 2024
80 checks passed
@mergify mergify bot deleted the 9936-auctionBundle branch August 21, 2024 23:32
mergify bot added a commit that referenced this pull request Aug 22, 2024
refs: #9940

## Description

#9937 unintentionally upgraded the vaultFactory with the instance of the old auction. This change asks the promise space for the auction instance after the new auction startup is complete.

### Security Considerations

None.

### Scaling Considerations

None.

### Documentation Considerations

None.

###Testing Considerations

This will be tested on Ollinet and emerynet before deployment.

I tested locally on a3p by watching the logs to see that the vaults synced to the new auction schedule.

###Upgrade Considerations

upgrade vaults and auctions so they work together.
kriskowal pushed a commit that referenced this pull request Aug 27, 2024
closes: #9936

## Description

Upload new auction code for the coreEval.

### Security Considerations

N/A

### Scaling Considerations

none

### Documentation Considerations

none

### Testing Considerations

Added a test that the new vat has a different bundle ID. I couldn't find any accessible behavioral differences to test.

### Upgrade Considerations

verify that upgrade happened.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auction automerge:squash Automatically squash merge contract-upgrade force:integration Force integration tests to run on PR next-release about next agoric-sdk or endo release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add auction bundle to coreEval for vaults & auctions release
2 participants