Webassembly-backed modules #42
KaiserKarel
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Synopsis
Using web assembly for business logic makes union easier upgradeable, as we do not require hard forks to upgrade the network.
Introduction
Introducing or altering new modules means the network necessarily must hard fork, which is a time-consuming and complicated operation. Cosmos chains often break in the process, and joining the network and bootstrapping (synchronizing from block 0), means you need to have access to all historic binaries.
Instead, I propose a module that wraps wasmd, and shells out actual business logic to wasm. This would allow the network to dynamically upgrade the modules by replacing the backing wasm.
Implementations
The go cosmos module would map wasm blobs to module ids
(ModuleId -> blob)
and forwardsdk.Message
s to the module.The module itself has access to all APIs through a host function interface.
You don't need to meter the blob, as it has the same privileges as a regular module.
We could choose to use the Cosmwasm standard, or a simpler interface with direct host bindings, handling protobuf deserialization inside the blob itself.
Upgrading a blob retains the
ModuleId
mapping, so existing integrations keep working.Interblob Calls
The module handles calls between wasm blobs by instantiating multiple VM instances.
Beta Was this translation helpful? Give feedback.
All reactions