Skip to content

[bugfix] Hard fork height support

Son of Odin requested to merge hard-fork-height into master

In practicing a hard fork of thorchain, I had noticed that the new chain starts from block height 1, instead of the height we left off. This was a bit surprising to me.

Its also an issue because we use the block height for many uses in the codebase. For example, txout is saved to a specific height, so we run the risk of double signing all transactions when we hard fork. Validator rewards is calculated from block height, so that math wouldn't work properly, and so forth.

There is a tendermint/cosmos open issue to allow a hard from to start from a non 1 height. This would be the better and safer approach, so hopefully this gets done and we can use that instead of this code. But wanted to have the option for ourself if we wanted to use this approach. https://github.com/tendermint/tendermint/issues/4646

Edited by Son of Odin

Merge request reports