You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
given this file genesis.tar.gz you can see there are several accounts that are funded, and several on chain events that happen. For example, with account dydx1qz30lp48lkdhcx2uw34v3mulc6se3wmw5cqn9t You can see it was given 100000000000dv4nt and it did a MsgCreateValidator tx. Both of these should be in the database, but they do not exist in block 1. I would like to see something like genesis = true.
The logic would be, query the chunked genesis via rpc. Look at all of the @type": "/cosmos.auth.v1beta1.BaseAccount and @type": "/cosmos.vesting.v1beta1.DelayedVestingAccount and any other type of accounts. Then look for all activity they did in the genesis file.
For example, this shows an account that has genesis funding. This should count as a Receive
Each chunk is a base64 slice of the Genesis JSON file
Each chunk will end in invalid JSON
Each chunk will need to be decoded and concatenated together to produce valid JSON for parsing
The workflow would have to look like this:
Get initial chunk=0
Loop until chunk num == total - 1 to get all chunks
Base64 decode every chunk
Concatenate all base64 decoded chunks
Loop through parsed genesis results and index
Difficulties/Dangers
This workflow presents a few difficulties and dangers:
Most Nodes return a 403 Forbidden at this endpoint. I can assume this is due to the amount of data returned in the requests and to prevent abuse of Public Nodes
This will SIGNIFICANTLY increase the RAM required for the application. From testing, I have seen a single chunk taking up 21+ mb of memory, and we would need to load every chunk into the application at runtime
Suggestions
I would suggest 2 potential options for this feature:
Provide an entirely seperate index-genesis command instead of adding this into the base index command workflow
This would allow running this once in an expected environment to allow for workflows that increase RAM for this single process
Provide an option of loading the genesis from a pre-downloaded genesis file.
This would allow running the command without requiring a Node to allow the endpoint response
yeah, i think we should have a separate index-genesis command. I believe spacebox has this capability too, might be worth look into seeing how they decided to solve it. I think chunked_genesis api endpoint is good, pending we can count on all chains having a cosmos-sdk version that supports this. An alternative is we could use the genesis url mentioned in the chain-registry for chains.
given this file genesis.tar.gz you can see there are several accounts that are funded, and several on chain events that happen. For example, with account
dydx1qz30lp48lkdhcx2uw34v3mulc6se3wmw5cqn9t
You can see it was given100000000000dv4nt
and it did aMsgCreateValidator
tx. Both of these should be in the database, but they do not exist in block 1. I would like to see something likegenesis = true
.The logic would be, query the chunked genesis via rpc. Look at all of the
@type": "/cosmos.auth.v1beta1.BaseAccount
and@type": "/cosmos.vesting.v1beta1.DelayedVestingAccount
and any other type of accounts. Then look for all activity they did in the genesis file.For example, this shows an account that has genesis funding. This should count as a
Receive
and this shows an account that did the
MsgCreateValidator
tx , this should be treated like a normalMsgCreateValidator
tx.The text was updated successfully, but these errors were encountered: