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

Add dispersing transistion check #741

Merged
merged 7 commits into from
Sep 4, 2024

Conversation

bxue-l2
Copy link
Contributor

@bxue-l2 bxue-l2 commented Sep 1, 2024

This PR adds checks in shared_storage.go to ensure, the state of a blob never transit from confirmed to dispersing

@bxue-l2 bxue-l2 marked this pull request as ready for review September 1, 2024 19:10
s.logger.Error("error getting blob metadata while marking blobDispersing", "err", err)
return err
}
alreadyConfirmed, _ := refreshedMetadata.IsConfirmed()
Copy link
Contributor

Choose a reason for hiding this comment

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

What about just checking if the status is PROCESSING? That's the only valid predecessor for DISPERSING.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

return err
}
alreadyConfirmed, _ := refreshedMetadata.IsConfirmed()
if alreadyConfirmed {
Copy link
Contributor

Choose a reason for hiding this comment

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

This part seems not needed anymore

@@ -158,6 +162,23 @@ func (s *SharedBlobStore) MarkBlobConfirmed(ctx context.Context, existingMetadat
}

func (s *SharedBlobStore) MarkBlobDispersing(ctx context.Context, metadataKey disperser.BlobKey) error {
refreshedMetadata, err := s.GetBlobMetadata(ctx, metadataKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

@mooselumph
Copy link
Contributor

Looks good. Should we add a similar check for the PROCESSING state as well?

@bxue-l2 bxue-l2 merged commit 9e4a8a1 into Layr-Labs:master Sep 4, 2024
6 checks passed
jianoaix pushed a commit that referenced this pull request Sep 4, 2024
Co-authored-by: Bowen Xue <ubuntu@ip-172-31-91-211.ec2.internal>
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