Skip to content

Conversation

@willianpaixao
Copy link

What type of PR is this?

Feature

What does this PR do? Why is it needed?

Upgrades go-libp2p from v0.39.1 to v0.45.0 and implements stream error codes for better error signaling to peers.

The upgrade provides stream error codes (v0.42.0+) which allow signaling why a stream was reset, improving observability and debugging. Additional benefits include QUIC security improvements and connection rate limiting capabilities.

Dependency Upgrades

  • go-libp2p: v0.39.1 -> v0.45.0
  • go-libp2p-mplex: v0.9.0 -> v0.11.0
  • Plus other transitive upgrades

Which issues(s) does this PR fix?

I have not created an issue.

Acknowledgements

Copilot AI review requested due to automatic review settings December 9, 2025 16:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request upgrades go-libp2p from v0.39.1 to v0.45.0 and implements stream error codes for improved error signaling to peers. The upgrade brings enhanced observability through stream error codes (available since v0.42.0), QUIC security improvements, and connection rate limiting capabilities. The PR also includes necessary fixes for test assertions and multiaddr comparisons that became necessary due to the dependency updates.

Key Changes

  • Upgraded go-libp2p from v0.39.1 to v0.45.0, along with related dependency updates (go-libp2p-mplex, various transitive dependencies)
  • Replaced stream.Reset() calls with stream.ResetWithError(code) throughout the codebase to signal specific error conditions to peers
  • Fixed NoError test assertion to properly handle struct error types using deepNil() helper
  • Updated multiaddr comparison in tests to use .Equal() method for compatibility with go-multiaddr v0.16.0

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go.mod, go.sum, deps.bzl Updated go-libp2p to v0.45.0 and related dependencies with version bumps across the dependency tree
beacon-chain/sync/rpc.go Changed deferred stream reset to use StreamShutdown error code
beacon-chain/sync/error.go Updated stream reset on CloseWrite failure to use StreamNoError code
beacon-chain/p2p/sender.go Added error codes: StreamProtocolViolation on encoding errors, StreamNoError on CloseWrite failures
beacon-chain/p2p/testing/p2p.go Applied same error code patterns in test helper for Send operations
cmd/prysmctl/p2p/handler.go Changed deferred stream reset to use StreamShutdown error code
cmd/prysmctl/p2p/client.go Added error codes: StreamProtocolViolation on encoding errors, StreamNoError on CloseWrite failures
testing/assertions/assertions.go Refactored NoError assertion to use existing deepNil() helper, fixing panic on nil-valued struct error types
beacon-chain/p2p/peers/status_test.go Updated multiaddr equality checks to use .Equal() method instead of direct comparison
changelog/willianpaixao_stream-error-codes.md Added changelog documenting the upgrade and fixes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willianpaixao
Copy link
Author

@nalepae @aarshkshah1992 maybe I could get a review over here too?

Upgrade go-libp2p from v0.39.1 to v0.45.0 to leverage stream error codes
for better error signaling to peers.

Changes:
- Replace stream.Reset() with stream.ResetWithError(code)
- Use StreamProtocolViolation for encoding errors
- Use StreamNoError for CloseWrite failures (cleanup)
- Use StreamShutdown for handler cleanup on exit

Dependency upgrades:
- go-libp2p: v0.39.1 -> v0.45.0
- go-libp2p-mplex: v0.9.0 -> v0.11.0

Signed-off-by: Willian Paixao <willian@ufpa.br>
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.

1 participant