Skip to content

Enable recovering in closed state too #1812

Description

@v0d1ch

Why

I ran into an issue where my funds got locked at the deposit contract after the Head got fanned-out. We could enable recovering also in the closed state so users have better time getting their funds back.

What

  • Propagate pendingDeposits map from the OpenState to ClosedState to enable the client input Recover working in both states.
  • Update HeadLogic/update function to enable recover in the Closed state too.

Activity

  1. self-assigned this
    on Jan 30, 2025
  2. ch1bo commented on Jan 30, 2025

    @ch1bo
    Member

    How about keeping the pending deposits completely outside of the HeadState? AFAIK a deposit is not really tied to a specific head. Consequently the state is independent of whether a head is open or not. The API under which this is available could be an indicator too, it does not involve any head id, right? IIRC that would be GET /deposits and recovering a deposit is DELETE /deposits/<deposit-id>.

  3. v0d1ch commented on Jan 30, 2025

    @v0d1ch
    ContributorAuthor

    Where do you propose we keep this information? HeadLogic deals with HeadState only and has access to Environment also but that is not a proper place to put it either. New data type?

  4. removed their assignment
    on Jan 30, 2025
  5. moved this from Triage 🏥 to Todo 📋 in ☕ Hydra Team Workon Jan 30, 2025
  6. v0d1ch commented on Jan 30, 2025

    @v0d1ch
    ContributorAuthor

    Conversation from slack for the reference:

    We drafted a notion of a NodeState in the past, which would contain one or more HeadState (even allowing multi-head node). So as the list of pending deposits is disconnected from any specific head (although they target a head, by id), we could think about keeping them there. So something like
    data NodeState tx = NodeState { headState :: HeadState tx, pendingDeposits :: [Deposit tx], lastEventId :: Last EventId }

  7. noonio commented on Jan 30, 2025

    @noonio
    Contributor

    I like this; I'm tempted not to over-complicate it and just leave @ch1bo 's suggestion to future work; especially that I do think it's reasonable to consider deposit's basically directed at a specific head, as mentioned.

  8. ch1bo commented on Jan 30, 2025

    @ch1bo
    Member

    I like this; I'm tempted not to over-complicate it and just leave @ch1bo 's suggestion to future work; especially that I do think it's reasonable to consider deposit's basically directed at a specific head, as mentioned.

    If we do not keep the deposits outside of HeadState I would argue that we need to add them to all variants of the sum type. Because the node could already see the head finalized or even adopted a new head altogether. If we make it convenient for users to list and recover deposits..it should be about all deposit seen, no matter which head we track.

    An overall alternative would be to not provide that convenience at all and outsource the listing and recovering to something completely different. For example the explorer and the hydra-tx binary/library. This has other complexities though.

  9. moved this from Todo 📋 to Triage 🏥 in ☕ Hydra Team Workon Apr 15, 2025
  10. modified the milestone: 0.22.0 on Apr 29, 2025
  11. moved this from Triage 🏥 to Todo 📋 in ☕ Hydra Team Workon May 13, 2025
  12. 12 remaining items

  13. removed
    amber ⚠️Medium complexity or partly unclear feature
    on Sep 10, 2025
  14. linked a pull request that will close this issueFollow up: deposit recovering in all states #2256on Sep 12, 2025
  15. moved this from Done ✔ to In progress 🕐 in ☕ Hydra Team Workon Sep 17, 2025
  16. moved this from In progress 🕐 to Done ✔ in ☕ Hydra Team Workon Sep 17, 2025
  17. linked a pull request that will close this issueFollow up: deposit selection order for ReqSn #2263on Sep 17, 2025
  18. moved this from Done ✔ to In progress 🕐 in ☕ Hydra Team Workon Sep 18, 2025
  19. reopened this on Sep 18, 2025
  20. moved this from In progress 🕐 to Triage 🏥 in ☕ Hydra Team Workon Sep 18, 2025
  21. moved this from Triage 🏥 to In progress 🕐 in ☕ Hydra Team Workon Sep 18, 2025
  22. added this to the 0.23.0 milestone on Sep 18, 2025
  23. moved this from In progress 🕐 to Done ✔ in ☕ Hydra Team Workon Sep 23, 2025
  24. moved this from 2024 Q4 to 2025 Q4 in 🚢 Hydra Head Roadmapon Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions