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

Improve publishing DX for deploying contracts #9517

Open
7 tasks
kriskowal opened this issue Jun 17, 2024 · 0 comments
Open
7 tasks

Improve publishing DX for deploying contracts #9517

kriskowal opened this issue Jun 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kriskowal
Copy link
Member

What is the Problem Being Solved?

The current process for deploying a contract involves an agoric run script which generates some artifacts and recommends shelling out to agd to do the actual work. These agd commands can fail if the message sizes exceed the maximum configured for the designated RPC node. A particularly pernicious failure mode is when one accidentally submits a package.json instead of a bundle.json, in which case the chain not only cannot process the request, but also can’t identify the request in a way that the requester can observe. (The response topic is keyed on the expected bundle identifier, inside the JSON envelope.)

Description of the Design

To holistically address these problems, we need to streamline the submission process and ensure that messages to the chain are consistently smaller than the maximum message size. We need a solution that continues to leverage the expressiveness of the agd command line tool, particularly interfacing with hardware wallets and secret storage (ergo, march back from pure JavaScript CosmJS APIs and back to agd subprocesses in agoric publish). We can leverage a module Content Address Store to reduce duplication between bundles, but should continue to disincentivize duplication. Even if we do eliminate duplication between overlapping contract dependencies, we must still fragment submissions across multiple messages to the chain when the new material is too large for a single message.

Adjacent

@warner and I propose a process (#5096) that herds the DX through a single agoric subcommand that shells out to agd as many times as necessary to submit the entire contract, spanning multiple messages if necessary. This will give us the freedom to make the protocol more interactive: The tool would take a bundle, extract it into memory, submit the compartment-map.json to the chain, watch for a response from the chain that includes the hashes of the modules it does not already have, then follow up with one or more messages to deliver those modules.

The chain would then use a variation on importBundle to assemble a contract from just its compartment-map.json and a CAS for the individual modules, keyed on their integrity sha512 hash.

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant