Skip to content

Send back the actual received amount, not expected on HTLC fails #297

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

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

This resolves an incorrect implementation of the spec and fixes a
major privacy leak.

Fixes GH #289.

@TheBlueMatt TheBlueMatt added this to the 0.0.8 milestone Jan 22, 2019
@TheBlueMatt TheBlueMatt force-pushed the 2019-01-back-fail-privacy branch 5 times, most recently from 29cffba to 571f03e Compare January 24, 2019 16:51
This shouldn't be required, but it may help prevent some downstream
race conditions due to clients not sending message events quickly
enough and trying to send stale messages before new
channel_reestablish messages.
This is an oversight as the MessageSendEvent is otherwise entirely
useless.
Sadly this requires reducing the honggfuzz iterations to fit within
Travis' runtime limits.
@TheBlueMatt TheBlueMatt force-pushed the 2019-01-back-fail-privacy branch from 571f03e to 8b63892 Compare January 24, 2019 18:19
Copy link
Contributor

@dongcarl dongcarl left a comment

Choose a reason for hiding this comment

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

  1. The comment for fail_htlc_backwards should be updated
  2. An issue should be opened for the TODO

@@ -1357,17 +1359,17 @@ impl ChannelManager {
/// after a PaymentReceived event.
/// expected_value is the value you expected the payment to be for (not the amount it actually
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. The comment for expected_value is no longer needed
  2. The comment should describe what the function does instead of under what conditions it will be called
  3. The comment should describe what the return value represents

This resolves an incorrect implementation of the spec and fixes a
major privacy leak.

Fixes GH lightningdevkit#289.
@TheBlueMatt TheBlueMatt force-pushed the 2019-01-back-fail-privacy branch from 8b63892 to 74588b2 Compare January 24, 2019 21:55
@TheBlueMatt
Copy link
Collaborator Author

Fixed the docs, thanks. We have lots of TODOs in the code, sadly we're not at the production-ready state yet where we get all of them into the issue tracker :/.

Copy link
Contributor

@dongcarl dongcarl left a comment

Choose a reason for hiding this comment

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

LGTM!

@ariard
Copy link

ariard commented Jan 25, 2019

ACK 74588b2, a nit, but seems to me commit message isn't strictly right as TODO isn't implemented, just lay work for fix

@TheBlueMatt
Copy link
Collaborator Author

The TODO refers to HTLCs/payments with the same hash, but different values.

@ariard
Copy link

ariard commented Jan 25, 2019

Ah yes good, read too fast, think at first you were aiming to solve both fail/claim cases with this commit. TODO implies to add an expected value parameter to claim_funds function in future commit, may need to update a good chunk of things, so good for now.

@TheBlueMatt TheBlueMatt merged commit f99acc6 into lightningdevkit:master Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants