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

Research and extend proto codec handling to allow codec switching based on block height #21

Open
pharr117 opened this issue Oct 29, 2023 · 0 comments

Comments

@pharr117
Copy link
Collaborator

The Probe package allows turning on-chain data into Go types using protobuf. This requires the package knowing the possible types beforehand and including the potential Msg interface definitions in the app Codec.

Proper usage of proto types requires the application developer to keep old message protos around in a properly versioned way so that Nodes and RPC queriers can handle old (and potentially deprecated) types as well as new ones.

One danger of this is that some chain developers may not properly deprecate their old message types and instead just update the proto files, thus breaking interface unpacking for old blocks.

One way to get around this is to include the proto definitions for old types. However, due to Type URL usage, these would supersede the new definitions and the problem would just shift to newer blocks.

It may be possible to build a potential extension to Codec handling such that certain codecs can be applied to a particular block height (or set of blocks), allowing the application to switch to the proper type at runtime without crashing.

One way it could work is a map like:

var appCodecsByHeight map[uint64]<CodecType>

where the application would choose which Codec to use by retrieving the Codec based on range.

@pharr117 pharr117 added enhancement New feature or request AA DAO Grant labels Oct 29, 2023
@pharr117 pharr117 added this to the Milestone 1 milestone Oct 29, 2023
@pharr117 pharr117 self-assigned this Oct 29, 2023
@pharr117 pharr117 moved this to Todo in Defiant OSS Nov 1, 2023
@danbryan danbryan removed the enhancement New feature or request label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants