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

hsmd: Implement Explicit Node-to-Signer Notification for Channel Data Deletion #6987

Closed
ksedgwic opened this issue Jan 10, 2024 · 0 comments · Fixed by #6988
Closed

hsmd: Implement Explicit Node-to-Signer Notification for Channel Data Deletion #6987

ksedgwic opened this issue Jan 10, 2024 · 0 comments · Fixed by #6988
Assignees
Labels
Milestone

Comments

@ksedgwic
Copy link
Collaborator

Description:

  • Issue: Currently, when a channel's outputs are "irrevocably resolved," the associated data can be pruned. However, the sequence of this process is crucial; the signer must only delete its data after the node does. A node requesting data that a signer has already forgotten causes fatal errors.
  • Current Approach: The signer independently monitors onchain data and uses a conservative approach to determine when a channel is resolved. This often results in the signer retaining data longer than necessary, leading to inefficiencies.
  • Proposed Solution: Introduce an explicit notification mechanism from the node to the signer. This notification should occur after the node has pruned the channel data, ensuring a synchronized and safe data deletion process between the node and the signer.

This change aims to enhance efficiency by minimizing unnecessary data retention in the signer, while maintaining data integrity and preventing errors due to premature data deletion.

ksedgwic added a commit to lightning-signer/c-lightning that referenced this issue Jan 10, 2024
Changelog-Added: hsmd: Added hsmd_forget_channel to enable explicit channel deletion. ([ElementsProject#6987])

Motivation: Previously, a signer prematurely forgetting a channel led
to failures in unresolved channel requests. This update introduces
hsmd_forget_channel, allowing nodes to explicitly notify signers when
a channel is irrevocably resolved and can be safely forgotten. This
ensures synchronized channel cleanup between nodes and signers.

This change maintains backward and forward compatibility. Nodes
explicitly check whether a signer has `WIRE_HSMD_FORGET_CHANNEL`
capability before sending the message.  Nodes without
`WIRE_HSMD_FORGET_CHANNEL` capability won't send this message. Signers
capable of handling this message but not receiving it will continue to
use conservative pruning methods.

Fixes ElementsProject#6987
ksedgwic added a commit to lightning-signer/c-lightning that referenced this issue Jan 10, 2024
Changelog-Added: hsmd: Added hsmd_forget_channel to enable explicit channel deletion. ([ElementsProject#6987])

Motivation: Previously, a signer prematurely forgetting a channel led
to failures in unresolved channel requests. This update introduces
hsmd_forget_channel, allowing nodes to explicitly notify signers when
a channel is irrevocably resolved and can be safely forgotten. This
ensures synchronized channel cleanup between nodes and signers.

This change maintains backward and forward compatibility. Nodes
explicitly check whether a signer has `WIRE_HSMD_FORGET_CHANNEL`
capability before sending the message.  Nodes without
`WIRE_HSMD_FORGET_CHANNEL` capability won't send this message. Signers
capable of handling this message but not receiving it will continue to
use conservative pruning methods.

Fixes ElementsProject#6987
ksedgwic added a commit to lightning-signer/c-lightning that referenced this issue Jan 10, 2024
Changelog-Added: hsmd: Added hsmd_forget_channel to enable explicit channel deletion. ([ElementsProject#6987])

Motivation: Previously, a signer prematurely forgetting a channel led
to failures in unresolved channel requests. This update introduces
hsmd_forget_channel, allowing nodes to explicitly notify signers when
a channel is irrevocably resolved and can be safely forgotten. This
ensures synchronized channel cleanup between nodes and signers.

This change maintains backward and forward compatibility. Nodes
explicitly check whether a signer has `WIRE_HSMD_FORGET_CHANNEL`
capability before sending the message.  Nodes without
`WIRE_HSMD_FORGET_CHANNEL` capability won't send this message. Signers
capable of handling this message but not receiving it will continue to
use conservative pruning methods.

Fixes ElementsProject#6987
@vincenzopalazzo vincenzopalazzo added this to the v24.02 milestone Jan 11, 2024
cdecker pushed a commit that referenced this issue Jan 17, 2024
Changelog-Added: hsmd: Added hsmd_forget_channel to enable explicit channel deletion. ([#6987])

Motivation: Previously, a signer prematurely forgetting a channel led
to failures in unresolved channel requests. This update introduces
hsmd_forget_channel, allowing nodes to explicitly notify signers when
a channel is irrevocably resolved and can be safely forgotten. This
ensures synchronized channel cleanup between nodes and signers.

This change maintains backward and forward compatibility. Nodes
explicitly check whether a signer has `WIRE_HSMD_FORGET_CHANNEL`
capability before sending the message.  Nodes without
`WIRE_HSMD_FORGET_CHANNEL` capability won't send this message. Signers
capable of handling this message but not receiving it will continue to
use conservative pruning methods.

Fixes #6987
gudnuf pushed a commit to gudnuf/lightning that referenced this issue Mar 1, 2024
Changelog-Added: hsmd: Added hsmd_forget_channel to enable explicit channel deletion. ([ElementsProject#6987])

Motivation: Previously, a signer prematurely forgetting a channel led
to failures in unresolved channel requests. This update introduces
hsmd_forget_channel, allowing nodes to explicitly notify signers when
a channel is irrevocably resolved and can be safely forgotten. This
ensures synchronized channel cleanup between nodes and signers.

This change maintains backward and forward compatibility. Nodes
explicitly check whether a signer has `WIRE_HSMD_FORGET_CHANNEL`
capability before sending the message.  Nodes without
`WIRE_HSMD_FORGET_CHANNEL` capability won't send this message. Signers
capable of handling this message but not receiving it will continue to
use conservative pruning methods.

Fixes ElementsProject#6987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants