Skip to content
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

Decommit and close with same snapshot #1474

Closed
3 tasks
Tracked by #1057
ch1bo opened this issue Jun 18, 2024 · 1 comment
Closed
3 tasks
Tracked by #1057

Decommit and close with same snapshot #1474

ch1bo opened this issue Jun 18, 2024 · 1 comment
Assignees
Labels
task Subtask of a bigger feature.

Comments

@ch1bo
Copy link
Member

ch1bo commented Jun 18, 2024

What

Ensure this scenario works correctly, such that the on-chain code ensures not more than the still active UTxO is distributed on fanout:

image

While this could be fixed by clearing the utxoToDecommit + having a new snapshot multi-signed after observing the decrementTx, the goal of this item is to ensure the same snapshot can be used to correctly fan out and any participant is forced to do it correctly.

How

  • Update tests to assert fanned out utxo to not include utxoToDecommit / only the still active utxo
  • Update on-chain code to not allow additional fanout of utxoToDecommit
  • Update off-chain code to handle this correctly (clearing the utxo to decommit) and not try to fan it out

Rough algorithm:

  • Add a state reference $\eta_{ref}$ to each snapshot
  • Distinguish in close whether the decrement already happened or not using the state reference and close $\eta_\omega$ in closed state or not
  • When $\eta_\omega$ is in closed state, the fanout validator ensures it is distributed correctly
@ch1bo ch1bo mentioned this issue Jun 18, 2024
16 tasks
@ch1bo ch1bo changed the title Fix decommit and close with same snapshot Decommit and close with same snapshot Jun 18, 2024
@ch1bo ch1bo added the task Subtask of a bigger feature. label Jun 18, 2024
@v0d1ch v0d1ch self-assigned this Jun 18, 2024
@v0d1ch
Copy link
Contributor

v0d1ch commented Jun 20, 2024

To further elaborate, if we want to close/fanout but decommit was already observed then we are closing using different off-chain version and version from the snapshot. In this case we want to verify snapshot signature using $\eta_\omega$ from the close redeemer but alter close datum to remove $\eta_\omega$ so that fanout is correct.
decommit-with-different-version-snapshot

In the case snapshot version is the same as the off-chain state version then we can verify snapshot signature using $\eta_\omega$ from the close datum and fanout $\eta_\omega$ accordingly.
decommit-with-same-version

@v0d1ch v0d1ch closed this as completed Jul 5, 2024
@ch1bo ch1bo moved this to Blocked ✋ in ☕ Hydra Team Work Jul 5, 2024
@ch1bo ch1bo moved this from Blocked ✋ to Done ✔ in ☕ Hydra Team Work Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Subtask of a bigger feature.
Projects
Archived in project
Development

No branches or pull requests

2 participants