From 13400ec85c38880ca5d8f64a1dc493757f44aed7 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Thu, 27 Mar 2025 21:15:24 -0500 Subject: [PATCH] ascend to degree three for parallelism --- node/crypto/lazy_proof_tree.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/node/crypto/lazy_proof_tree.go b/node/crypto/lazy_proof_tree.go index eda4165..c38f7cc 100644 --- a/node/crypto/lazy_proof_tree.go +++ b/node/crypto/lazy_proof_tree.go @@ -104,9 +104,12 @@ func (n *LazyVectorCommitmentBranchNode) Commit( vector := make([][]byte, len(n.Children)) wg := sync.WaitGroup{} workers := 1 - if n.LongestBranch <= 2 { + if n.LongestBranch <= 3 { workers = runtime.WorkerCount(0, false) } + if n.LongestBranch > 3 { + fmt.Printf("DEBUG: Performing commit under %v path, leaves: %d\n", path, n.LeafCount) + } throttle := make(chan struct{}, workers) for i, child := range n.Children { throttle <- struct{}{}