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

connect_isolated only works on mainnet #1687

Closed
2 tasks
teor2345 opened this issue Feb 4, 2021 · 0 comments · Fixed by #3302
Closed
2 tasks

connect_isolated only works on mainnet #1687

teor2345 opened this issue Feb 4, 2021 · 0 comments · Fixed by #3302
Assignees
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug

Comments

@teor2345
Copy link
Contributor

teor2345 commented Feb 4, 2021

Is your feature request related to a problem? Please describe.

zebra_network::isolated::connect_isolated uses the default zebra_network::Config, which is configured for mainnet.

But the Zcash network protocol uses different magic numbers for mainnet and testnet in its message headers, so connect_isolated will fail on testnet:

header_writer.write_all(&Magic::from(self.builder.network).0[..])?;

Describe the solution you'd like

  • Add a Network argument to connect_isolated, and substitute it for the default network in peer::Handshake::builder. The easiest way to do this might be to add a with_network method to peer::Handshake::builder.
  • Add tests for the connect_isolated handshake on mainnet and testnet.

There's no need to actually send a transaction as part of the tests - a successful handshake or an informational query should be enough.

Additional context

This change isn't required until we need to send isolated user-generated transactions from zebra-client.

@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code S-needs-triage Status: A bug report needs triage P-Medium labels Feb 4, 2021
teor2345 added a commit that referenced this issue Feb 4, 2021
Document that connect_isolated only works on mainnet.

See #1687.
dconnolly pushed a commit that referenced this issue Feb 4, 2021
Document that connect_isolated only works on mainnet.

See #1687.
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Feb 18, 2021
@jvff jvff self-assigned this Jan 12, 2022
@mergify mergify bot closed this as completed in #3302 Jan 14, 2022
@jvff jvff assigned teor2345 and unassigned jvff and teor2345 Jan 18, 2022
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants