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

Some DNS seeders and block explorers don't show Zebra nodes #1904

Closed
3 of 9 tasks
Tracked by #2867 ...
teor2345 opened this issue Mar 15, 2021 · 17 comments
Closed
3 of 9 tasks
Tracked by #2867 ...

Some DNS seeders and block explorers don't show Zebra nodes #1904

teor2345 opened this issue Mar 15, 2021 · 17 comments
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug I-integration-fail Continuous integration fails, including build and test failures I-slow Problems with performance or responsiveness I-usability Zebra is hard to understand or use S-needs-investigation Status: Needs further investigation

Comments

@teor2345
Copy link
Contributor

teor2345 commented Mar 15, 2021

Motivation

In #1844, we deployed a few zcashd instances on testnet, to make Zebra's testnet tests more reliable. But those nodes aren't showing up in the ECC's or the Foundation's DNS seeders.

As far as we can tell, the nodes are configured correctly, they are synced to tip, their listener ports are open, and they are advertising their external IPv4 addresses. But they don't show up in the DNS of either seeder implementation.

Also, Zebra nodes don't show up in some other DNS seeders or blockchain explorers.

Known Zebra Issues

Bugs to fix

Things to investigate

Other Protocol Mismatches:

List of Block Explorers

Some block explorers show up to 250 nodes.

There are about 150-200 nodes on mainnet that Zebra instances will connect to.
(Recent Zebra versions are limited to 75 outbound and 50 inbound connections, but this is configurable.)

Zebra might connect to fewer nodes because it has strict latency limits.

Zebra Nodes

This block explorer shows about 65 nodes, but it includes Zebra:

No Zebra Nodes

This block explorer shows about 250 nodes:

These block explorers show connected nodes only:

Currently down:

Completed

Make Zebra have long-term connections to peers:

DNS seeder bugs:

Metrics:

Optional

We could investigate why DNS seeders ignore zebrad nodes:

Infrastructure:

  • try running zcashd on a different network, to see if Google is blocking cryptocurrency traffic
  • try to run a Zebra node with the initial testnet addresses set to some of those zcashd nodes, to make sure they respond to requests correctly

Code Review:

  • check the zcashd version of our nodes, and the versions accepted by the DNS seeders
@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code A-infrastructure Area: Infrastructure changes A-devops Area: Pipelines, CI/CD and Dockerfiles S-needs-triage Status: A bug report needs triage S-needs-investigation Status: Needs further investigation P-Medium I-slow Problems with performance or responsiveness I-integration-fail Continuous integration fails, including build and test failures I-usability Zebra is hard to understand or use labels Mar 15, 2021
@teor2345 teor2345 changed the title Testnet DNS seeders don't show the foundation's new zcashd nodes Testnet DNS seeders don't show the Foundation's new zcashd nodes Mar 15, 2021
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Mar 23, 2021
@str4d
Copy link
Contributor

str4d commented Oct 7, 2021

This is the list of conditions enforced by zcash-seeder on peers in order for their IPs to be given out:

  • The peer's port must be 8233 on mainnet or 18233 on testnet (DNS only gives out IPs, so the port needs to be predictable).
  • The NODE_NETWORK service bit must be set.
  • The peer's IP must be routable.
  • The peer's client version must be at least REQUIRE_VERSION (currently 170015 in the repo, 170014 on my own seeder).
  • The peer's block height must be at least 0 (we could bump this to require peers to be closer to the tip, but don't currently do so).
  • The peer must be reliably reachable (this is implemented by tracking the success or failure of each connection attempt, with an exponential decay of each attempt's weight).

However, before we get to the above checks, the seeder needs to be able to connect to the peer and perform a very minimal handshake and protocol query:

  • version / verack
  • getaddr / addr

@teor2345
Copy link
Contributor Author

teor2345 commented Oct 8, 2021

I'm pretty sure our mainnet instances satisfy all these criteria.

But they're not configured with their external IP, and Zebra doesn't have external IP auto-detection. So they'll be advertising 0.0.0.0:(default). That might be the issue here. (We'd need to implement #1893, or make changes to our deployment configs.)

It's also possible that Google Cloud is filtering cryptocurrency traffic.

@teor2345
Copy link
Contributor Author

teor2345 commented Oct 8, 2021

We could test by configuring a publicly routable Zebra instance with the correct external IP address.
And ideally outside Google cloud, to eliminate that possibility.

@teor2345 teor2345 changed the title Testnet DNS seeders don't show the Foundation's new zcashd nodes DNS seeders don't show the Foundation's Zebra or zcashd nodes Oct 11, 2021
@teor2345 teor2345 changed the title DNS seeders don't show the Foundation's Zebra or zcashd nodes DNS seeders and block explorers don't show the Foundation's Zebra or zcashd nodes Oct 11, 2021
@teor2345 teor2345 changed the title DNS seeders and block explorers don't show the Foundation's Zebra or zcashd nodes DNS seeders and block explorers don't show the Foundation's Zebra nodes Oct 11, 2021
@teor2345 teor2345 added this to the 2021 Sprint 21 milestone Oct 11, 2021
@teor2345 teor2345 changed the title DNS seeders and block explorers don't show the Foundation's Zebra nodes DNS seeders and block explorers don't show Zebra nodes Oct 12, 2021
@mpguerra
Copy link
Contributor

Could this be related to #794 at all?

@conradoplg
Copy link
Collaborator

Could this be related to #794 at all?

I think it's not, the current value seems to follow the rules

pub const USER_AGENT: &str = "/Zebra:1.0.0-alpha.18/";

But we can double check.

@mpguerra
Copy link
Contributor

#2380 might help us diagnose this one

@teor2345
Copy link
Contributor Author

We could add user-agent metrics to Zebra.
It's a very small change, just copy and tweak the node version metrics.

This would show us if DNS seeders or block explorers are connecting to Zebra.

@mpguerra mpguerra self-assigned this Oct 18, 2021
@mpguerra mpguerra removed this from the 2021 Sprint 21 milestone Nov 1, 2021
@teor2345
Copy link
Contributor Author

teor2345 commented Nov 3, 2021

I spoke to someone who runs a Zebra mainnet node with high uptime.
It looks like their setup should work on DNS seeders and block explorers.

According to the rules posted above: #1904 (comment)

So it seems likely that Zebra is implementing some undocumented part of the network protocol differently.
And that's enough to get it rejected from seeders and block explorers.

We might have to do low-level network diagnostics, or look at the detailed logs from a DNS seeder.

@conradoplg
Copy link
Collaborator

Zecmate is showing Zebra nodes: https://explorer.zecmate.com/network

image

@mpguerra
Copy link
Contributor

mpguerra commented Nov 3, 2021

Updated Blockchair/Blockchair.Support#527 to reference zebra nodes seen in zecmate

@teor2345 teor2345 changed the title DNS seeders and block explorers don't show Zebra nodes Some DNS seeders and block explorers don't show Zebra nodes Nov 4, 2021
@mpguerra mpguerra added this to the 2021 Sprint 24 milestone Nov 17, 2021
@mpguerra mpguerra removed their assignment Nov 26, 2021
@teor2345
Copy link
Contributor Author

This is blocked by an investigation of how block explorers handle the Zcash network protocol.

@teor2345 teor2345 removed A-infrastructure Area: Infrastructure changes A-devops Area: Pipelines, CI/CD and Dockerfiles labels May 31, 2022
@teor2345
Copy link
Contributor Author

teor2345 commented Jun 7, 2022

In zcash/zcash#3881 (comment) , we found out that zcashd seems to ignore peers from zebrad.

We should try to find out why.

@softminus
Copy link

In zcash/zcash#3881 (comment) , we found out that zcashd seems to ignore peers from zebrad.

To clarify, this was not from zebrad, this was from https://github.com/superbaud/zcash-cotyledon/blob/main/src/main.rs; which only answers Peers requests.

@str4d said here that

zcashd does not anticipate the existence of network peers that only respond to getaddr messages, because that is not how the seeders interact with the network. If such a peer type were desired, it would need a corresponding service bit (to indicate to peers that it does not serve as a regular peer).

so I don't think this necessarily reflects a problem with zebrad.

@softminus
Copy link

I ran rm ~/.zcash/peers.dat; ./src/zcashd -dnsseed=0 -seednode=127.0.0.1 -port=12345 on a machine with a running zebrad (not fully synced to chaintip, if that matters) and the zcashd was able to get peers from zebrad.

@softminus
Copy link

@teor2345
Copy link
Contributor Author

teor2345 commented Jun 7, 2022

In zcash/zcash#3881 (comment) , we found out that zcashd seems to ignore peers from zebrad.

To clarify, this was not from zebrad, this was from https://github.com/superbaud/zcash-cotyledon/blob/main/src/main.rs; which only answers Peers requests.

It's still using a zebra-network stack, which is one possible cause of the DNS seeder issues.

Thanks for letting us know that zebrad's Peers requests work for zcashd.

@teor2345
Copy link
Contributor Author

This seems to be fixed for now, if we find issues with a specific block explorer or seeder, we can open another ticket with those details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug I-integration-fail Continuous integration fails, including build and test failures I-slow Problems with performance or responsiveness I-usability Zebra is hard to understand or use S-needs-investigation Status: Needs further investigation
Projects
None yet
Development

No branches or pull requests

6 participants