Skip to content

Strip transparent data from GetBlockNullifiers response#546

Merged
LarryRuane merged 1 commit intomasterfrom
fix/getblock_nullifiers_exclude_transparent
Feb 20, 2026
Merged

Strip transparent data from GetBlockNullifiers response#546
LarryRuane merged 1 commit intomasterfrom
fix/getblock_nullifiers_exclude_transparent

Conversation

@nuttycom
Copy link
Contributor

GetBlockNullifiers was not clearing the vin and vout fields from transactions, causing transparent data to leak through a method that should only return shielded nullifier information.

Please ensure this checklist is followed for any pull requests for this repo. This checklist must be checked by both the PR creator and by anyone who reviews the PR.

  • Relevant documentation for this PR has to be completed before the PR can be merged
  • A test plan for the PR must be documented in the PR notes and included in the test plan for the next regular release

As a note, all CI tests need to be passing and all appropriate code reviews need to be done before this PR can be merged

@nuttycom nuttycom requested a review from LarryRuane February 11, 2026 17:23
@LarryRuane
Copy link
Collaborator

Looks good. I verified that GetBlockRangeNullifiers is already correct; it doesn't return the transparent parts (so the analogous change isn't needed there). My only suggestion is including the following (I'd say in the same commit) to test the changes (this fails without this PR):

diff
--- a/smoke-test.bash
+++ b/smoke-test.bash
@@ -186,6 +186,32 @@ expected='{
 }'
 compare "$expected" "$actual"
 
+# Same as previous except with only the nullifiers remaining
+echo GetblockNullifiers 663190 ...
+actual=$(gp GetBlockNullifiers '{"height":663190}')
+expected='{
+  "height": "663190",
+  "hash": "rnAgBry+ZWhKw+LSrWfMDFuLalVQVq7u/QyJAPFae1Y=",
+  "prevHash": "xOcqS6kNnE4yHGnLcvi1LMOqh9iY3ynEGpUTraSKpvQ=",
+  "time": 1,
+  "vtx": [
+    {
+      "txid": "jZno30toIVWj7Np39zJPgvdkZnTAGn4L8Mgcn8t79zo="
+    },
+    {
+      "index": "1",
+      "txid": "H0nPz83r1cuQhdn/LvvNqHEh3aE/LHkRE/zy55uoIQg=",
+      "spends": [
+        {
+          "nf": "xrZLCu+Kbv6PXo8cqM+f25Hp55L2cm95bM68JwUnDHg="
+        }
+      ]
+    }
+  ],
+  "chainMetadata": {}
+}'
+compare "$expected" "$actual"
+
 # force a reorg with the transactions now in 663195
 echo -n test: StageBlocksCreate blocks 663180 to 663179 ...
 gt StageBlocksCreate '{"height":663180,"count":100}'

GetBlockNullifiers was not clearing the vin and vout fields from
transactions, causing transparent data to leak through a method
that should only return shielded nullifier information.

Test added by Larry Ruane <larry@z.cash>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@LarryRuane LarryRuane force-pushed the fix/getblock_nullifiers_exclude_transparent branch from 6785464 to 28b9439 Compare February 20, 2026 23:05
Copy link
Collaborator

@LarryRuane LarryRuane left a comment

Choose a reason for hiding this comment

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

To save you the trouble, I went ahead and force-pushed to add the test; that's all I changed. Hope that's okay.

@LarryRuane LarryRuane merged commit 27fcb65 into master Feb 20, 2026
3 checks passed
@LarryRuane LarryRuane deleted the fix/getblock_nullifiers_exclude_transparent branch February 20, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants