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

10248 install contractGovernor once #10256

Merged
merged 2 commits into from
Oct 21, 2024
Merged

10248 install contractGovernor once #10256

merged 2 commits into from
Oct 21, 2024

Conversation

Chris-Hibbert
Copy link
Contributor

closes: #10248

Description

#10163 (priceFeed coreEval) installed the contractGovernor twice, unnecessarily. This installs it once, and passes the reference from the auction proposal to the vaultFactory proposal.

Security Considerations

Repairs a minor issue with legibility of upgraded contracts.

Scaling Considerations

N/A

Documentation Considerations

N/A

Testing Considerations

priceFeed update tests continue to pass.

Upgrade Considerations

This will be included with the priceFeed coreEval, which is expected to be added to upgrade 18.

@Chris-Hibbert Chris-Hibbert added Governance Governance contract-upgrade next-release about next agoric-sdk or endo release labels Oct 10, 2024
@Chris-Hibbert Chris-Hibbert self-assigned this Oct 10, 2024
@Chris-Hibbert Chris-Hibbert requested a review from a team as a code owner October 10, 2024 23:24
Copy link

cloudflare-workers-and-pages bot commented Oct 10, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: e319cd1
Status: ✅  Deploy successful!
Preview URL: https://fd07db08.agoric-sdk.pages.dev
Branch Preview URL: https://10248-installonce.agoric-sdk.pages.dev

View logs

@Chris-Hibbert Chris-Hibbert requested a review from dckc October 10, 2024 23:28
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.

The auctioneer governor doesn't seem quite right.

@@ -9,40 +9,51 @@ const trace = makeTracer('NewAuction', true);
/**
* @typedef {PromiseSpaceOf<{
* auctionUpgradeNewInstance: Instance;
* newContractGovBundleId: string;
Copy link
Member

Choose a reason for hiding this comment

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

hm. "new" with respect to what? Are we certain we'll never do this again? If not, what would we call it next time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My theory is that since I reset() it at the end, it doesn't stick around to clutter the name space. We can call it "new" again next time or something more specific.

I had "priceFeed" in the name originally, but when I decided it would be better to reset() when complete, I went for a shorter name that I thought was clearer.

@@ -9,40 +9,51 @@ const trace = makeTracer('NewAuction', true);
/**
* @typedef {PromiseSpaceOf<{
* auctionUpgradeNewInstance: Instance;
* newContractGovBundleId: string;
Copy link
Member

Choose a reason for hiding this comment

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

And this promise space key is shared across the whole bootstrap vat, right?

At some point, it belongs in ChainBootstrapSpaceT. I wonder when we should do that. hm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only if it sticks around, as far as I'm concerned.

electorateCreatorFacet,
newContractGovBundleIdP,
]);
newContractGovBundleIdErasor.reset();
Copy link
Member

Choose a reason for hiding this comment

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

IIRC, a reset() like this made something more difficult last time. Testing or something. Here's hoping I remember more detail.

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 there was 3-way communication that time, and it was conceivable that the second reader would reset before the first reader had read. There are only two parties this time.

@@ -179,6 +190,7 @@ export const addAuction = async ({
);

auctionUpgradeNewInstance.resolve(governedInstance);
newContractGovBundleId.resolve(contractGovernorBundle.bundleID);
Copy link
Member

@dckc dckc Oct 11, 2024

Choose a reason for hiding this comment

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

correctness problem

When we make the governor for the auctioneer that we're adding, we don't seem to use an installation based on this ID.

Is there a way to test that we got that part right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we make the governor for the auctioneer that we're adding, we don't seem to use an installation based on this ID.

startInstance() wants an Installation, while upgradeContract() wants a BundleId. The cleanest way of tying those together seems to be in getManifestForAddAuction().

That takes the bundleRef (contractGovernorRef) from the proposalBuilder script and passes both it and the installation produced from it (installations: { contractGovernor: restoreRef(contractGovernorRef) }) to the auction proposal. The addAuction proposal uses the installation to start the new auction, and passes the bundleId through promise space to the upgrade-vaults proposal.

I could verify that both governors have the same bundle, but I don't see how the Installation and bundleId could become dissociated.

@Chris-Hibbert Chris-Hibbert added automerge:squash Automatically squash merge and removed automerge:squash Automatically squash merge labels Oct 16, 2024
@Chris-Hibbert Chris-Hibbert requested a review from dckc October 21, 2024 17:55
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.

as discussed, we don't seem to be using the new governor code in addAuctioneer

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 see the timing on the installation is right after all

@Chris-Hibbert Chris-Hibbert added the automerge:rebase Automatically rebase updates, then merge label Oct 21, 2024
Pass just the bundleId through from the first proposal to the second,
and then reset() the value.

Also cleaned up some leftover permissions
@mergify mergify bot merged commit 7f90751 into master Oct 21, 2024
80 checks passed
@mergify mergify bot deleted the 10248-installOnce branch October 21, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge contract-upgrade Governance Governance next-release about next agoric-sdk or endo release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install contractGovernor only once in priceFeed replacement proposal
2 participants