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

Use commit tx number to reject stale messages. #154

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

Tibo-lg
Copy link
Contributor

@Tibo-lg Tibo-lg commented Sep 25, 2023

This PR aims to fix the issue where stale messages are receive and mess up the internal state of the LDK node. It does so by embedding the commitment transaction number together with commitment signatures, and checking that we are given the expected one within the with_useable_channel_lock method.

I reverted previous changes to the message handler dropping messages on disconnect as I believe they are not necessary anymore with this change.

I can't promise that all concurrency issues will be resolved by this patch, but it should at least be more robust than it currently is.

(Leaving as draft for now as it builds on top of #141 which is not merged yet).

Copy link
Collaborator

@luckysori luckysori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think this is a step in the right direction.

dlc-manager/src/sub_channel_manager.rs Show resolved Hide resolved
dlc-manager/src/sub_channel_manager.rs Show resolved Hide resolved
dlc-messages/src/message_handler.rs Show resolved Hide resolved
@Tibo-lg Tibo-lg marked this pull request as ready for review October 11, 2023 01:59
@Tibo-lg Tibo-lg changed the base branch from chore/ln-dlc/update-to-116 to feature/ln-dlc-channels October 11, 2023 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants