-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
The current ProofBuilder is not thread-safe. There is a demand from personality applications to build the proof after the entries have merged into the tree. If there are 500 entries being merged in a batch, the application will then create 500 ProofBuilders fetching the same tiles from the storage and doing the hashing works again and again. This becomes the performance bottleneck which slows down the write QPS.
Lines 186 to 195 in 05ff747
| // NewProofBuilder creates a new ProofBuilder object for a given tree size. | |
| // The returned ProofBuilder can be re-used for proofs related to a given tree size, but | |
| // it is not thread-safe and should not be accessed concurrently. | |
| func NewProofBuilder(ctx context.Context, treeSize uint64, f TileFetcherFunc) (*ProofBuilder, error) { | |
| pb := &ProofBuilder{ | |
| treeSize: treeSize, | |
| nodeCache: newNodeCache(f, treeSize), | |
| } | |
| return pb, nil | |
| } |
A thread-safe ProofBuilder is needed to generate the proofs concurrently and effectively.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
No status