-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
autorelay support for circuitv2 relays #1198
Conversation
static checker complains; sigh.
@marten-seemann ready for another round of review. |
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.
Thanks for the quick turnaround. Here's some additional stuff I noticed.
if now.Add(rsvpExpirationSlack).Before(rsvp.Expiration) { | ||
continue | ||
} | ||
|
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 must have missed this in my earlier review, but do we need a check to garbage collect expired reservations?
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 don't think so, we'll try to refresh them. Do you see any way to create garbage here?
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.
You're right, we delete the reservation if refreshing fails.
} | ||
|
||
select { | ||
case <-ready: |
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.
This will leave all but the first go routine blocked on their IdentifyWait
, doesn't it? Maybe this would a good use case for https://pkg.go.dev/golang.org/x/sync/errgroup#WithContext?
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.
No, the channel is buffered for len(conns)
, so we should be fine.
1fd4461
to
ba1444f
Compare
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.
LGTM.
Changes:
p2p/host/autorelay
Next steps: refactor the relay discovery logic to support the Flare strategy of an army of relays; this can happen in a subsequent pr, and we can even wait for deployment before we do it.
For now, user must configure relays statically.