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

tvx extract: make it work with secp messages. #4583

Merged
merged 2 commits into from
Nov 20, 2020
Merged

Conversation

raulk
Copy link
Member

@raulk raulk commented Oct 24, 2020

Unfortunately ChainGetMessage returns a *types.Message, which in the case of secp messages is lacking the signature. The signature is part of the input to calculate the CID on secp messages. Therefore, calling .Cid() on the result of ChainGetMessage for this kind of message will result in an incorrect CID.

tvx was relying on that call to return the correct CID. Since this is not the case (and this is a footgun that needs to be corrected, ideally together with the *types.{,Signed}Message duality mess), I'm replacing the comparison.


cc @austinabell

Unfortunately ChainGetMessage returns a *types.Message, which in
the case of secp messages is lacking the signature. The signature
is part of the input to calculate the CID on secp messages. Therefore,
calling `.Cid()` on the result of ChainGetMessage for this kind of
message will lead to an incorrect CID.

tvx was relying on that call to return the correct CID. Since this is
not the case (and this is a footgun that needs to be corrected, ideally
together with the *types.{,Signed}Message duality mess), I'm replacing
the comparison.
@raulk raulk requested a review from Kubuxu October 24, 2020 19:17
Copy link
Contributor

@austinabell austinabell left a comment

Choose a reason for hiding this comment

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

Worked for me! :D

cmd/tvx/extract.go Outdated Show resolved Hide resolved
@magik6k magik6k merged commit 853f9da into master Nov 20, 2020
@magik6k magik6k deleted the fix/tvx-msg-cid branch November 20, 2020 14:13
bibibong pushed a commit to EpiK-Protocol/go-epik that referenced this pull request Jan 7, 2021
…x-msg-cid

tvx extract: make it work with secp messages.
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.

3 participants