-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Genesis Protobuf Migration #5917
Comments
|
Being worked on here by @alpe : https://github.com/alpe/cosmos-sdk/tree/genesis_demo/genesisdemo |
will part of this also depend on tendermint genesis work or is it orthogonal? I am starting to delve into the tendermint side of JSON encoding |
@marbar3778 Can you share some details/link about this? |
With #6147, we now have an easy pathway to support both Amino and Proto JSON, so I've updated this issue to include a task in this issue for adding flags to |
Also I've thought about how to approach streaming JSON based on some things @alpe has shared and just want to document the approach I have in mind. (I don't think we need to get to this quite yet.) Here are the constraints I see:
I think we can solve this with the following approach:
The API for this might look something like: type ObjectReader interface {
// reads the named field from the object into the ptr
ReadObject(name string, ptr interface{}) error
// opens a stream reader for the array at the named field
// this will open a separate file from the disk if it exists to support massive arrays
// (i.e. `delegations.json` for the field `delegations`)
StreamArray(name string) ArrayStreamer
}
type ArrayStreamer interface {
ReadNext(ptr interface{}) error
HaveMore() bool
} Using gogo jsonpb, there is already an |
we are discussing and started a small doc here: https://docs.google.com/document/d/1RzF9qvr-a6oYbmKdhHJ_lYLIUbxozTFfsJCwJzAqXkY/edit#heading=h.n4jqb5mvv9mq and have a issue here: tendermint/tendermint#4828 cc @aaronc |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
should we get started with the .proto files? or is it blocked by something else? |
There is still a question in my mind of whether we need streaming genesis for stargate. For ibc it’s likely not needed yet (because there isn’t a huge amount of live data on the hub). So migrating the current GenesisState to proto files is probably okay. However, the streaming genesis is l believe the future proof way to go for large import/exports. This is likely something we should discuss in our SDK call Friday. |
@anilcse and @sahith-narahari are going to export data from Cosmos Hub 3 so that we have a sense of how large the genesis import/export is. Then we can assess the best path forward. |
What are the performance benefits from streaming JSON? We've explored storing genesis state as a binary (we have 1.7M accounts and state is getting bloated) and only present genesis.json for readability purposes. |
Terra will release cosmwasm before Stargate, so the state size is going much lager. In this aspect, we need streaming feature to avoid out of memory situation. As @dokwon mentioned, It can be level db store like binary format. |
Hub's exported state is ~52M in size, we might not need streaming genesis for stargate. We can address that later may be. |
Thanks @anilcse. So sounds like it's more of an issue for Terra possibly. @YunSuk-Yeo do you know the actual size of the exported Terra genesis.json file? |
@aaronc Our exported genstate for Columbus-3 (December last year) was around 500M. Assuming filesize growth is linear to account number growth that would imply a Columbus-4 genstate fillesize of > 1GB. The first block took a good 2 minutes for the fastest validators to process, and a lot longer for most others. While I understand that the Hub would not have similar issues, think the SDK development should reflect needs of client chains that see sizable use. |
Context
Any
, the same structs can support both amino and protobuf JSONRoadmap
TxConfig
GenesisState
structs properly support both amino and proto JSON (this usually will involve migrating interfaces toAny
and generatingGenesisState
from a .proto file)/cc @alexanderbez @clevinson
The text was updated successfully, but these errors were encountered: