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

feat: upgrade v7-board and test it #10516

Merged
merged 10 commits into from
Nov 28, 2024
Merged

feat: upgrade v7-board and test it #10516

merged 10 commits into from
Nov 28, 2024

Conversation

Chris-Hibbert
Copy link
Contributor

closes: #10394

Description

Upgrade v7-board.

Security Considerations

The Board is a critical vat.

Scaling Considerations

v7-Board is consuming more resources than it should. restarting it should clean up a fair amount of space. ...checking

Documentation Considerations

None

Testing Considerations

Verify that the board doesn't lose anything.

Upgrade Considerations

Can go out in Upgrade 19.

@Chris-Hibbert Chris-Hibbert added contract-upgrade force:integration Force integration tests to run on PR labels Nov 18, 2024
@Chris-Hibbert Chris-Hibbert self-assigned this Nov 18, 2024
@Chris-Hibbert Chris-Hibbert requested a review from a team as a code owner November 18, 2024 19:16
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.

It seems "restarting it should clean up a fair amount of space." is not mentioned in the test plan of #10394

Would you please clarify that this is on purpose? Do we have other plans (mainfork?) for testing that?


const { adminNode } = await E(vatStore).get('board');

await E(adminNode).upgrade(boardBundleCap, {});
Copy link
Member

Choose a reason for hiding this comment

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

I suggest logging completion of upgradeBoard.

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
Copy link
Contributor Author

Would you please clarify that this is on purpose? Do we have other plans (mainfork?) for testing that?

Sorry, I wrote "restarting it should clean up a fair amount of space. ...checking", meaning that I intend to see if approaches like I used in #9595 would show some improvement. I'll do that next.

@Chris-Hibbert
Copy link
Contributor Author

Well I get a count of 422 before in a3p-integration, and 432 after, using a query like this (with vatID = 7).

    sql.get([`SELECT COUNT(*) from kvStore WHERE key LIKE '${vatId}.c.%'`]);

I don't know what objects are soaking up space on mainnet, but they're not in evidence here.

@mhofman @warner Is there anything else worth checking in a3p-integration?

Copy link

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

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: a3e6f86
Status: ✅  Deploy successful!
Preview URL: https://44030cb1.agoric-sdk.pages.dev
Branch Preview URL: https://10394-board.agoric-sdk.pages.dev

View logs

@Chris-Hibbert
Copy link
Contributor Author

Well, we did a bunch of measuring, and ran a lot of tests, but were unable to replicate the issue from MainNet. The code in a3p-integration stubbornly refused to allocate and retain the excess objects that we see on mainNet, so the tests don't show that this upgrade reclaims the space.

The requirement to upgrade the vat is independent of addressing this issue, so I'd like to move forward with the upgrade, and return to the other issue when we have a better theory about how to replicate the problem.

@dckc
Copy link
Member

dckc commented Nov 26, 2024

retain the excess objects that we see on mainNet

I asked about the relevant issue for that. You suggested that...

... is in the neighborhood. Yes, I see it discusses a passStyleOf memoization cache.

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'm not confident that I'm reading this correctly.

A bit of voice discussion might help.

cp /usr/src/upgrade-test-scripts/eval_submission.js .

#echo RUNNING ./eval_submission.js
#./eval_submission.js
Copy link
Member

Choose a reason for hiding this comment

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

Is execution of ./eval_submission.js commented out on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. I cleaned up other parts of the file while I was here.

const same =
idsBefore.length === idsAfter.length &&
idsBefore.every((element, index) => element === idsAfter[index]);
assert(same, 'keys must stay the same');
Copy link
Member

Choose a reason for hiding this comment

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

Is this a test assertion? Or is it intended to run in production?

If it fails, we know there's a problem, but the damage is already done, 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.

The same proposal with this assertion will run in production as on our test networks. If it succeeds in tests, we'll have confidence that it will succeed in production.

Would you suggest logging the result rather than asserting it?

Copy link
Member

Choose a reason for hiding this comment

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

So it's in prod by design. Ok.

import { evalBundles } from '@agoric/synthetic-chain';

test('test upgraded board', async t => {
await evalBundles('submission');
Copy link
Member

Choose a reason for hiding this comment

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

what bundles does this refer to? a comment might help readers like me that don't have this API swapped in

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

@@ -3,7 +3,7 @@ import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/

/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
export const defaultProposalBuilder = async (_, opts) => {
console.log('OPTS', opts);
console.log('feeDist OPTS', opts);
Copy link
Member

Choose a reason for hiding this comment

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

what's this -short.js file for? a @file comment would be nifty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a comment.

const thing1Id = await E(board).getId(thing1);
assert(thing1Id.match(/^board0[0-9]+$/));

// /////// can we retrieve something stored long ago? ////////
Copy link
Member

Choose a reason for hiding this comment

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

what is the thing stored long ago that we're retrieving?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The brand. The comment was displaced from its subject.

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.

OK. I get it now. Looks good.

@Chris-Hibbert Chris-Hibbert added the automerge:squash Automatically squash merge label Nov 27, 2024
@mergify mergify bot merged commit d8a109e into master Nov 28, 2024
81 checks passed
@mergify mergify bot deleted the 10394-board branch November 28, 2024 02:02
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contract Upgrade: v7-board
2 participants