Skip to content

Commit

Permalink
doc: document NMT wrapper in prepare_proposal (#1039)
Browse files Browse the repository at this point in the history
Adds a small note to specify that the NMT wrapper is used to extend the
shares
  • Loading branch information
rach-id committed Feb 1, 2023
1 parent bd68c46 commit 4f9deb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/prepare_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,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.
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

0 comments on commit 4f9deb0

Please sign in to comment.