Skip to content

chore: do not write chain info to vstorage #11312

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

Merged
merged 7 commits into from
Apr 22, 2025

Conversation

0xpatrickdev
Copy link
Contributor

@0xpatrickdev 0xpatrickdev commented Apr 22, 2025

closes: #11310

Description

  • prefer decentral-itest-orchestration-config.json to decentral-itest-orchestration-chains-config.json in boot and multichain-testing tests
  • ensure all example contracts provide their own chainInfo in proposal builder opts
  • eliminate all* reliance on chain info being written to vstorage, except for packages/boot/test/orchestration/vstorage-chain-info.test.ts which explicitly tests this functionality

Security Considerations

None

Scaling Considerations

None

Documentation Considerations

None

Testing Considerations

Updates existing tests. Preserves vstorage tests in a new file - packages/boot/test/orchestration/vstorage-chain-info.test.ts

Upgrade Considerations

None, contract changes in the PR are only for example contracts.

@0xpatrickdev 0xpatrickdev force-pushed the 11310-remove-chain-info-from-vstorage branch from 5e384f8 to be51f72 Compare April 22, 2025 17:05
Copy link

cloudflare-workers-and-pages bot commented Apr 22, 2025

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 743a0ce
Status: ✅  Deploy successful!
Preview URL: https://514dc5ef.agoric-sdk.pages.dev
Branch Preview URL: https://11310-remove-chain-info-from.agoric-sdk.pages.dev

View logs

@0xpatrickdev 0xpatrickdev added the force:integration Force integration tests to run on PR label Apr 22, 2025
@0xpatrickdev 0xpatrickdev force-pushed the 11310-remove-chain-info-from-vstorage branch 3 times, most recently from 008d9b0 to 44880e8 Compare April 22, 2025 18:43
@0xpatrickdev 0xpatrickdev marked this pull request as ready for review April 22, 2025 18:43
@0xpatrickdev 0xpatrickdev requested a review from a team as a code owner April 22, 2025 18:43
Comment on lines 166 to 177
const parseChainInfo = () => {
if (typeof chainInfo !== 'string') return undefined;
return JSON.parse(chainInfo);
};
const parseAssetInfo = () => {
if (typeof assetInfo !== 'string') return undefined;
return JSON.parse(assetInfo);
};
const opts = harden({
chainInfo: parseChainInfo(),
assetInfo: parseAssetInfo(),
});
Copy link
Member

Choose a reason for hiding this comment

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

this bit is getting repeated a lot. consider factoring it out

Copy link
Member

Choose a reason for hiding this comment

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

+1 but I won't block on 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.

Good idea, added a parseChainHubOpts helper

@@ -110,10 +110,6 @@ jobs:
make fund-provision-pool
working-directory: ./agoric-sdk/multichain-testing

- name: Override Chain Registry
Copy link
Member

Choose a reason for hiding this comment

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

this should save some time too

Comment on lines 166 to 177
const parseChainInfo = () => {
if (typeof chainInfo !== 'string') return undefined;
return JSON.parse(chainInfo);
};
const parseAssetInfo = () => {
if (typeof assetInfo !== 'string') return undefined;
return JSON.parse(assetInfo);
};
const opts = harden({
chainInfo: parseChainInfo(),
assetInfo: parseAssetInfo(),
});
Copy link
Member

Choose a reason for hiding this comment

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

+1 but I won't block on it

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, presuming tests still passed.

I don't see any production code changes so I reviewed the commits somewhat quickly.

Comment on lines +34 to +35
export const startStakeAtom = async (
{
Copy link
Member

Choose a reason for hiding this comment

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

odd whitespace change. makes this part of the diff a little harder to read

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 change here and in startStakeOsmo, startStakeBld is incorporating the second argument, options

Comment on lines 29 to 30
export const startStakeBld = async (
{
Copy link
Member

Choose a reason for hiding this comment

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

again, I'm struggling to see what the substance of this change is

Comment on lines 29 to 20
},
options,
Copy link
Member

Choose a reason for hiding this comment

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

are the options the same on all these example contracts? if so, I wonder about a common builder with an arg to pick which core eval to build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More or less, yes. I didn't go with a common builder (yet) but added a parseChainHubOpts helper

@@ -7,7 +7,6 @@
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
import { E } from '@endo/far';
import { parseArgs } from 'node:util';
Copy link
Member

Choose a reason for hiding this comment

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

I wonder how this worked before

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 never did - it was a part of a change introduced in this PR. I probably could've fixed up to avoid misleading here.

@0xpatrickdev 0xpatrickdev force-pushed the 11310-remove-chain-info-from-vstorage branch from ab60c44 to 3ce3903 Compare April 22, 2025 21:03
@0xpatrickdev 0xpatrickdev added the automerge:rebase Automatically rebase updates, then merge label Apr 22, 2025
@0xpatrickdev 0xpatrickdev force-pushed the 11310-remove-chain-info-from-vstorage branch from 3ce3903 to ca0f832 Compare April 22, 2025 21:16
@0xpatrickdev 0xpatrickdev force-pushed the 11310-remove-chain-info-from-vstorage branch from ca0f832 to 743a0ce Compare April 22, 2025 21:47
@mergify mergify bot merged commit f8c06e6 into master Apr 22, 2025
90 checks passed
@mergify mergify bot deleted the 11310-remove-chain-info-from-vstorage branch April 22, 2025 22:18
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 force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

do not write chainInfo to vstorage in testing environments
3 participants