-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle rollbacks I #184
Comments
The solution we discussed for handling rollbacks is a 3-step approach, for which the first step was completed as part of #228 and #221 Step 1As a first step, we want to untangle the low-level construction and observation of on-chain transactions. We've been carrying around an To achieve this, we create a With this, the tracking of the on-chain head state within the chain component becomes trivial => some data is stored in a TVar. Step 2After step 1, we've made it so that storing the on-chain head state within the chain component itself has become redundant or unnecessary. The chain components evolves around inputs it receives from the head logic ( Thus, it is possible to make the entire approach more stateless by moving the content of the TVar to
So, what we need ultimately is get the middle Direct.State layer to yield events that contain new version of the on-chain head state, which remains opaque but can now be stored directly in the head logic and then, be provided back for constructing transactions in Step 3Finally, once we've made the chain component stateless and centralized all state representation in the head logic state, we can move the head logic from an aggregated representation to a representation in the form of sequence of events. Done naively, we can always reconstruct the required state by folding over the sequence of events. After that, handling rollback becomes quite straightforward as it only requires to drop events that happened beyond the point of rollback, and then, replay the application state from it. |
What does "remaining operational" actually mean? If we are fine by loosing off-chain state, but always want to stay "in control" of the Head, we could do the following for example (as a very simple dirt-road):
|
An (easy) extension to ☝️ is to keep track of two points, an "init" point and an "open" point. That way, we could distinguish the rollbacks impacting the opening of a Head or not. Only when the opening of the head is impacted we would (suggest) to throw away the off-chain head state. |
Updated the requirements to reflect our current approach. |
Done as we also merged #310 |
What & Why
Currently, rollbacks are not handled by
hydra-node
. If a rollback occurs in Layer 1 and there are open Hydra Heads after the rolled-back fork point,hydra-node
will crash. A basic ("dirt-road") solution ensuring thathydra-node
remains operational in such a scenario is needed in order to runhydra-node
on a public testnet.Full support for rollbacks will be implemented at a later stage ("high-way" solution) #185
Requirements
hydra-node
does not crash when a rollback occursServerOutput
is emitted to the client when a rollback occursTasks
The text was updated successfully, but these errors were encountered: