@@ -178,6 +178,8 @@ func GetEntryBundle(ctx context.Context, f EntryBundleFetcherFunc, i, logSize ui
178178// ProofBuilder knows how to build inclusion and consistency proofs from tiles.
179179// Since the tiles commit only to immutable nodes, the job of building proofs is slightly
180180// more complex as proofs can touch "ephemeral" nodes, so these need to be synthesized.
181+ // This object constructs a cache internally to make it efficient for multiple operations
182+ // at a given tree size.
181183type ProofBuilder struct {
182184 treeSize uint64
183185 nodeCache nodeCache
@@ -196,8 +198,6 @@ func NewProofBuilder(ctx context.Context, treeSize uint64, f TileFetcherFunc) (*
196198
197199// InclusionProof constructs an inclusion proof for the leaf at index in a tree of
198200// the given size.
199- // This function uses the passed-in function to retrieve tiles containing any log tree
200- // nodes necessary to build the proof.
201201func (pb * ProofBuilder ) InclusionProof (ctx context.Context , index uint64 ) ([][]byte , error ) {
202202 ctx , span := tracer .Start (ctx , "tessera.client.InclusionProof" )
203203 defer span .End ()
@@ -212,8 +212,6 @@ func (pb *ProofBuilder) InclusionProof(ctx context.Context, index uint64) ([][]b
212212}
213213
214214// ConsistencyProof constructs a consistency proof between the provided tree sizes.
215- // This function uses the passed-in function to retrieve tiles containing any log tree
216- // nodes necessary to build the proof.
217215func (pb * ProofBuilder ) ConsistencyProof (ctx context.Context , smaller , larger uint64 ) ([][]byte , error ) {
218216 ctx , span := tracer .Start (ctx , "tessera.client.ConsistencyProof" )
219217 defer span .End ()
0 commit comments