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

Document & test the semantics of GetRawTransaction, and fix platform-dependent parsing. #495

Merged
merged 4 commits into from
Aug 14, 2024

Conversation

nuttycom
Copy link
Contributor

@nuttycom nuttycom commented Aug 13, 2024

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

Fixes #493

@nuttycom nuttycom changed the title Add a test that demonstrates unmarshalling behavior for getrawtransaction results. Document & test the semantics of GetRawTransaction, and fix platform-dependent parsing. Aug 13, 2024
Copy link
Collaborator

@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.

Reviewed d17baf7.

// the meanings of the `Height` field of the `RawTransaction` type are as
// follows:
//
// * height 0: the transaction is in the mempool
Copy link
Collaborator

Choose a reason for hiding this comment

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

This aliases with the genesis block height, but is safe solely because the mainnet Zcash genesis block only contained a single transaction (the coinbase) which had no outputs (due to slow start), so no wallet will ever be interested in it even if they incorrectly observe it as "in the mempool".

walletrpc/service.proto Show resolved Hide resolved
Copy link
Collaborator

@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.

utACK b5f3f63 with note about how GetMempool* will not uniformly return 0. It would be nice to apply the moves from the last commit to the earlier commits in which the moved content was added.

common/mempool.go Show resolved Hide resolved
…RawTransaction`

This also modifies the internal `common.ZcashdRpcReplyGetrawtransaction`
type to ensure that the reinterpretation of the `-1` height value from
a `getrawtransaction` response is not platform-dependent.
@nuttycom nuttycom force-pushed the getrawtransaction_parse_testing branch from b5f3f63 to 56fe52a Compare August 13, 2024 18:11
Copy link
Collaborator

@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.

Re-utACK 56fe52a

CHANGELOG.md Show resolved Hide resolved
Copy link
Collaborator

@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.

utACK 90116a7

Copy link

@AArnott AArnott left a comment

Choose a reason for hiding this comment

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

The doc changes are clear and good. I don't know Go enough to offer a decent review of them.

Copy link
Contributor

@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.

utACK

@nuttycom nuttycom merged commit 13856f3 into zcash:master Aug 14, 2024
3 checks passed
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.

post-merge ACK

@nuttycom nuttycom deleted the getrawtransaction_parse_testing branch August 16, 2024 19:01
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.

GetTransaction does not correctly propagate the output of getrawtransaction calls.
5 participants