Skip to content

improve error handling in webRTC-related noise function #377

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

Conversation

dharjeezy
Copy link
Contributor

@dharjeezy dharjeezy commented Apr 22, 2025

Closes #43 This PR:

  • eliminates the unsafe assumption and panics in the WebRTC litep2p config when fetching Multiaddr. Ensures litep2p behaves predictably even with malformed or malicious peers during the handshake phase by introducing InvalidMultihash in the AddressError.
  • removes assumption about the reply buffer size, by checking the length before splitting in get_remote_public_key function.

I am also looking at other functions to see if there should be any improvement, i will make this a draft PR untill i finish other improvements or if i find no other improvements needed.

@dharjeezy dharjeezy marked this pull request as ready for review July 9, 2025 12:18
@dharjeezy
Copy link
Contributor Author

I did not see anywhere else for any improvement. I think this is ready for review
@lexnv

@lexnv lexnv requested review from lexnv and dmitry-markin July 21, 2025 10:02
Copy link
Collaborator

@dmitry-markin dmitry-markin left a comment

Choose a reason for hiding this comment

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

Left some comments that need to be addresses, but overall looks good 👍

Copy link
Collaborator

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for handling this! 🙏

@dmitry-markin dmitry-markin merged commit 077d435 into paritytech:master Jul 22, 2025
8 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.

Improve error handling in WebRTC-related Noise functions
3 participants