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

Zebra should store a persistent list of recent successful peers #1956

Closed
Tracked by #3247 ...
teor2345 opened this issue Mar 28, 2021 · 2 comments · Fixed by #6739
Closed
Tracked by #3247 ...

Zebra should store a persistent list of recent successful peers #1956

teor2345 opened this issue Mar 28, 2021 · 2 comments · Fixed by #6739
Assignees
Labels
A-network Area: Network protocol updates or fixes C-audit Category: Issues arising from audit findings C-security Category: Security issues I-hang A Zebra component stops responding to requests I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data I-privacy Zebra discloses private information

Comments

@teor2345
Copy link
Contributor

teor2345 commented Mar 28, 2021

Motivation

Zebra currently fetches a new list of peers from DNS each time it launches.

This design has some benefits:

  • Zebra behaviour is consistent and has minimal state

And some drawbacks:

Solution

Zebra should keep a cached list of peer addresses on disk, and update it regularly. This list can be separate from the state cache.

To avoid privacy leaks:

  • the list should only store peer addresses, and no other data
  • it should be sorted to destroy any order in the peer list

Alternative 1: Only use DNS if cached peers don't work

zcashd tries both the cached list of peer addresses and new addresses from DNS. This design has the following tradeoffs:

  • Zebra doesn't rely on DNS
  • Every time Zebra starts, it can have bad peers added by its current DNS
  • Launching is as fast as possible, regardless of the quality of the cached list or DNS
  • Zebra leaks some information by making a DNS query every time it starts up
  • Zebra can easily recover from a compromised or poorly performing peer list, but some bad peers will stay in the list

Alternative 2: Only use DNS if cached peers don't work

zcashd first tries the cached list of peer addresses, then makes a DNS query if none connect. This design has the following tradeoffs:

  • Zebra doesn't rely on DNS unless it really needs to
  • Launching might be slower if it takes a while to work out that all peers have failed
  • Zebra leaks some information about the quality of its cached peer address list
  • Zebra doesn't have a peer reputation system, so it's hard to work out if all peers are "bad"
  • It's harder for Zebra to recover from a compromised or poorly performing peer list, because it might never use DNS again
@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage P-Medium C-security Category: Security issues I-hang A Zebra component stops responding to requests I-slow Problems with performance or responsiveness I-usability Zebra is hard to understand or use I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data I-privacy Zebra discloses private information labels Mar 28, 2021
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Apr 7, 2021
@mpguerra mpguerra added the A-network Area: Network protocol updates or fixes label Dec 16, 2021
@teor2345 teor2345 removed C-bug Category: This is a bug C-enhancement Category: This is an improvement labels Dec 16, 2021
@teor2345
Copy link
Contributor Author

teor2345 commented Jun 2, 2022

We can re-open this if it becomes a problem.

@teor2345 teor2345 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2022
@teor2345 teor2345 mentioned this issue May 15, 2023
3 tasks
@teor2345 teor2345 reopened this May 15, 2023
@teor2345 teor2345 added C-audit Category: Issues arising from audit findings and removed I-usability Zebra is hard to understand or use labels May 15, 2023
@teor2345
Copy link
Contributor Author

@mpguerra this is the old ticket for the audit/stable release, I updated it with new designs.

@teor2345 teor2345 removed the A-rust Area: Updates to Rust code label May 15, 2023
@teor2345 teor2345 self-assigned this May 19, 2023
@teor2345 teor2345 removed the I-slow Problems with performance or responsiveness label May 21, 2023
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-audit Category: Issues arising from audit findings C-security Category: Security issues I-hang A Zebra component stops responding to requests I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data I-privacy Zebra discloses private information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants