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

rust-client: handle address parsing error gracefully #64

Merged
merged 2 commits into from
Dec 12, 2022

Conversation

elenaf9
Copy link
Collaborator

@elenaf9 elenaf9 commented Dec 8, 2022

The multiaddress of a remote peer may contain a Protocol that is not yet implemented in rust-multiaddr.
This causes the parsing from Vec to Multiaddr to fail. Right now this results in an error that aborts the whole program.
This PR changes the implementation to simply skip an address that we can not parse.

Reported in #62 (comment).

The multiaddress sent to us from the remote may contain a Protocol that
is not yet implemented in rust-multiaddr. This causes the parsing from
`Vec` to `Multiaddr` to fail.
Rather than treating this as an error, this commit changes the
implementation to simply skip the address in this case.
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Good to merge from my end, though one suggestion.

What do you think of adding a debug! in case of failure. Might make future debugging easier, in case there ever is an address that we should be able to parse, but can't.

In general, I would like the Rust multiaddr implementation to strive for supporting all common libp2p protocols. Thus this fix should only be required int he short term.

@elenaf9
Copy link
Collaborator Author

elenaf9 commented Dec 12, 2022

What do you think of adding a debug! in case of failure. Might make future debugging easier, in case there ever is an address that we should be able to parse, but can't.

Good idea. Done in 5ad4f38.

@mxinden mxinden merged commit e3ff5a3 into main Dec 12, 2022
@thomaseizinger
Copy link
Contributor

Can we push out a point release for this?

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