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

Cache unsolicited Peers responses until needed #3110

Closed
teor2345 opened this issue Nov 28, 2021 · 1 comment · Fixed by #3294
Closed

Cache unsolicited Peers responses until needed #3110

teor2345 opened this issue Nov 28, 2021 · 1 comment · Fixed by #3294
Labels
A-network Area: Network protocol updates or fixes C-bug Category: This is a bug I-hang A Zebra component stops responding to requests I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data I-usability Zebra is hard to understand or use

Comments

@teor2345
Copy link
Contributor

teor2345 commented Nov 28, 2021

Motivation

Zebra currently drops unsolicited Peers responses. zcashd sends an Peers response soon after the connection opens, then it ignores Peers requests for a long while.

This network protocol mismatch sometimes makes Zebra hang on startup, or sync really slowly.

Specifications

This behavior is unspecified.

Suggested Solution

  • Cache the latest unsolicited Peers response in each connection
  • When Zebra sends a Peers request, consume and return the cached response. If there's no cached response, send a getaddr message to the peer, and wait for the response.

Related Work

#1892 has some other ideas for getting better addresses, but they're less important than this ticket

This change blocks #2325

This change is part of #704

@teor2345 teor2345 added C-bug Category: This is a bug S-needs-triage Status: A bug report needs triage P-Medium I-hang A Zebra component stops responding to requests I-usability Zebra is hard to understand or use I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data A-network Area: Network protocol updates or fixes labels Nov 28, 2021
@mpguerra
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-network Area: Network protocol updates or fixes C-bug Category: This is a bug I-hang A Zebra component stops responding to requests I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data I-usability Zebra is hard to understand or use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants