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

Remove unicode in Zebra's user agent #2376

Merged
merged 1 commit into from
Jun 23, 2021
Merged

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Jun 23, 2021

Motivation

Zebra doesn't appear in node explorers like https://blockchair.com/zcash/nodes
(It also doesn't appear in DNS seeders #1904, but recent fixes might have resolved that issue.)

This might be because we use multi-byte UTF-8 in Zebra's user-agent.

Currently, accurate network metrics are more important than encouraging UTF-8 support in the Zcash ecosystem.

Specifications

User-agents are loosely specified as US-ASCII, but you have to track back through a lot of references and spec grammar to find that restriction:
https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki#proposal
https://datatracker.ietf.org/doc/html/rfc1945#section-10.15
https://datatracker.ietf.org/doc/html/rfc1945#section-3.7
https://datatracker.ietf.org/doc/html/rfc1945#section-2.2

However, it is quite likely that some block explorers do not support multi-byte UTF-8.

Solution

  • Delete multi-byte UTF-8 characters from the Zebra user-agent

Review

Anyone can review this PR.

Reviewer Checklist

Follow Up Work

Automatically use zebrad version for the zebra-network user agent #2375

@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code P-Medium 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 Jun 23, 2021
@teor2345 teor2345 requested a review from a team June 23, 2021 05:31
@teor2345 teor2345 self-assigned this Jun 23, 2021
Copy link
Contributor

@mpguerra mpguerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mpguerra mpguerra merged commit d18d118 into main Jun 23, 2021
@mpguerra mpguerra deleted the remove-unicode-user-agent branch June 23, 2021 07:45
@dconnolly
Copy link
Contributor

😭🦓✨

@teor2345
Copy link
Contributor Author

teor2345 commented Jun 23, 2021

This hasn't impacted the node list yet:
https://blockchair.com/zcash/nodes

Maybe we need to run a zebrad node with a publicly reachable listener port. Or maybe there are other parts of the network protocol that we don't implement as expected.

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 A-rust Area: Updates to Rust code C-bug Category: This is a bug 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 this pull request may close these issues.

3 participants