On chain app upgrade


Has there been some work done on how one would go about making a Cosmos SDK based application which can be updated through an on chain transaction?

By upgrade I mean both updating the application state machine and also potentially transforming the on chain state/data. If one uses something like Ethermint/Lotion, the one sort og gets this for free, as there is a VM running on top of Tendermint, but how would one do this in the SDK, or in any other more light weight way.