cronos icon indicating copy to clipboard operation
cronos copied to clipboard

Start with ~10GB genesis.json consume ~150GB of RAM at peaks

Open alpha-omega-labs opened this issue 1 year ago • 5 comments

Hello, Start with ~10GB genesis.json consume ~150GB of RAM at peaks and about 80GB after initialization. Is there a way to improve that, maybe cut some checks? It takes 30min to 10h to finish process. Thank you

alpha-omega-labs avatar Sep 10 '23 20:09 alpha-omega-labs

you need to open this to cosmos-sdk, I think there's some streaming json support in newer version.

yihuang avatar Sep 11 '23 01:09 yihuang

Yes, they seems to be working on it for some time with genesis.json streaming. https://github.com/cosmos/cosmos-sdk/issues/11601 At the moment start of chain from big (not so big, just ~10GB) genesis.json seems to be not possible because or resource usage - ram and CPU. e.g 10GB genesis.json cause up to 200GB ram spikes during initialization and attempts to sign blocks. Keeping in mind that cronos also have very big state - you might benefit from streaming genesis.json in future too.

alpha-omega-labs avatar Sep 18 '23 12:09 alpha-omega-labs

I think there's already some streaming support with the collections module: https://github.com/cosmos/cosmos-sdk/blob/main/collections/genesis.go

yihuang avatar Sep 19 '23 01:09 yihuang

Looks like there is no actual way to optimize this, chain, resource wide, cannot be started with .json of big size.

We will rollback on v0.44 and after try to make inplace upgrade to cronos. Few questions: Is v0.47 of cronos available? are you going towards v0.5?

Do you have in-place upgrade code or examples for v0.44 to v0.46.15 jump?

Thank you!

alpha-omega-labs avatar Sep 26 '23 13:09 alpha-omega-labs

changing to capnproto and flatbuffer would be helpful (not plain text json) or bson

leejw51crypto avatar Oct 17 '23 09:10 leejw51crypto