-
Notifications
You must be signed in to change notification settings - Fork 195
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
Check blob key from disperser against actual key #1109
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: litt3 <102969658+litt3@users.noreply.github.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.
Changes LGTM, but the DisperseBlob function is getting big and unweildy. Might be good to refactor at some point, create some functions to abstract some of the stuff out. Would need to think through best way to do this.
Your code here could clearly fit in a function though, for eg.
Signed-off-by: litt3 <102969658+litt3@users.noreply.github.com>
@samlaf Good point. Split the blob key check into a separate function 617cbd5b |
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, thanks!
api/clients/v2/disperser_client.go
Outdated
// the blob header which was constructed locally and sent to the disperser | ||
blobHeader *corev2.BlobHeader, | ||
// the reply received back from the disperser | ||
disperserReply *disperser_rpc.DisperseBlobReply) error { |
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.
disperserReply *disperser_rpc.DisperseBlobReply) error { | |
disperserReply *disperser_rpc.DisperseBlobReply, | |
) error { |
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.
we should probably have a formatter to make the code standardized everywhere. I personally prefer this formatting, but I'm fine with whatever, just suggesting.
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.
I don't have a strong preference here. Strongly agree, though, that this is the sort of thing that ought to be managed by a standard formatter.
Signed-off-by: litt3 <102969658+litt3@users.noreply.github.com>
func verifyReceivedBlobKey( | ||
// the blob header which was constructed locally and sent to the disperser | ||
blobHeader *corev2.BlobHeader, | ||
// the reply received back from the disperser | ||
disperserReply *disperser_rpc.DisperseBlobReply, | ||
) error { |
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.
nit, would a simple unit test be possible? i.e. check both a valid and invalid header
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.
Done
Signed-off-by: litt3 <102969658+litt3@users.noreply.github.com>
Why are these changes needed?
DisperseBlob
matches what was sent #1100Checks