-
Notifications
You must be signed in to change notification settings - Fork 895
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
Make gossipd more forgiving of temporary routing failures #886
Conversation
8dd50fc
to
e8cb0fe
Compare
Rebased to fix conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, I really like this idea, and the implementation is elegant!
Minor nitpick just because I couldn't find anything else to complain about :)
gossipd/routing.c
Outdated
@@ -341,6 +343,12 @@ static void bfg_one_edge(struct node *node, size_t edgenum, double riskfactor) | |||
} | |||
} | |||
|
|||
/* Determine if the given node_connection is routable */ | |||
static bool nc_is_routable(const struct node_connection *nc, u64 now) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use time_t here; it's u64 where it matters and is self-documenting nicely.
gossipd/routing.c
Outdated
/* Call time_now() once at the start, so that our tight loop | ||
* does not keep calling into operating system for the | ||
* current time */ | ||
u64 now = time_now().ts.tv_sec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too....
gossipd/routing.c
Outdated
@@ -1041,15 +1054,17 @@ get_out_node_connection_of(struct routing_state *rstate, | |||
*/ | |||
static void routing_failure_on_nc(struct routing_state *rstate, | |||
enum onion_type failcode, | |||
struct node_connection *nc) | |||
struct node_connection *nc, | |||
u64 now) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too...
gossipd/routing.h
Outdated
|
||
/* If greater than current time, this connection should not | ||
* be used for routing. */ | ||
u64 unroutable_until; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too...
e8cb0fe
to
d9e4203
Compare
Fixed as per review. |
ACK d9e4203 |
Fixes: #867
Policy: disable failing channels for 20 seconds, or the next
channel_update
.Implementation: Use a
u64 unroutable_until
, a UNIX-time variable, which prevents a channel from being used for routing if less than the current time in UNIX epoch. Set this to 20+current time if routing failure reported. Set to 0 on construction orchannel_update
.