The AI Works community logo The Blockchain Works community logo The Functional Works community logo The Golang Works community logo The Java Works community logo The JavaScript Works community logo The Python Works community logo The Remote Works community logo The WorksHub company logo

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies.

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies. Less

We use cookies and other tracking technologies... More

Login or register
to publish this job!

Login or register
to save this job!

Login or register
to save interesting jobs!

Login or register
to get access to all your job applications!

Login or register to start contributing with an article!

Login or register
to see more jobs from this company!

Login or register
to boost this post!

Show some love to the author of this blog by giving their post some rocket fuel 🚀.

Login or register to search for your ideal job!

Login or register to start working on this issue!

Login or register
to save articles!

Login to see the application

Engineers who find a new job through Functional Works average a 15% increase in salary 🚀

You will be redirected back to this page right after signin

Add support for redispatching OpaqueMsg

Issue closed
Pull requests: 1
Contributors: 0
Level: Intermediate
  • Go
Issue closed
Pull requests: 1
Contributors: 0
Level: Intermediate
  • Go

On GitHub

Basic cosmos-sdk app with web assembly smart contracts
More info >

Issue posted by: 
ethanfrey's avatar

Ethan Frey

Description

Summary

The keeper in wasmd needs to implement OpaqueMsg dispatch. See TODO panic here

Problem Definition

OpaqueMsg is a way that any blockchain-specific transaction can be relayed to a contract for approval (eg. multisig), then re-dispatched by that contract to the blockchain. We cannot have any (possibly upgradable) data structures in a contract as it will break on a chain upgrade. We also want contracts to be chain angostic.

This means that the meaning of the bytes is opaque to the contracts, which just accept them as input, and send them as output (like theproposed mask contract). However, we need to define a clear format and have an agreement between the clients and the (go) blockchain app.

Proposal

First, we define the structure, either as go-amino or "canonical json". I would go with the JSON encoding for ease of debugging to start (even if this is amino-json). We can swap this out later before a production release if so desired, but the internal cosmos-sdk encoding is also up for discussion now.

We can then parse any returned "opaque msg" with this codec, into a sdk.Msg, and then send it to the router.

To test this, we should deploy the mask contract, and send a proper encoded message on behalf of the mask. Since the wasm module has access to the entire router (https://github.com/cosmwasm/wasmd/blob/master/app/app.go#L179-L184), as an integration test for approval, we should be able to:

  1. send tokens to a mask
  2. re-send tokens to another account via send msg
  3. re-send tokens to another account via opaque msg
  4. stake tokens on behalf of the mask via opaque msg (this is too hard to do in unit tests... will do manually)
  5. document how to create opaque payloads

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

    Use Open Source to hire or get hired

    On GitHub

    Basic cosmos-sdk app with web assembly smart contracts
    More info >

    Issue posted by: 
    ethanfrey's avatar

    Ethan Frey

    Use Open Source to hire or get hired

    Add support for redispatching OpaqueMsg
    View on GitHub