Skip to content

routing: add cltv limit#2640

Merged
halseth merged 6 commits into
lightningnetwork:masterfrom
joostjager:cltv-limit
Mar 27, 2019
Merged

routing: add cltv limit#2640
halseth merged 6 commits into
lightningnetwork:masterfrom
joostjager:cltv-limit

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

This PR adds a maximum cltv limit for payments, similar to the currently existing fee limit.

@joostjager joostjager requested a review from halseth February 13, 2019 11:34
@Roasbeef Roasbeef added this to the 0.6 milestone Feb 13, 2019
@Roasbeef Roasbeef added enhancement Improvements to existing features / behaviour routing rpc Related to the RPC interface cli Related to the command line interface labels Feb 13, 2019
@joostjager joostjager requested a review from wpaulino February 13, 2019 20:02
Copy link
Copy Markdown
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

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

Somewhat unrelated -- I noticed that we check for the fee limit when constructing the route from the path. Is there a reason that check is still needed since we already do it within path finding?

Comment thread routing/pathfind.go Outdated
Comment thread routing/pathfind_test.go Outdated
Comment thread cmd/lncli/commands.go Outdated
Comment thread lnrpc/rpc.proto Outdated
Comment thread routing/pathfind_test.go Outdated
@joostjager
Copy link
Copy Markdown
Contributor Author

Somewhat unrelated -- I noticed that we check for the fee limit when constructing the route from the path. Is there a reason that check is still needed since we already do it within path finding?

I don't think there is. It is a sanity check, but I think it can be removed. I didn't bother adding another one for cltvLimit.

@joostjager
Copy link
Copy Markdown
Contributor Author

@wpaulino PTAL

@wpaulino
Copy link
Copy Markdown
Contributor

I don't think there is. It is a sanity check, but I think it can be removed. I didn't bother adding another one for cltvLimit.

Gotcha, would be nice to remove it in a follow-up PR then.

@joostjager
Copy link
Copy Markdown
Contributor Author

I don't think there is. It is a sanity check, but I think it can be removed. I didn't bother adding another one for cltvLimit.

Gotcha, would be nice to remove it in a follow-up PR then.

Yes, I can do that.

@joostjager
Copy link
Copy Markdown
Contributor Author

@wpaulino ptal

Copy link
Copy Markdown
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

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

LGTM 🌵

Comment thread routing/pathfind.go Outdated
Comment thread routing/router.go Outdated
@joostjager
Copy link
Copy Markdown
Contributor Author

@halseth comments replied to, ptal

@joostjager
Copy link
Copy Markdown
Contributor Author

Rebased

@joostjager joostjager force-pushed the cltv-limit branch 2 times, most recently from 4738b27 to d3ef006 Compare March 6, 2019 14:27
@joostjager
Copy link
Copy Markdown
Contributor Author

I don't think there is. It is a sanity check, but I think it can be removed. I didn't bother adding another one for cltvLimit.

Gotcha, would be nice to remove it in a follow-up PR then.

It is happening in #2497

@wpaulino
Copy link
Copy Markdown
Contributor

Needs a rebase.

Comment thread rpcserver.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This check wouldn't be needed if we used 0 to indicate no limit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is the same discussion as above. The conversion is done as early as possible to prevent having to deal with the magic value further down the call stack.

Comment thread cmd/lncli/commands.go Outdated
Comment thread routing/pathfind.go Outdated
This condition may be caused by a bug somewhere else in the system.
Expose it here as a warn log line.
@joostjager
Copy link
Copy Markdown
Contributor Author

ptal

Copy link
Copy Markdown
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

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

LGTM 🕺

@halseth halseth merged commit 4d8100c into lightningnetwork:master Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command line interface enhancement Improvements to existing features / behaviour routing rpc Related to the RPC interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants