Manually port #7798 Also requires https://github.com/tendermint/tendermint/pull/7607 and https://github.com/tendermint/tendermint/pull/8401