Skip to content

Fix bug in check_spend_remote_htlc and let csv delays being user configurable #355

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

Conversation

ariard
Copy link

@ariard ariard commented Jul 19, 2019

Spotted while reviewing #336.

TODO: tweak a justice test on revoked HTLC outputs to check bug fix. Need test framework changes in #348 to go first.

@TheBlueMatt
Copy link
Collaborator

If you need the changes in #348 for testing, just rebase on top of it? Its close to going in anyway, just need one or two more tweaks.

@ariard ariard force-pushed the 2019-07-fix-csv-delay-check-remote-htlc branch from 9978224 to edee012 Compare July 23, 2019 20:22
We were previously using their_to_self_delay to regenerate scripts for
spending remote revoked htlc transactions, and that's a bug.

Their_to_self_delay is delay enforced by peer upon outputs returning
funds back to us.

Our_to_self_delay is delay enforced by us upon outputs returning funds
back to peer.
@ariard ariard force-pushed the 2019-07-fix-csv-delay-check-remote-htlc branch from edee012 to fe77f3e Compare July 23, 2019 20:25
@ariard
Copy link
Author

ariard commented Jul 23, 2019

Okay added a test for testing user configurable csv delay against hard bounds in channel constructors at fe77f3e, ready for review

@TheBlueMatt
Copy link
Collaborator

Looks like it needs rebase to pass travis?

@ariard ariard force-pushed the 2019-07-fix-csv-delay-check-remote-htlc branch from fe77f3e to 1c4544a Compare July 23, 2019 23:14
@ariard
Copy link
Author

ariard commented Jul 23, 2019

Checked, I was already rebased on master? Dunno pushed it again

@TheBlueMatt
Copy link
Collaborator

Well it may not be a rebase error, just a build failure.

@ariard ariard force-pushed the 2019-07-fix-csv-delay-check-remote-htlc branch from 1c4544a to a949d64 Compare July 23, 2019 23:31
@ariard
Copy link
Author

ariard commented Jul 23, 2019

Oh sorry build error due to rebase error of mine! Should be good now at a949d64

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Mostly spelling mistakes, sadly.

Antoine Riard added 3 commits July 24, 2019 17:53
Let these values being used as default ones in UserConfig.

Also, reduce them to something more reasonable, for BREAKDOWN_TIMEOUT
from 1 week to 1 day, for MAX_LOCAL_BREAKDOWN_TIMEOUT from 2 weeks
to 1.
within reasonable lower or upper bound

Add our_to_self_delay in Channel, to cache user config field at
channel construction.
Extend test_justice_tx with user-set csv delay to test that
we are able to claim revokeable outputs with different csv delay
between both peers.
@ariard ariard force-pushed the 2019-07-fix-csv-delay-check-remote-htlc branch from a949d64 to e78c25b Compare July 24, 2019 21:57
@ariard
Copy link
Author

ariard commented Jul 24, 2019

Corrected on e78c25b

@TheBlueMatt TheBlueMatt merged commit 60bf1fe into lightningdevkit:master Jul 24, 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.

2 participants