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

use getblock verbose=3 instead of two getblock calls #449

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LarryRuane
Copy link
Collaborator

@LarryRuane LarryRuane commented Aug 9, 2023

If available, use getblock verbose=3. If not available, use the old way, which requires making two getblock RPCs. This is only a performance improvement.

After the EOL of the latest version that doesn't support verbose=3, this code can be simplified to only do the verbose=3 form (since it will be guaranteed to be implemented in zcashd).

This still needs a unit test, but seeking a concept and approach ACKs first.

See also #392 and corresponding PR zcash/zcash#6747. These PRs can be merged and deployed in either order.

If available, use `getblock verbose=3`. If not available, use the old way,
which requires making two `getblock` RPCs. This is only a performance
improvement.
@LarryRuane
Copy link
Collaborator Author

Force-pushed rebase, then another (23f1889) to implement a performance improvement for the case that zcashd hasn't been updated to support getblock verbose=3. The case of a non-upgraded zcashd was handled before this force-push, but lightwalletd would do three RPCs for each block that was fetched:

  1. try getblock v=3
  2. it failed, so getblock v=1 (as is done before this PR)
  3. getblock v=0 (as before this PR)

The whole idea of this PR is to improve performance; we don't want to make it worse in a (temporarily) common situation. With this force-push, lightwalletd will try getblock v=3, and if it fails, remember that, so from then on it only does steps 2 and 3. (Of course, if getblock v=3 works, then we're done, no more RPCs are needed for this block.)

This code can be removed when the last zcashd version that doesn't support v=3 hits end-of-life.

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.

1 participant