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

Better handle data de-serialization for custom chains #66

Open
RiccardoM opened this issue May 9, 2022 · 0 comments
Open

Better handle data de-serialization for custom chains #66

RiccardoM opened this issue May 9, 2022 · 0 comments

Comments

@RiccardoM
Copy link
Contributor

Feature description

Currently in order to properly parse the transaction messages, Juno de-serializes the data using the Cosmos SDK types, particularly the sdk.Msg interface. Although this works, it requires a lot of work when dealing with custom chains: to properly deserialize an sdk.Msg instance, the various implementations must be registered within the used codec instance. This often requires Juno to be forked and use the custom chain code as a dependency (since sdk.Msg instances are registered in the provided codec instance there). This makes it hard to maintain future versions of Juno, since more and more chains will most likely use their custom messages and thus more and more forks need to be created.

Implementation proposal

To fix this issue, we can attempt defining our own Transaction and Message instance with custom de-serialization. Such instances should contain only the values that we are interested in reading for our purposes, and nothing more. Then, we leave the various modules with the burden of de-serializing the original transaction/message bytes to whatever type they want if needed.

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

No branches or pull requests

1 participant