Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Basic
put_block
function for the memory wallet #1298Basic
put_block
function for the memory wallet #1298Changes from 2 commits
69c1e68
09e8bc9
9c0c6b0
4d3c441
7f74621
0393a69
a4323c2
a3b4de0
370a4aa
b1a0fcc
23a2ae8
2f28306
588156f
f77dfc1
147c033
cbb49b4
c9a236e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to take into consideration here is how this is handled in
zcash_client_sqlite
: in that context, the chain tip may not yet have been scanned, so we get the current chain height as the maximum height known to the scan queue, rather than the blocks table.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocks are added to the memory wallet database by
put_blocks
which currently receives a vector ofScannedBlock
. Do we plan to change that ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever is the case, ill open a separated PR for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No; the main distinction here is that the chain tip height is used in computing how to prioritize the scanning queue; we scan blocks out-of-order in many cases to improve time to spendability. The important related operation is
update_chain_tip
; basically,chain_height
should return whatever is correct as of the last call toupdate_chain_tip
, not the last call toput_blocks
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
update_chain_tip
where do you store the height that is passed by argument so you can use it inchain_height
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to ensure we have a correct "starting point" for adding to the note commitment trees in https://github.com/zcash/librustzcash/blob/main/zcash_client_sqlite/src/lib.rs#L928-L934 and https://github.com/zcash/librustzcash/blob/main/zcash_client_sqlite/src/lib.rs#L977-L983
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, i added that at a4323c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do this for my version of
put_blocks
as i was not able to make it otherwise, it might be not needed and not wanted.