Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
326 stars 206 forks source link

change all dapp deploy scripts to install by hash bundle, not source bundle #4564

Open warner opened 2 years ago

warner commented 2 years ago

What is the Problem Being Solved?

After #4563 gives Zoe the ability to E(zoe).install(bundleID) (instead of a bundle), and after #4396 gives cosmic-swingset the ability to accept "install bundle" transactions, the next step of the process is to change the deploy scripts in all dapps to use them. Currently, these deploy scripts use bundleSource() on the local contract code, then E(zoe).install(bundle), which creates a large (swingset/mailbox) message to deliver the bundle to the chain and install it. That should change to:

Description of the Design

We need the client-side facility to create the new transaction types.

Security Considerations

On the real chain, for the Mainnet-1 timeframe, there will be a governance process to limit the installation of new contracts. The bundleID must be in an approved list before the install-bundle transaction will be accepted. Test chains won't have such a limitation. I think the real chain process will look like:

Test Plan

cc @michaelfig

Tartuffo commented 2 years ago

@kriskowal Is this something you could take on?

kriskowal commented 2 years ago

I can. I would bump the estimate to 5. I’ll need to get up-to-speed on @warner’s bundle caps API and some kernel layers I haven’t touched yet. The extra time is probably a good investment.

Tartuffo commented 2 years ago

Estimate bumped.

Tartuffo commented 2 years ago

This needs to happen for the RUN Protocol Review release, but not for all DApps, just for the scripts that deploy the proposal(s) to start RUN protocol. We need someone to pick up this work. FYI @dckc

michaelfig commented 2 years ago

The current plan that @kriskowal is working on does not require any code changes to deploy scripts. We may still change deploy scripts for other reasons (captured in other issues), but this is not one of them.

kriskowal commented 2 years ago

The plan has changed. Dapps will need to performa a migration like: https://github.com/Agoric/dapp-fungible-faucet/pull/46

This is because bundleSource and publishBundle are orthogonal concerns. bundleSource should be pinned in yarn.lock, and cannot be pinned down if agoric-sdk is linked and not installed. publishBundle has an optional ConnectionSpec argument shouldn’t be threaded through bundleSource implicitly.

These aren’t absolute constraints, but I think strong enough to make the separation between the two functions clear in dapp deploy scripts.