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

multi: send a channel update with disabled flag set on channel close #1387

Merged
merged 6 commits into from
Jul 24, 2018

Conversation

wpaulino
Copy link
Contributor

Fixes #1132.

@wpaulino
Copy link
Contributor Author

There's a flake on Travis that needs to be addressed first. Will ping once done.

@meshcollider meshcollider added the channel closing Related to the closing of channels cooperatively and uncooperatively label Jun 15, 2018
@wpaulino
Copy link
Contributor Author

Should be good for review now.

Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

Nice! Will be good to get these changes in to help quell lingering routing failures while channels are closing. Did an initial pass to familiarize myself w/ the PR

server.go Outdated

pubKey := s.identityPriv.PubKey()
errChan := s.authGossiper.ProcessLocalAnnouncement(update, pubKey)
return <-errChan
Copy link
Contributor

Choose a reason for hiding this comment

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

select on quit as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

peer.go Outdated
// disableChannel disables a channel, resulting in it not being able to forward
// payments. This is done by sending a new channel update across the network
// with the disabled flag set.
func disableChannel(s *server) func(wire.OutPoint) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

this currying can be avoided by just having the server as the receiver

func (s *server) disableChannel(op *wire.OutPoint) error

then can pass the function around as s.disableChannel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

lnd_test.go Outdated
@@ -801,6 +801,9 @@ func checkChannelPolicy(policy, expectedPolicy *lnrpc.RoutingPolicy) error {
expectedPolicy.TimeLockDelta,
policy.TimeLockDelta)
}
if policy.Disabled != expectedPolicy.Disabled {
return errors.New("edge should be disable but isn't")
Copy link
Contributor

Choose a reason for hiding this comment

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

disabled -> disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@Roasbeef Roasbeef added P2 should be fixed if one has time needs testing PR hasn't yet been actively tested on testnet/mainnet needs rebase PR has merge conflicts needs review PR needs review by regular contributors and removed needs rebase PR has merge conflicts labels Jul 11, 2018
Copy link
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.

I'm wondering if we can send out disable messages even more aggressively. Could we disable the channel every time it is removed from the switch (as this is the point it cannot route payments anymore), and enable it when it is added?

Not sure if this would lead to unnecessary spam on them network, but it would also help by disabling channels for offline nodes. Or would this be leak any sensitive information? (I don't think so, as it is fairly easy to ping a node to see if it's offline anyway).

Thoughts? cc @Roasbeef @cfromknecht

@@ -78,6 +78,10 @@ type chanCloseCfg struct {
// broadcastTx broadcasts the passed transaction to the network.
broadcastTx func(*wire.MsgTx) error

// disableChannel disables a channel, resulting in it not being able to
// forward payments.
disableChannel func(wire.OutPoint) error
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just disable the channel in unregisterChannel?

@Roasbeef
Copy link
Member

Not really a fan of disabling the channel each time a peer connects/disconnects. It leaks more information, and also can get a bit spammy if the peer is flapping for w/e reason.

@Roasbeef Roasbeef added this to the 0.5 milestone Jul 17, 2018
@Roasbeef
Copy link
Member

Based on the recent convo in #1605, I'm warming up a bit more to sending it out each time something disconnects from the link itself, as it'll help to reduce routing failures over all. Also Johan brings up a good point that one can simply attempt to connect to nodes in order to get this type of reachability information.

@Roasbeef
Copy link
Member

The one worry is the level of spam really that this can generate if a peer is very flappy for w/e reason. On our send, I think we can just enforce stricter controls on how often we send this out, in addition to the trickle logic already present in the gossiper itself.

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🥁

@Roasbeef Roasbeef merged commit e0baa49 into lightningnetwork:master Jul 24, 2018
@wpaulino wpaulino deleted the send-disable-chan-update branch July 24, 2018 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channel closing Related to the closing of channels cooperatively and uncooperatively needs review PR needs review by regular contributors needs testing PR hasn't yet been actively tested on testnet/mainnet P2 should be fixed if one has time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants