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

doc: document NMT wrapper in prepare_proposal #1039

Merged
merged 3 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/prepare_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr
}

// erasure the data square which we use to create the data root.
// Note: uses the nmt wrapper to construct the tree.
// checkout pkg/wrapper/nmt_wrapper.go for more information.
rach-id marked this conversation as resolved.
Show resolved Hide resolved
eds, err := da.ExtendShares(squareSize, shares.ToBytes(dataSquare))
if err != nil {
app.Logger().Error(
Expand Down
1 change: 1 addition & 0 deletions pkg/da/data_availability_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func ExtendShares(squareSize uint64, shares [][]byte) (*rsmt2d.ExtendedDataSquar
)
}
// here we construct a tree
// Note: uses the nmt wrapper to construct the tree.
return rsmt2d.ComputeExtendedDataSquare(shares, appconsts.DefaultCodec(), wrapper.NewConstructor(squareSize))
}

Expand Down