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

circuitv2: don't check ASN for private addrs #2611

Merged
merged 1 commit into from
Oct 19, 2023
Merged

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Oct 19, 2023

This is responsible for some of the flakiness of the autorelay testsuite. Loading the ASN table takes a lot of time. I think we can optimise the underlying library but this change is harmless since localhost / private addresses wouldn't be associated with an ASN.

Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to merge once you've added the comment.

@@ -74,7 +74,7 @@ func (c *constraints) AddReservation(p peer.ID, a ma.Multiaddr) error {

var asnReservations []time.Time
var asn string
if ip.To4() == nil {
if ip.To4() == nil && manet.IsPublicAddr(a) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment would be helpful, explaining why we skip this for private addresses.

@sukunrt sukunrt merged commit e9c542b into master Oct 19, 2023
9 checks passed
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