it first writes the signature to a dedicated state file
it then stores the signed message in the DB and broadcasts it
Since it is very hard to retrieve the height from the DB, we instead retrieve it from the state file and subtract one to always be safe.
Now, in the worst case Tendermint needs to replay more blocks then absolutely necessary. However, this is fast and prevents issues when the state is not 100% clean.
Seems like Tendermint uses a 2-stage approach:
Since it is very hard to retrieve the height from the DB, we instead retrieve it from the state file and subtract one to always be safe. Now, in the worst case Tendermint needs to replay more blocks then absolutely necessary. However, this is fast and prevents issues when the state is not 100% clean.