From 4f9deb07b72e34f5eeeda87ef2a70f45f05c1c3f Mon Sep 17 00:00:00 2001 From: CHAMI Rachid Date: Wed, 1 Feb 2023 15:35:35 +0100 Subject: [PATCH] doc: document NMT wrapper in prepare_proposal (#1039) Adds a small note to specify that the NMT wrapper is used to extend the shares --- app/prepare_proposal.go | 2 ++ pkg/da/data_availability_header.go | 1 + 2 files changed, 3 insertions(+) diff --git a/app/prepare_proposal.go b/app/prepare_proposal.go index aaeb43d62f..b462ac54c2 100644 --- a/app/prepare_proposal.go +++ b/app/prepare_proposal.go @@ -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( diff --git a/pkg/da/data_availability_header.go b/pkg/da/data_availability_header.go index 3c96314ce8..d879976106 100644 --- a/pkg/da/data_availability_header.go +++ b/pkg/da/data_availability_header.go @@ -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)) }