user2787: I wonder if it is possible to design a State Machine that has a special state transition that can upgrade the State Machine, meaning creating a new UTxO sitting at a new script address (instead of the old script address), representing the upgraded State Machine. After the upgrade, future transactions will be validated using the new State Machine.
I am not sure if this upgrading functionality is achievable using State Machine. If so, how can it be achieved?

user6086: 
Make a statemachine with a transition "Update".
Use Constraints (or otherwise, eg check) to layout in which contexts an "Upgrade" is permissible. For example "must be signed by my special key".
Make the upgrade target state a final state (isFinal s == True)

Et voila. You have "upgraded" your statemachine.
Obvs cardano validators are immutable - you can't upgrade them in the "mutate a thing" way

2787: <p>I wonder if it is possible to design a State Machine that has a special state transition that can upgrade the State Machine, meaning creating a new UTxO sitting at a new script address (instead of the old script address), representing the upgraded State Machine. After the upgrade, future transactions will be validated using the new State Machine.</p>
<p>I am not sure if this upgrading functionality is achievable using State Machine. If so, how can it be achieved?</p>
 6086: <ul>
<li>Make a statemachine with a transition &quot;Update&quot;.</li>
<li>Use <code>Constraints</code> (or otherwise, eg <code>check</code>) to layout in which contexts an &quot;Upgrade&quot; is permissible. For example &quot;must be signed by my special key&quot;.</li>
<li>Make the upgrade target state a final state (<code>isFinal s == True</code>)</li>
</ul>
<p>Et voila. You have &quot;upgraded&quot; your statemachine.</p>
<p>Obvs cardano validators are immutable - you can't upgrade them in the &quot;mutate a thing&quot; way</p>
