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

Fix empty address check in v0.5.11 #156

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Conversation

masih
Copy link
Member

@masih masih commented Feb 14, 2024

Check for empty addrs earlier when instantiating syncer.

Patch fix for v0.5.11.

See #155 for fix on main.

@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (release-v0.5.x@431cb64). Click here to learn what that means.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                Coverage Diff                @@
##             release-v0.5.x     #156   +/-   ##
=================================================
  Coverage                  ?   60.63%           
=================================================
  Files                     ?       57           
  Lines                     ?     5032           
  Branches                  ?        0           
=================================================
  Hits                      ?     3051           
  Misses                    ?     1652           
  Partials                  ?      329           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@gammazero gammazero left a comment

Choose a reason for hiding this comment

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

See comments

dagsync/subscriber.go Outdated Show resolved Hide resolved
Comment on lines 119 to 124
addrs := make([]multiaddr.Multiaddr, 0, len(peerInfo.Addrs))
for _, addr := range peerInfo.Addrs {
if addr != nil {
addrs = append(addrs, addr)
}
}
Copy link
Collaborator

@gammazero gammazero Feb 15, 2024

Choose a reason for hiding this comment

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

Might as well use cleanPeerAddrInfo for this.

Also, would it be better to remove nil addrs before the if len(peerInfo.Addrs) == 0 check above? Then the check below would not be necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

yup thanks Andrew, this PR is being tested and needs cleanup/propagation of changes to the fixes against main

Copy link
Member Author

Choose a reason for hiding this comment

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

If nil adds are put in peerstore, would they also be returned by it?

@masih masih force-pushed the masih/addr-check-5-11 branch 2 times, most recently from 664038f to 3d0a287 Compare February 15, 2024 15:31
Check for empty addrs earlier when instantiating syncer or subscriber.

Patch fix for v0.5.11.

See #155 for fix on `main`.
@masih masih merged commit fac3e38 into release-v0.5.x Feb 15, 2024
7 checks passed
@masih masih deleted the masih/addr-check-5-11 branch February 15, 2024 16:27
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.

3 participants