-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Verify transactions in a block are well formed #4490
Conversation
At least a small PR description would be nice. |
Added a description |
3f4c8f2
to
bfa28a2
Compare
Verify that transactions in blocks appear exactly as their marshaled form after unmarshaling. Signed-off-by: Yacov Manevich <yacov.manevich@ibm.com>
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.
LGTM overall. The only thing that isn't clear yet is how we can convince ourselves that we're calling VerifyTransactionsAreWellFormed
in all the right places to achieve complete mediation. I see that we call it in 3 places - how can we be sure these are the only three places?
} | ||
if !bytes.Equal(expected, rawTx) { | ||
return fmt.Errorf("transaction %d (%s) does not match its raw form (%s)", i, | ||
base64.StdEncoding.EncodeToString(expected), base64.StdEncoding.EncodeToString(rawTx)) |
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.
why not hex encode?
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.
It's less characters this way
Not only that we can't, but there is a stack of PRs pending to be reviewed that will need to be re-evaluated that we call it in different places. The right approach would be to change the function that computes the hash of the block, to receive as parameter the entire block, not just the header. |
I'll take this commit and incorporate it into my stack of PRs, here: |
@denyeart we can backport it now |
Verify that transactions in blocks appear exactly as their marshaled form after unmarshaling. Backport of hyperledger#4490 Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Verify that transactions in blocks appear exactly as their marshaled form after unmarshaling. Backport of hyperledger#4490 Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Verify that transactions in blocks appear exactly as their marshaled form after unmarshaling. Backport of hyperledger#4490 Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Verify that transactions in blocks appear exactly as their marshaled form after unmarshaling. Backport of hyperledger#4490 Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Verify that transactions in blocks appear exactly as their marshaled form after unmarshaling. Backport of hyperledger#4490 Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Verify that transactions in blocks appear exactly as their marshaled form after unmarshaling.