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(cosmic-swingset): grant addVaultType based on addr #4641

Merged
merged 5 commits into from
Mar 18, 2022
Merged

Conversation

dckc
Copy link
Member

@dckc dckc commented Feb 22, 2022

closes: #4634

I'd like to be sure @mhofman can reproduce my results before moving beyond draft.

Description

Grant access to the VaultFactory creatorFacet to up to one user based on address.

usage

in a dapp dir, after agoric install:

agoric start local-solo --reset -v > ,solo.log 2>&1
addr=$(cat _agstate/agoric-servers/local-solo-8000/ag-cosmos-helper-address)
VAULT_FACTORY_CONTROLLER_ADDR=$addr \
  CHAIN_BOOTSTRAP_VAT_CONFIG=@agoric/vats/decentral-loadgen-config.json \
    agoric start local-chain --reset -v

then you should see home.vaultFactoryCreatorFacet and be able to call E(home.vaultFactoryCreatorFacet).addVaultType() (cf vaultFactory.js).

Security Considerations

This mixes a demo / test mechanism in with production econ-behaviors.js, which we aim to avoid. But I think it's clear how the least authority needed is granted.

Documentation Considerations

IOU an update to env.md

Testing Considerations

It's lightly tested; packages/vats/test/test-boot.js does cover it to some extent.

cc @michaelfig

Comment on lines 9 to 19
"template": {
"agoricNames": true,
"bank": true,
"namesByAddress": true,
"myAddressNameAdmin": true,
"board": true,
"faucet": true,
"zoe": true,
"vaultFactoryCreatorFacet": true
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@michaelfig the keys of this template are supposed to be the things that the client manager waits for before resolving the chainbundle. Is this obsolete as of the notifier-based protocol for home properties?

Can the loadgen get that notifier?

Copy link
Member

Choose a reason for hiding this comment

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

@michaelfig the keys of this template are supposed to be the things that the client manager waits for before resolving the chainbundle. Is this obsolete as of the notifier-based protocol for home properties?

It's mostly orthogonal. Those things are the items that must be present before the first time the notifier fires.

Can the loadgen get that notifier?

Not currently. That would be a good change (always include the notifier as one of the properties on agoric).

Until then, the template ensures deploy scripts can have access to those objects. Without the template and without the notifier, there is only polling. So let's always ensure one of those is in force.

dckc and others added 4 commits March 18, 2022 20:51
usage:

in a dapp dir, after `agoric install`:

agoric start local-solo --reset -v > ,solo.log 2>&1
addr=$(cat _agstate/agoric-servers/local-solo-8000/ag-cosmos-helper-address)
VAULT_FACTORY_CONTROLLER_ADDR=$addr \
  CHAIN_BOOTSTRAP_VAT_CONFIG=@agoric/vats/decentral-loadgen-config.json \
    agoric start local-chain --reset -v
@mhofman
Copy link
Member

mhofman commented Mar 18, 2022

I have verified that this change, granting both priceAuthorityAdmin and vaultFactoryCreator to the loadgen client, is sufficient to rewrite the loadgen provisioning and re-enable the amm and vault tasks.

@dckc dckc marked this pull request as ready for review March 18, 2022 22:04
@dckc dckc changed the title feat(cosmic-swingset): grant addVaultType based on addr (DRAFT) feat(cosmic-swingset): grant addVaultType based on addr Mar 18, 2022
@dckc dckc added the automerge:squash Automatically squash merge label Mar 18, 2022
@mergify mergify bot merged commit e439024 into master Mar 18, 2022
@mergify mergify bot deleted the dc-grant-vault branch March 18, 2022 22:20
mhofman added a commit that referenced this pull request Mar 24, 2022
* chore(run-protocol): grant VaultFactory addVaultType etc. by address

* chore(vats): grantVaultFactoryControl permit, config

* feat(cosmic-swingset): grant addVaultType based on addr

usage:

in a dapp dir, after `agoric install`:

agoric start local-solo --reset -v > ,solo.log 2>&1
addr=$(cat _agstate/agoric-servers/local-solo-8000/ag-cosmos-helper-address)
VAULT_FACTORY_CONTROLLER_ADDR=$addr \
  CHAIN_BOOTSTRAP_VAT_CONFIG=@agoric/vats/decentral-loadgen-config.json \
    agoric start local-chain --reset -v

* chore: grant priceAuthorityAdmin along vaultFactoryCreator

Co-authored-by: Mathieu Hofman <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:squash Automatically squash merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

production bootstrap does not provide trading assets needed by loadgen
3 participants