Skip to content

fix: z_validateaddress bug - #10022

Merged
mergify[bot] merged 1 commit into
ZcashFoundation:mainfrom
dorianvp:fix/z-validateaddress-bug
Oct 28, 2025
Merged

fix: z_validateaddress bug#10022
mergify[bot] merged 1 commit into
ZcashFoundation:mainfrom
dorianvp:fix/z-validateaddress-bug

Conversation

@dorianvp

@dorianvp dorianvp commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Motivation

When receiving a regtest t-address in z_validateaddress it fails because it is parsing it as a testnet address, even when running on regtest. This mismatch makes the endpoint return an "invalid" response, when it should be valid.

Solution

If Zebra receives a t-address and the network is not mainnet, we treat regtest as equal to testnet.

Tests

Added rpc_z_validateaddress_regtest for testing this scenario.

Specifications & References

We're implementing this endpoint on Zaino here, and we encountered this issue there too.

The presence of this bug was previously discussed here.

Follow-up Work

PR Checklist

  • The PR name is suitable for the release notes.
  • The PR follows the contribution guidelines.
  • The library crate changelogs are up to date.
  • The solution is tested.
  • The documentation is up to date.

@github-actions github-actions Bot added the C-bug Category: This is a bug label Oct 24, 2025

@arya2 arya2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

@mergify mergify Bot added the queued label Oct 28, 2025
mergify Bot added a commit that referenced this pull request Oct 28, 2025
@mergify
mergify Bot merged commit a4ea330 into ZcashFoundation:main Oct 28, 2025
84 checks passed
@mergify mergify Bot removed the queued label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category: This is a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants