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

install Inter protocol defi contracts after boostrap using publishBundle #5819

Closed
dckc opened this issue Jul 25, 2022 · 9 comments
Closed

install Inter protocol defi contracts after boostrap using publishBundle #5819

dckc opened this issue Jul 25, 2022 · 9 comments
Assignees
Labels
enhancement New feature or request Inter-protocol Overarching Inter Protocol vaults_triage DO NOT USE wontfix This will not be worked on
Milestone

Comments

@dckc
Copy link
Member

dckc commented Jul 25, 2022

Problem Statement?

Unlike the PSM contract, which can be considered part of the platform, vaults introduce defi considerations that motivate launching them as a separate governance action.

Description of the Design

Somewhat like the RUN Protocol Preview (#5062), but use publishBundle (#4975) and hash bundles to avoid putting the full text of the bundles inside swingset messages.

Documentation Considerations

A runbook seems in order, much like ...

See also:

Security Considerations

see also

Test Plan

Note that the testnets/devnets we typically stand up lately using instagoric avoid this problem by using a swingset config (derived from decentral-demo-config.json) where the contracts get installed as part of bootstrap. So testing this involves

  1. start a chain without the Inter protocol contracts
  2. Do enough governance to get the Vaults working
    1. generate proposals to install them (agoric run inter-protocol/scripts/init-core.js)
      • including any add-collateral-core.js proposals to add IBC assets to the VBANK and such.
    2. submit the proposals using agd gov submit-proposal swingset-core-eval ... as in cosmic-swingset/Makefile
    3. vote on the proposals
    4. Exercise gov committee, Oracle invitations to set up the Vaults, Auction, etc.
  3. Verify that you can open a vault, get liquidated, etc.

optional goals:

  • static typing for coreProposals

cc @warner

@dckc dckc added enhancement New feature or request Inter-protocol Overarching Inter Protocol labels Jul 25, 2022
@dckc
Copy link
Member Author

dckc commented Jul 28, 2022

Do we really want to start the SwingSet VM without the Inter Protocol contracts?

Based on plans from April (#5062), the sketch above includes:

  1. start a chain without the Inter protocol contracts
  2. Do enough governance to get the AMM and Vaults working

but maybe it's simpler to combine those steps?

Combining them is the more well-trodden path in engineering. @michaelfig and I added make scenario2-run-chain-economy for use by @samsiegart and others. @arirubinstein integrated something analagous into instagoric. Doing them separately includes kludges such as this ticket is intended to address, as well as other aspects that have likely bit-rotted.

Doing them together is arguably simpler from a BLDer DAO governance perspective.

Other product launch considerations may apply. @Tartuffo I hope you'll help coordinate those.
cc @dtribble

@kriskowal
Copy link
Member

@dckc, I believe this issue is solved by agoric publish or agd tx swingset install-bundle workflows. May I close this?

@dckc
Copy link
Member Author

dckc commented Nov 3, 2022

no; there's also all the bootstrapping to wire up feeMintAccess and such.

@rowgraus rowgraus added vaults_triage DO NOT USE and removed MUST-HAVE labels Jan 3, 2023
@dckc dckc changed the title install Inter protocol contracts using publishBundle install Inter protocol defi contracts after boostrap using publishBundle Jan 3, 2023
@dckc
Copy link
Member Author

dckc commented Jan 3, 2023

pruning work-around from description

but let's keep it available for searching...

In the course of the RUN Protocol Preview (#5062), we ran into some (cosmos?) size limitation when installing the contracts using the normal technique of calling E(zoe).install(bundle) from a deploy script.

Work-around: fragmentation and reassembly

We came up with inter-protocol/scripts/deploy-contracts.js, which does fragmentation and reassembly:

  1. install endo-pieces-contract.js, which is small enough to not need fragmentation
  2. use installInPieces.js, which fragments bundles into modules and sends themto endo-pieces-contract.js for reassembly

Description of the Design

Use publishBundle (#4975) and hash bundles to avoid putting the full text of the bundles inside swingset messages.

One part of the work-around that would be nice to keep is a resulting E(home.scratch).get('installCache') of the form

CopyMap<Hash,
            {
              sha512: string,
              installation: Installation,
              path?: string
            }>

But maybe that's rendered obsolete in favor of chainStorage stuff for installations?

@dckc
Copy link
Member Author

dckc commented Jan 18, 2023

Which parts can/should be included in genesis/bootstrap?

  • starting the EC? We did for pismo
  • starting the Oracle network?
  • starting the PSM(s)?
    • at least one is needed for smart wallet creation

p.s. yes to all 3. In particular, re Oracles:

dckc added a commit that referenced this issue Apr 11, 2023
devnet configuration was moving to a smaller set of bootstrap bundles,
picking up provisionPool and walletFactory by way of coreProposals.

But the test-vaults-config is more widely tested, so until we pick up
work on #5819, let's postpone that.

 - a bit of lint
 - sort devnet-config bundles to match test-vaults-config
dckc added a commit that referenced this issue Apr 13, 2023
devnet configuration was moving to a smaller set of bootstrap bundles,
picking up provisionPool and walletFactory by way of coreProposals.

But the test-vaults-config is more widely tested, so until we pick up
work on #5819, let's postpone that.

 - a bit of lint
 - sort devnet-config bundles to match test-vaults-config
@dckc dckc added this to the Vaults EVP milestone Apr 29, 2023
@dckc
Copy link
Member Author

dckc commented Apr 30, 2023

broke ground:

c21dea9 * origin/5819-launch-inter fix(devnet): omit vaults contracts from platform launch config

@dckc
Copy link
Member Author

dckc commented May 1, 2023

PSM prefixes config didn't land in #6645, did it?

@ivanlei ivanlei assigned mhofman and unassigned dckc May 1, 2023
@ivanlei
Copy link
Contributor

ivanlei commented May 3, 2023

This is no longer plan of record for the vaults release.

@ivanlei ivanlei closed this as completed May 3, 2023
@dckc dckc added the wontfix This will not be worked on label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Inter-protocol Overarching Inter Protocol vaults_triage DO NOT USE wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants