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

Check blob key from disperser against actual key #1109

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

litt3
Copy link
Contributor

@litt3 litt3 commented Jan 14, 2025

Why are these changes needed?

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

Signed-off-by: litt3 <102969658+litt3@users.noreply.github.com>
@litt3 litt3 self-assigned this Jan 14, 2025
@litt3 litt3 marked this pull request as ready for review January 14, 2025 21:35
Copy link
Contributor

@samlaf samlaf left a 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.

@litt3
Copy link
Contributor Author

litt3 commented Jan 15, 2025

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.

@samlaf Good point. Split the blob key check into a separate function 617cbd5b

@litt3 litt3 requested a review from samlaf January 15, 2025 15:17
Copy link
Contributor

@samlaf samlaf left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

// 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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
disperserReply *disperser_rpc.DisperseBlobReply) error {
disperserReply *disperser_rpc.DisperseBlobReply,
) error {

Copy link
Contributor

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.

Copy link
Contributor Author

@litt3 litt3 Jan 16, 2025

Choose a reason for hiding this comment

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

78c58a1d

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.

litt3 added 2 commits January 16, 2025 09:03
Signed-off-by: litt3 <102969658+litt3@users.noreply.github.com>
Comment on lines +230 to +235
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 {
Copy link
Contributor

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

Copy link
Contributor Author

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

Verify that the blob key returned in DisperseBlob matches what was sent
3 participants