ChainSafe / ChainSafe/gossamer

Support detection of `EOF` and `ErrClosedPipe` in current network stream

Open
#4,802 0 comments 0 reactions 0 assignees View on GitHub
T-implementation
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Issue summary

from design doc:
> fter investigation into the stream handlers, it looks like we do not currently support detection of `EOF` or `ErrClosedPipe` when reading from the stream, which we need to capture and propagate back to the networking stack to remove the peer from the peerset, and the [`peerViewSet`](https://github.com/ChainSafe/gossamer/blob/55446ab7d85c1c1094a645712a8d3c8d0ea9a514/dot/sync/peer_view.go#L19).

## Implementation details

- Capture `EOF` or `ErrrClosedPipe` on any libp2p stream handler and propagate back to `peerViewSet`.
- On capture of these stream specific errors, the peer should be removed from the peerset.

## Other information and links

-

## Acceptance criteria

[] Peer should be removed from peerset when connection is determined to be terminated.
[] Unit test coverage of said sceneario.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.