-
Notifications
You must be signed in to change notification settings - Fork 208
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
controller.installBundle() #3269
Comments
see also #2391 and discussion of blobcaps |
The idea here is a consensus-visible cosmos-sdk transaction message type which adds a blob of data to a store, indexed by its hash. This txn will require a fee that is independent of the usual "add something to the run-queue" message fee, and possibly substantial: it is intended to both cover the eternal costs of retaining the blob, and to discourage the use of scarce+expensive chain/validator resources as a general-purpose data store. The blob is meant to hold a JavaScript module source file (or possibly a whole package worth of modules). It would be appropriate (and probably preferable) to impose a requirement that the blob must be parseable as JavaScript, and perhaps even semantically valid, as this would futher discourage its use as a general-purpose data store. A second message type will define a bundle, as a manifest which references a number of module/package blobs by their hash index. This message will only be accepted if all of the referenced modules/packages already exist. The associated "bundle hash" (hash of the manifest data) will be used as the index. Once accepted into a block, the bundle index will be eligible for use by the "bundle device": vats can call So far, this only provides a way to install dynamic vat code (i.e. a bundle which exports A second mechanism (not sure how it should work yet) should be used to get the contract's bundle index into a place where it can be efficiently evaluated into the running ZCF vat. That can live in a separate ticket. |
I'm currently implementing this:
The way this should integrate with our bootstrap mechanism:
Eventually, as we integrate At the cosmic-swingset layer, we'll need a new cosmos-sdk transaction type to install a bundle. The arguments should include the alleged bundleID (hash) and the serialized bundle itself. The @michaelfig and I are still discussing what the contract-author -visible workflow should be. I'm in favor of something like I think he's more in favor of having a deploy script drive everything, giving it an authority to invoke cc @dckc and @michaelfig on the "core bootstrap" integration, @rowgraus on how our contract installation pathway might compare to those of other projects, and @erights on general principles. |
I don't presume to say your helper program is unnecessary, just that it's easier to create a composable API and then use it from within a shell command (such as It always bothered me that there were two deploy scripts necessary for nearly every dapp (the first of which was only necessary sometimes) and that they shared state via the filesystem. With the ability to have a bundle installation be idempotent, it is now possible to have just one script to execute when iterating on your dapp. |
Nobody actually writes code nowadays. They just copy and modify. |
Ah, I'll totally agree with that. I guess it comes down to what we're asking developers to do at the end (middle?) of their process, when they're ready to deploy. Heroku lets me I guess it also relates to what mental model we want developers to build. Having a CLI tool to install a contract feels (to me) like it would look simpler, that it would give the message "hey, isn't this easy?", and I can imagine a screencast showing the process. Having the developer write a program to use the API feels like more work, to me. But on the other hand, that imaginary video might look simpler just because it ends before the actually-interesting part: instantiating the contract, where there are object references that need to be stashed and used by more code later. A demo which uses the CLI to do the part that doesn't require unique code might be sending the wrong message if the full workflow really does require the developer to think about the program they must write (or copy-paste) to do something with the resulting control facets. Hm, I guess this is also a wallet question. If we expect some GUI affordances to manage the contract you just instantiated, then we need a way to link up 1: a directory of source code that you've written/edited/cloned, 2: a possible CLI tool invocation that triggers something, 3: an ag-solo instance that can act as your agent, and 4: the wallet GUI. If the problem were simpler, I'd lean towards the CLI tool on top of an API for more complex things. But I don't know how the wallet should be involved. |
@warner After various meetings, this ended up with a MN-1 tag AND in the Product Backlog pipeline (not MN-1 Backlog). Please modify appropriately for what it should actually be. |
@warner please create a separate ticket for the cosmic-swingset part of this, and remove that label from this. |
(by warner):
The task here is for swingset to expose a
controller.installBundle()
API. This will deliver a code bundle into the kernel, and make the associated bundleID (hash) available for use within the vats.#4396 is a separate task is for cosmic-swingset to expose this to transactions.
The text was updated successfully, but these errors were encountered: