-
Notifications
You must be signed in to change notification settings - Fork 107
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
add(rpc): getblock: return transaction details with verbosity=2 #9083
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oxarbitrage
previously approved these changes
Dec 12, 2024
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.
Looks good, it might conflict with #9049
It seems some test is still locked somewhere. I am unsure if it is caused by this code but it seems so. |
This looks good, I opened a suggestion PR (#9084) for reducing db queries and service calls. |
…erbosity=2" (#9084) * Replaces multiple service calls (per transaction) with a single call to the state service for all of a block's transactions. * adjustments to reuse code from getrawtransaction --------- Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
…get-block-tx-objs
conradoplg
force-pushed
the
get-block-tx-objs
branch
from
December 13, 2024 20:45
c365cfb
to
0428fda
Compare
conradoplg
force-pushed
the
get-block-tx-objs
branch
from
December 13, 2024 21:16
0428fda
to
15df6d1
Compare
oxarbitrage
approved these changes
Dec 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
We want getblock to match zcashd. With verbosity=2 we returned a list of hashes, but a list of transaction objects is expected.
Closes #9024
Specifications & References
https://github.com/zcash/zcash/blob/99ad6fdc3a549ab510422820eea5e5ce9f60a5fd/src/rpc/blockchain.cpp#L735
Solution
If
verbosity=2
, callgetrawtransaction
for each tx in the block internally and use its output to fill the transaction details.There are tons of fields missing in
getrawtransaction
, but that will be another issue. When they are filled, they will be automatically returned bygetblock
too.zcashd
seems to not return theheigth
andconfirmations
fields in the transactions details insidegetblock
(which are indeed redundant) but I think it's harmless to return them.Tests
Expanded existing test. Also tested manually with
zcash-cli
.Follow-up Work
See #8446 for other
getblock
related stuff, and we'll need an issue for completinggetrawtransaction
PR Author's Checklist
PR Reviewer's Checklist