Skip to content

Conversation

@gitsofaryan
Copy link

cc : @seetadev

Description

This PR addresses an issue where ConnectionResetError was bubbling up from RawConnection.read() and RawConnection.write(), causing crashes in consumers that consistently expect RawConnError for connection issues.

Changes

  • libp2p/network/connection/raw_connection.py: Updated read and write methods to catch ConnectionResetError and wrap it in RawConnError.
  • tests/core/network/test_raw_connection.py: Added a new test suite to verify that RawConnection correctly handles connection resets on both read and write operations.
  • tests/core/relay/test_circuit_v2_transport.py: Added tests for TrackedRawConnection to ensure it properly delegates and handles these errors when wrapping a connection.

Verification

  • Validated with new unit tests in tests/core/network/test_raw_connection.py which simulate ConnectionResetError from the underlying stream.

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