Skip to content

Add transparent data to the CompactBlock format.#1

Merged
nuttycom merged 3 commits intomainfrom
compact_tx_transparent
Oct 31, 2025
Merged

Add transparent data to the CompactBlock format.#1
nuttycom merged 3 commits intomainfrom
compact_tx_transparent

Conversation

@nuttycom
Copy link
Contributor

This also modifies the BlockRange type to allow callers to specify a set of pool types for which data should be returned. In the case that no pool types are specified, a server should return compact blocks containing only data relevant to the shielded (Sapling and Orchard) pools.

@nuttycom
Copy link
Contributor Author

nuttycom commented Aug 14, 2025

This replaces the .proto changes previously suggested in zcash/librustzcash#1781

@pacu
Copy link
Collaborator

pacu commented Aug 15, 2025

Thanks for doing this!

@nuttycom nuttycom requested a review from pacu October 15, 2025 05:19
Copy link
Collaborator

@pacu pacu left a comment

Choose a reason for hiding this comment

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

The way I see it this proto file looks good to me.

I assume that once merged the different repos will be updating their copies

Example for Zaino

git subtree add --prefix=zaino-proto/lightwallet-protocol --squash git@github.com:zcash/lightwallet-protocol.git main

LarryRuane
LarryRuane previously approved these changes Oct 23, 2025
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.

tACK bf5975a (tested with a lightwalletd branch with the corresponding changes but which doesn't have a PR yet), although I don't see this change yet.

Yeah, POOL_TYPE_INVALID seems good.

Also, I think the three commits could be squashed into one.

@LarryRuane
Copy link
Collaborator

I just thought of another question for both of you ... I'm implementing the GetBlockRange PoolType filtering. Suppose that after filtering, the block contains no transactions. Should we still return the block (in effect, just its header)?

Currently, we do return these "empty" blocks, so I guess for compatibility, we should continue doing that. Alternatively, we could define that if no PoolType list is given (which comes to lightwalletd as a zero-length list, i.e., existing clients), we return all blocks in the range, even if they have zero transactions (current behavior). But if the caller specifies one or more PoolType values, then we could suppress the empty blocks.

@nuttycom
Copy link
Contributor Author

I just thought of another question for both of you ... I'm implementing the GetBlockRange PoolType filtering. Suppose that after filtering, the block contains no transactions. Should we still return the block (in effect, just its header)?

Currently, we do return these "empty" blocks, so I guess for compatibility, we should continue doing that. Alternatively, we could define that if no PoolType list is given (which comes to lightwalletd as a zero-length list, i.e., existing clients), we return all blocks in the range, even if they have zero transactions (current behavior). But if the caller specifies one or more PoolType values, then we could suppress the empty blocks.

We should continue to return the empty blocks; particular with out-of-order scanning, we need to verify that a block did not contain any outputs for our wallet, and also gaps in block order would break our ability to check the hash chaining between blocks.

@LarryRuane
Copy link
Collaborator

Got it, thanks.

We should continue to return the empty blocks; particular with out-of-order scanning, we need to verify that a block did not contain any outputs for our wallet ...

Not that it matters, I'm just curious, what is out-of-order scanning? (I do understand the need to check block chaining.)

re-ACK f9b777c (although I'd be fine with squashing the commits, that's personal preference)

@nuttycom nuttycom requested a review from pacu October 23, 2025 23:57
LarryRuane
LarryRuane previously approved these changes Oct 24, 2025
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.

ACK f9b777c

@LarryRuane
Copy link
Collaborator

@pacu if you're comfortable, please review zcash/lightwalletd#534; I can't seem to add you as a reviewer on that PR.

pacu
pacu previously approved these changes Oct 24, 2025
@nuttycom nuttycom force-pushed the compact_tx_transparent branch 2 times, most recently from 7c1947d to af261f8 Compare October 24, 2025 23:00
@nuttycom
Copy link
Contributor Author

force-pushed to address comments from code review and rebase atop #4

@nuttycom nuttycom requested review from LarryRuane, pacu and str4d October 24, 2025 23:02
pacu
pacu previously approved these changes Oct 26, 2025
Copy link
Collaborator

@pacu pacu left a comment

Choose a reason for hiding this comment

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

LGTM modulo two documentation issues.

nuttycom and others added 3 commits October 27, 2025 12:53
This also modifies the `BlockRange` type to allow callers to specify a
set of pool types for which data should be returned. In the case that no
pool types are specified, a server should return compact blocks
containing only data relevant to the shielded (Sapling and Orchard)
pools.

Co-authored-by: Larry Ruane <larryruane@gmail.com>
Co-authored-by: Pacu <francisco.gindre@gmail.com>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
@nuttycom nuttycom force-pushed the compact_tx_transparent branch from a4a1a06 to a95359d Compare October 27, 2025 18:54
@nuttycom
Copy link
Contributor Author

force-pushed t address comments from review.

LarryRuane
LarryRuane previously approved these changes Oct 31, 2025
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.

tACK a95359d
Is this ready to merge? I think this PR may need to be rebased onto #4 because of the CHANGELOG changes?

@nuttycom nuttycom dismissed LarryRuane’s stale review October 31, 2025 17:43

The merge-base changed after approval.

@nuttycom
Copy link
Contributor Author

tACK a95359d Is this ready to merge? I think this PR may need to be rebased onto #4 because of the CHANGELOG changes?

It's already based on #4

str4d
str4d previously approved these changes Oct 31, 2025
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

ACK a95359d

@nuttycom nuttycom dismissed str4d’s stale review October 31, 2025 20:32

The merge-base changed after approval.

str4d
str4d previously approved these changes Oct 31, 2025
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

ACK a95359d

@nuttycom nuttycom dismissed str4d’s stale review October 31, 2025 20:38

The merge-base changed after approval.

@nuttycom nuttycom merged commit d978256 into main Oct 31, 2025
@nuttycom nuttycom deleted the compact_tx_transparent branch October 31, 2025 20:39
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.

5 participants