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

test: fuzz share commitments #1749

Merged
merged 8 commits into from
May 15, 2023
Merged

test: fuzz share commitments #1749

merged 8 commits into from
May 15, 2023

Conversation

cmwaters
Copy link
Contributor

Closes: #1744, closes: #1747

@MSevey MSevey requested review from a team and MSevey and removed request for a team May 12, 2023 13:03
@cmwaters cmwaters self-assigned this May 12, 2023
rootulp
rootulp previously approved these changes May 12, 2023
pkg/square/builder.go Outdated Show resolved Hide resolved
pkg/square/testdata/fuzz/FuzzSquare/dd4df2aa7925a6a2 Outdated Show resolved Hide resolved
evan-forbes
evan-forbes previously approved these changes May 12, 2023
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

dope!

@cmwaters cmwaters dismissed stale reviews from evan-forbes and rootulp via ba41200 May 15, 2023 07:36
@MSevey MSevey requested a review from a team May 15, 2023 07:36
@cmwaters cmwaters closed this May 15, 2023
@cmwaters cmwaters reopened this May 15, 2023
Comment on lines 346 to 348
func (b *Builder) NumTxs() int {
return len(b.txs)
return len(b.txs) + len(b.pfbs)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

[optional] this function may warrant a clarifying godoc

// NumTxs returns the total number of txs (PFBs + normalTxs)
func (b *Builder) NumTxs() int {
	return len(b.txs) + len(b.pfbs)
}

we may also consider renaming the field b.txs => b.normalTxs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% convinced about normal txs. I don't like that normality is defined on the basis of whether there is a PFB or not

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm open to other names to help disambiguate. Candidates: nonPFBTxs

@@ -52,7 +52,7 @@ func FuzzSquare(f *testing.F) {
builder, err := square.NewBuilder(appconsts.DefaultMaxSquareSize, orderedTxs...)
require.NoError(t, err)
totalPfbs := builder.NumPFBs()
totalNormalTxs := builder.NumTxs()
totalNormalTxs := builder.NumTxs() - totalPfbs
Copy link
Collaborator

Choose a reason for hiding this comment

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

[optional] an exported function on the builder for normal txs: builder.NumNormalTxs()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I'll wait for the need to arise first

@codecov-commenter
Copy link

Codecov Report

Merging #1749 (8e23fa4) into main (45c1c30) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1749      +/-   ##
==========================================
+ Coverage   51.93%   52.00%   +0.06%     
==========================================
  Files          94       94              
  Lines        6084     6088       +4     
==========================================
+ Hits         3160     3166       +6     
+ Misses       2596     2594       -2     
  Partials      328      328              
Impacted Files Coverage Δ
pkg/square/builder.go 79.06% <100.00%> (+1.03%) ⬆️

@MSevey MSevey requested a review from a team May 15, 2023 19:38
@cmwaters cmwaters enabled auto-merge (squash) May 15, 2023 19:40
@cmwaters cmwaters merged commit 4aabe52 into main May 15, 2023
@cmwaters cmwaters deleted the cal/fuzz-share-commitments branch May 15, 2023 19:48
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.

testing should support cases of multiple blobs in a blobTx Fuzz the share commitment correctness
4 participants