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

Ignore multiaddrs with unknown protocols #30

Merged
merged 1 commit into from
May 9, 2023
Merged

Conversation

gammazero
Copy link
Collaborator

If new protocols, unknown to the indexer or assigner service, are encoded into multiaddrs in announce messages, then ignore these. This will allow older indexers to accept messages even when newer address types are included.

Fixes issue #29

If new protocols, unknown to the indexer or assigner service, are encoded into multiaddrs in announce messages, then ignore these. This will allow older indexers to accept messages even when newer address types are included.

Fixes issue #29
if err != nil {
if strings.Contains(err.Error(), "no protocol with code") {
Copy link
Member

Choose a reason for hiding this comment

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

is this really our best way of identifying this error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wish there was a type, but that will require a change here: https://github.com/multiformats/go-multiaddr/blob/master/protocol.go#L97

Copy link
Member

Choose a reason for hiding this comment

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

that's "not protocol with name" rather than "no protocol with code"

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.36 🎉

Comparison is base (6f203ce) 50.25% compared to head (6014b02) 50.62%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   50.25%   50.62%   +0.36%     
==========================================
  Files          60       60              
  Lines        4913     4915       +2     
==========================================
+ Hits         2469     2488      +19     
+ Misses       2181     2166      -15     
+ Partials      263      261       -2     
Impacted Files Coverage Δ
announce/message/message.go 93.75% <100.00%> (+15.17%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gammazero gammazero merged commit 81286e4 into main May 9, 2023
16 checks passed
@gammazero gammazero deleted the ignore-unknown-addrs branch May 9, 2023 21:54
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.

None yet

4 participants