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

Usage of ShareVersionZero for building padding shares instead blob.sharesversion #2142

Closed
andrijamitrovic23 opened this issue Jul 21, 2023 · 1 comment · Fixed by #2148
Closed
Assignees
Labels
audit item is from an audit

Comments

@andrijamitrovic23
Copy link

Builder for building padding shares is created using ShareVersionZero share version. This happens within function NamespacePaddingShare that is called from Export function when building padding shares (WriteNamespacePaddingShares->NamespacePaddingShares->NamespacePaddingShare->NewBuilder).

It can be seen that the non padding shares within Export function are created ((Write->NewBuilder(blobNamespace, blob.ShareVersion, true).Init())) with shares Builder that takes blob.ShareVersion.

At the time being, when there is only ShareVersionZero share version, this is not a problem, but when new share versions are introduced it could happen that the padding is created with different share version then the preceding shares which could lead to inconsistency. Passing blob.ShareVersion to NamespacePaddingShare and using it in the NewBuilder constructor should prevent this from happening.

@rootulp rootulp added audit item is from an audit and removed needs:triage labels Jul 21, 2023
@rootulp
Copy link
Collaborator

rootulp commented Jul 21, 2023

Great catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit item is from an audit
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants