Conversation
|
it's ported to cosmos-sdk: cosmos/cosmos-sdk#16061, closing for now, I guess no need to merge the hacky solution here, cometbft can take the time for a better solution. |
| } | ||
|
|
||
| store.SaveBlockStoreState(&cmtstore.BlockStoreState{ | ||
| // it breaks the invariant that blocks in range [Base, Height] must exists, but it do works in practice. |
There was a problem hiding this comment.
This part is probably not ideal, but I don't have a better idea here, it's to initialize block store state, otherwise node can't start.
A related thing is, during normal state-sync, if the node is interrupted after switch to fast-sync but before download the first block, it's a similar situation, the node will end up in an invalid state.
There was a problem hiding this comment.
I took a look at our 'online' state sync procedure and it seems that the blockstore heights are not actually updated there. Also, by definition the base and height refer to the block in store and technically we do not have a block at state.LastBlockHeight. My suspicion is this is not needed as long as the operator ensures the store is empty beforehand. I am writing a test to confirm though!
|
This pull request 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. |
|
Hi @yihuang, thank you so much for all this work and I am sorry we did not get back sooner. We decided to go with your solution but feel it is safer to provide this functionality within an API that users can call, rather then giving them a separate command line to do so. I thus took over your branch, but as I don't have permission to work directly on it, I cloned it and opened a new PR: #1057 . It preserves all your commits though. The PR is a draft as I am writing tests to verify the code works and to verify we do not need the explicit setting of base and last height in blockstore (commented out atm) Please let me know if you see any technical problems with the proposed solution or if it is not supporting the use case you envision for this command? @tac0turtle does this API allow you to remove the code you have copied and bootstrap the stores just by calling it? |
|
Closing at it is superceeded by #1057 |
Ref: #29
Add
bootstrap-state heightcommand to initialize consensus state to specific height using light client protocol, user can restore app state from local snapshot in a separate step, then the node should be able to run.It's not intrusive to the handshaking process, compared with ADR-083
PR checklist
.changelog(we use unclog to manage our changelog)docs/orspec/) and code comments