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

Fix Sink API usage in P2PStream #156

Closed
Rjected opened this issue Nov 3, 2022 · 1 comment · Fixed by #184
Closed

Fix Sink API usage in P2PStream #156

Rjected opened this issue Nov 3, 2022 · 1 comment · Fixed by #184
Assignees
Labels
A-devp2p Related to the Ethereum P2P protocol C-bug An unexpected or incorrect behavior

Comments

@Rjected
Copy link
Member

Rjected commented Nov 3, 2022

Ref #114, currently the stream uses send from SinkExt in multiple places, which completes when the Sink has fully processed the item. Instead, it should be using the Sink API like this, buffering requests when the Sink is not ready:

if poll_ready().is_ready() {
   start_send(msg)
} else {
  // need to buffer until sink ready.
}
@Rjected Rjected added C-bug An unexpected or incorrect behavior A-devp2p Related to the Ethereum P2P protocol labels Nov 3, 2022
@Rjected Rjected self-assigned this Nov 3, 2022
@mattsse
Copy link
Collaborator

mattsse commented Nov 3, 2022

we could set some sensible default capacity for the sink buffer.

yutianwu pushed a commit to yutianwu/reth that referenced this issue Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devp2p Related to the Ethereum P2P protocol C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants