tendermint / tendermint

⟁ Tendermint Core (BFT Consensus) in Go
https://tendermint.com/
Apache License 2.0
5.68k stars 2.07k forks source link

genesis file update not reflecting after restart the network #9200

Closed dev573 closed 1 year ago

dev573 commented 1 year ago

1- I have a genesis file in this location $BINARY/config/genesis.json.

2- Started the chain with $BINARY/config/genesis.json file.

3- When I hit rpc url http://ip:26657/genesis?. I was getting the same genesis file data which was in $BINARY/config/genesis.json.

4 - Then I stop the chain, make some changes to $BINARY/config/genesis.json and start the chain again.

5 - When I hit rpc url again http://ip:26657/genesis?. that time the updated genesis file was not found. I found the old genesis, which was when the chain first time started.

even after restarting the network (Stopped the chain and then start it again), Still having the same genesis file data. Could anyone help me out here ?

williambanfield commented 1 year ago

@VineeDev The genesis file is not intended to be changed after starting a Tendermint chain. This is not generally a supported behavior. Tendermint stores the initial genesis file in its data base when it is first started, so changes to the file on disk are not observed. To change the genesis file, you should likely start a new chain.

Could you give some background on why you are doing this so I can better understand if this is an issue Tendermint may be able to solve?

dev573 commented 1 year ago

So @williambanfield , first of all thanks for the reply. The scenario is if i need to make some changes in genesis file after running the network. There might be some cases where i need this scenario. So i am trying to test out this scenario.

faustbrian commented 1 year ago

@VineeDev What data would you need to modify? Generally you should do that in EndBlock via consensus_param_updates and anything else you need to modify isn't the concern of Tendermint but your application.

dev573 commented 1 year ago

Ok thanks @faustbrian, one more thing i need to ask i set the block time to 2 second buy editing in genesis file "blocks_per_year": "15778800". is it the right way or do i need to make changes somewhere as well.

faustbrian commented 1 year ago

Isn't blocks_per_year a configuration from the Cosmos SDK rather than Tendermint?

dev573 commented 1 year ago

yes, just asking if you have any idea about this.

faustbrian commented 1 year ago

No, I'm only using Tendermint, not the Cosmos SDK.

Pitasi commented 1 year ago

I was experimenting a bit as well. I'd like to edit the genesis and spin up a new chain, starting from a different height (setting initial_height in the genesis file). However, what I'd like to do is to keep the history of previous blocks and transactions, so that Tendermint can still query them using RPCs.

From the perspective of the client of the RPC, pretty much nothing changed. While I was able to perform a big migration, for example to a completely new application.

I'm not sure if my request makes sense. I'd like to keep historical data, but I don't want to replay those if a new node joins the network, because my new application might not support these transactions format, etc.

I mean, I'd probably be fine with a command similar to unsafe-reset-all that can retain blocks and txs in the db :)