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

feat!: pack squares densely by implementing ADR013 #1604

Merged
merged 33 commits into from
Apr 20, 2023
Merged

Conversation

evan-forbes
Copy link
Member

@evan-forbes evan-forbes commented Apr 6, 2023

Overview

implements ADR013

closes #1572
part of #1538

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@evan-forbes evan-forbes added the consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules label Apr 6, 2023
@evan-forbes evan-forbes added this to the Mainnet milestone Apr 6, 2023
@evan-forbes evan-forbes self-assigned this Apr 6, 2023
@MSevey MSevey requested review from a team and staheri14 and removed request for a team April 6, 2023 23:04
@MSevey MSevey requested a review from a team April 6, 2023 23:07
Copy link
Member Author

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

note that there's only one real logic change required here, the rest is just fixing tests

app/write_square_test.go Show resolved Hide resolved
app/write_square_test.go Show resolved Hide resolved
pkg/inclusion/paths.go Show resolved Hide resolved
pkg/inclusion/paths_test.go Show resolved Hide resolved
pkg/shares/non_interactive_defaults.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2023

Codecov Report

Merging #1604 (4dd34c9) into main (952edae) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1604      +/-   ##
==========================================
+ Coverage   49.05%   49.13%   +0.08%     
==========================================
  Files          85       85              
  Lines        4964     4976      +12     
==========================================
+ Hits         2435     2445      +10     
- Misses       2290     2292       +2     
  Partials      239      239              
Impacted Files Coverage Δ
app/write_square.go 92.98% <100.00%> (ø)
pkg/inclusion/paths.go 100.00% <100.00%> (ø)
pkg/shares/non_interactive_defaults.go 100.00% <100.00%> (ø)
pkg/shares/share_splitting.go 61.73% <100.00%> (ø)
x/blob/types/payforblob.go 71.42% <100.00%> (-0.42%) ⬇️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@evan-forbes evan-forbes changed the title feat!: pack squares densly by implementing ADR013 feat!: pack squares densely by implementing ADR013 Apr 6, 2023
@rootulp
Copy link
Collaborator

rootulp commented Apr 7, 2023

I'm still reviewing but @evan-forbes what are you thoughts on updating the specs (i.e. here) at the same time as merging the implementation?

@evan-forbes
Copy link
Member Author

I'm still reviewing but @evan-forbes what are you thoughts on updating the specs (i.e. here) at the same time as merging the implementation?

that's a good point! I don't want to block the merging of this by codeowners of ADRs and docs, so will do in separate PRs, I added #1606 and #1607 as requirements to the EPIC though

Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

Overall mostly LGTM. One blocking comment. Defer to you if we want to update specs in this PR or after this PR.

pkg/appconsts/appconsts.go Outdated Show resolved Hide resolved
pkg/inclusion/paths.go Outdated Show resolved Hide resolved
pkg/inclusion/paths_test.go Show resolved Hide resolved
{instructions: []WalkInstruction{WalkRight, WalkRight, WalkRight, WalkRight, WalkRight, WalkLeft}, row: 63},
}},
{
"all paths for a basic 2x2", 2, 2, 2,
Copy link
Collaborator

Choose a reason for hiding this comment

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

[for reviewers] the first few test cases in this file have square layouts like:

		// | | |
		// |B|B|
		// | | |B|B|
		// | | | | |
		// | | | | |
		// | | | | |
		// | | | |B|
		// |B| | | |
		// | | | | |
		// | | | | |

pkg/inclusion/paths_test.go Show resolved Hide resolved
pkg/inclusion/paths_test.go Show resolved Hide resolved
pkg/inclusion/paths_test.go Show resolved Hide resolved
pkg/shares/non_interactive_defaults_test.go Outdated Show resolved Hide resolved
x/blob/types/payforblob.go Outdated Show resolved Hide resolved
x/blob/types/payforblob.go Show resolved Hide resolved
Co-authored-by: Rootul P <rootulp@gmail.com>
@MSevey MSevey requested a review from a team April 7, 2023 20:34
evan-forbes and others added 4 commits April 18, 2023 17:10
Co-authored-by: Sanaz Taheri <35961250+staheri14@users.noreply.github.com>
pkg/inclusion/paths.go Outdated Show resolved Hide resolved
Co-authored-by: Sanaz Taheri <35961250+staheri14@users.noreply.github.com>
cmwaters
cmwaters previously approved these changes Apr 19, 2023
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

This LGTM. Where do we update the ShareCommitment generation rules (do they need to be updated). Do we also need to modify the logic for proving blobs?

pkg/appconsts/appconsts.go Outdated Show resolved Hide resolved
Comment on lines +95 to +96
// SubTreeWidth determines the maximum number of leaves per subtree in the share
// commitment over a given blob. The input should be the total number of shares
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Like this description

Co-authored-by: Callum Waters <cmwaters19@gmail.com>
staheri14
staheri14 previously approved these changes Apr 19, 2023
Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

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

Thanks for being so responsive and attentive to the comments 👍 LGTM!

Comment on lines +76 to +77
// share commitment. If a blob contains more shares than this number, than the height
// of the subtree roots will gradually increases to so that the amount remains within that limit.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// share commitment. If a blob contains more shares than this number, than the height
// of the subtree roots will gradually increases to so that the amount remains within that limit.
// share commitment. If a blob contains more shares than this number, then the height
// of the subtree roots will increase so that the number of subtree roots remains below the threshold.

@evan-forbes evan-forbes merged commit 31ab512 into main Apr 20, 2023
27 checks passed
@evan-forbes evan-forbes deleted the evan/dense-square branch April 20, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement dense squares (ADR013)
6 participants