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

fix(provisioning): export useful namesByAddress (release branch) #8786

Closed
wants to merge 5 commits into from

Conversation

dckc
Copy link
Member

@dckc dckc commented Jan 22, 2024

closes: #8311
this fix is for the release branch, anyway.
see #8821 for fix on master

DRAFT until:

Description

The namesByAddress provided by the provisioning vat is disconnected from namesByAddressAdmin, so it never gets populated.

Fortunately, the relevant nameHubKit is in baggage. So the fix here is to return that one.

Security Considerations

This should make it unnecessary for future core-eval scripts to get the whole namesByAddressAdmin authority when they only need namesByAddress to do something like deliver fees.

The permit of the upgrade core-eval is:

      consume: {
        vatStore: true,
        vatAdminSvc: true,
      },
      produce: {
        namesByAddress: true,
      },

Read/write access to the whole vatStore is excess authority; we only need access to read one of its entries, not authority to scribble over all the others and upgrade all the other vats.
vatAdminSvc is needed to look up a bundleID (hash) and return the corresponding bundleCap. Its only method beyond that sort of bundle lookup is E(vatAdminSvc).createVat(). That method is more than we need, but while it can be wasteful, it doesn't pose any risk to integrity.

Scaling Considerations

n/a

Documentation Considerations

fixes the chain to agree with our docs on name services

Testing Considerations

see DRAFT until list above

Upgrade Considerations

The bug is localized to the provisioning vat, so upgrading it seems to suffice.

Perhaps we should fix #8408 while we're at it?

@dckc dckc changed the base branch from master to release-mainnet1B January 22, 2024 18:37
@dckc
Copy link
Member Author

dckc commented Jan 22, 2024

seems to work...

I wonder what all the failed deposit to stATOM-USD price feed member are about. I hope it's left over from experimenting with other things on this local chain.

ag-power-tools-agd-1  | 2024-01-22T18:30:57.130Z SwingSet: vat: v1: evaluateBundleCap { manifestBundleRef: { bundleID: 'b1-af71cf8c6c422525b406913a427b6d6afe93bd29929f64a5e115da0913f37342931ac58abf3a60f5144ae642e285544abec2e637312d3f8802f13e401346af5b' }, exportedGetManifest: 'getManifestForProvisioning', vatAdminSvc: Promise [Promise] {} }
ag-power-tools-agd-1  | 2024-01-22T18:30:57.182Z SwingSet: vat: v1: execute { exportedGetManifest: 'getManifestForProvisioning', behaviors: [ 'getManifestForProvisioning', 'upgradeProvisioningVat' ] }
ag-power-tools-agd-1  | 2024-01-22T18:30:57.183Z SwingSet: vat: v1: coreProposal: upgradeProvisioningVat
ag-power-tools-agd-1  | 2024-01-22T18:30:57.183Z SwingSet: vat: v1: upgradeProvisioningVat...
ag-power-tools-agd-1  | 2024-01-22T18:30:57.184Z SwingSet: vat: v1: provisioning { adminNode: Object [Alleged: adminNode] {}, root: Object [Alleged: undefined] {} } b1-c40cda8e60deec8147a547ccfda551398056d69280edbf345e25f75c7943cd3b597637b9761ceb9d3e4690721be69dd4f493bab39177dbd98ee9633a41549f8d
ag-power-tools-agd-1  | 2024-01-22T18:30:58.039Z SwingSet: kernel: vat v11 upgraded from incarnation 0 to 1 with source b1-c40cda8e60deec8147a547ccfda551398056d69280edbf345e25f75c7943cd3b597637b9761ceb9d3e4690721be69dd4f493bab39177dbd98ee9633a41549f8d
ag-power-tools-agd-1  | 2024-01-22T18:30:58.043Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.044Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.046Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric1w8wktaur4zf8qmmtn3n7x3r0jhsjkjntcm3u6h { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.047Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric10vjkvkmpp9e356xeh6qqlhrny2htyzp8hf88fk { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.049Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric1qj07c7vfk3knqdral0sej7fa6eavkdn8vd8etf { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.050Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric1lw4e4aas9q84tq0q92j85rwjjjapf8dmnllnft { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.051Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric1ra0g6crtsy6r3qnpu7ruvm7qd4wjnznyzg5nu4 { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.052Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric1zj6vrrrjq4gsyr9lw7dplv4vyejg3p8j2urm82 { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.053Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric15xddzse9lq74cyt6ev9d7wywxerenxdgxsdc3m { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.054Z SwingSet: vat: v1: failed deposit to stATOM-USD price feed member agoric1w5wmck6q2xrt20ax3njlk2k87m4t4l2y2xgw2d { incarnationNumber: 0, name: 'vatUpgraded', upgradeMessage: 'fix namesByAddress' }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.058Z SwingSet: vat: v1: { name: 'provisioning', opts: { upgradeMessage: 'fix namesByAddress' }, incarnation: { incarnationNumber: 1 } }
ag-power-tools-agd-1  | 2024-01-22T18:30:58.236Z SwingSet: vat: v1: namesByAddress: new Promise
ag-power-tools-agd-1  | 2024-01-22T18:30:58.237Z SwingSet: vat: v1: namesByAddress settled; remaining: [ 'anchorKits', 'bankMints', 'contractGovernor', 'reserveGovernorCreatorFacet', 'scaledPriceAuthorityKits', 'vBankKits', 'vaultFactoryGovernorCreator' ]

@dckc
Copy link
Member Author

dckc commented Jan 23, 2024

  • review bootstrap for consumers of namesByAddress

I reviewed all occurrences of namesByAddress in the current SDK; unless there's something sneaky and dynamic going on, no production contracts nor vats are holding on to the old one.

@dckc dckc changed the base branch from release-mainnet1B to tmp-release-provisioning January 23, 2024 01:17
`namesByAddress` supplied by the provisioning vat was an
independent NameHub from `namesByAddressAdmin`.
@dckc dckc changed the base branch from tmp-release-provisioning to dc-a3p-15 January 26, 2024 03:08
@dckc
Copy link
Member Author

dckc commented Jan 26, 2024

@turadg please take a look. It's draft only because it's stacked on #8819 , my work-in-progress port of a3p-integration with "simplify core-eval" to a release branch context.

@mhofman perhaps you've got thoughts on how this should land in the release branch.

cc @Chris-Hibbert who is doing similar stuff.

See also #8821 for the corresponding fix for master, especially the testing considerations.

@dckc dckc changed the title fix(provisioning): export useful namesByAddress fix(provisioning): export useful namesByAddress (release branch) Jan 26, 2024
return { txhash, code, height, gas_used };
};

// XXX overlaps with passCoreEvalProposal from synthetic chain
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

hm... the reason has faded. something about staticConfig? I'll have to look again.

#!/bin/bash
source /usr/src/upgrade-test-scripts/env_setup.sh

yarn ava
Copy link
Member

Choose a reason for hiding this comment

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

glad see no file specified

@@ -67,6 +67,16 @@ test('sim/demo config provides home with .myAddressNameAdmin', async t => {
keyArrayEqual(t, keys(home).sort(), homeKeys);
});

test('namesByAddress contains provisioned account', async t => {
Copy link
Member

Choose a reason for hiding this comment

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

good thinking including here too

@dckc
Copy link
Member Author

dckc commented Feb 15, 2024

overtaken by stuff such as ##8901

@dckc dckc closed this Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants