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

fix: augment PieceAggregateCommP to return the resulting aggregate size #18

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

ribasushi
Copy link
Contributor

Arguably this is an API-breaking change. But:

  1. We just shipped this yesterday
  2. The code is more than straightforward
  3. It allows one to do this downstream: filecoin-project/lotus@934782f#diff-94056d08269ce546601aa645389b4f81f2293af990d4c3a79094629b121723e6

doing so here *massively* simplifies downstream code in lotus
@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 41.66667% with 7 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@11777d3). Learn more about missing BASE report.

Files Patch % Lines
commd.go 30.00% 7 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #18   +/-   ##
=========================================
  Coverage          ?   78.12%           
=========================================
  Files             ?        4           
  Lines             ?      192           
  Branches          ?        0           
=========================================
  Hits              ?      150           
  Misses            ?       27           
  Partials          ?       15           
Files Coverage Δ
writer/writer.go 90.32% <100.00%> (ø)
commd.go 67.10% <30.00%> (ø)

commd_test.go Outdated
@@ -26,7 +26,7 @@ func TestGenerateUnsealedCID(t *testing.T) {

expCommD := cidMustParse("baga6ea4seaqiw3gbmstmexb7sqwkc5r23o3i7zcyx5kr76pfobpykes3af62kca")

commD, _ := commp.PieceAggregateCommP(
commD, _, _ := commp.PieceAggregateCommP(
Copy link
Member

Choose a reason for hiding this comment

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

I think you could work out the expected value here and add an assertion for it so we at least have some coverage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rvagg the codecov is incorrect: the thing is quite covered via https://github.com/filecoin-project/go-commp-utils/pull/18/files#diff-26d4fcf1ea0693620c557d21296e08c0517e901e2b01c8d4d93ac5ac5ffd4582R153

pushed https://github.com/filecoin-project/go-commp-utils/actions/runs/10259961154/job/28385226864 as proof

pushed an addition as requested as well: the test is based on an actual mainnert sector, so the size is expected at 32GiB

@rvagg
Copy link
Member

rvagg commented Aug 6, 2024

yeah, I'm fine with this, probably should bump 2.1.0 for this at least though; I would like a test to at least touch this though

@ribasushi ribasushi requested a review from rvagg August 6, 2024 03:56
@rvagg rvagg merged commit 6119fcb into master Aug 6, 2024
7 checks passed
@rvagg rvagg deleted the fix/better_PieceAggregateCommP branch August 6, 2024 06:55
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