diff --git a/node/crypto/lazy_proof_tree.go b/node/crypto/lazy_proof_tree.go index c38f7cc..13968a3 100644 --- a/node/crypto/lazy_proof_tree.go +++ b/node/crypto/lazy_proof_tree.go @@ -104,10 +104,10 @@ func (n *LazyVectorCommitmentBranchNode) Commit( vector := make([][]byte, len(n.Children)) wg := sync.WaitGroup{} workers := 1 - if n.LongestBranch <= 3 { + if n.LongestBranch <= 4 { workers = runtime.WorkerCount(0, false) } - if n.LongestBranch > 3 { + if n.LongestBranch > 4 { fmt.Printf("DEBUG: Performing commit under %v path, leaves: %d\n", path, n.LeafCount) } throttle := make(chan struct{}, workers) diff --git a/node/execution/intrinsics/token/token_execution_engine.go b/node/execution/intrinsics/token/token_execution_engine.go index 317dfaa..f7a6603 100644 --- a/node/execution/intrinsics/token/token_execution_engine.go +++ b/node/execution/intrinsics/token/token_execution_engine.go @@ -446,6 +446,12 @@ func NewTokenExecutionEngine( e.pubSub.Subscribe(hypersyncMetadataFilter, e.handleMetadataMessage) e.wg.Add(1) go e.runMetadataMessageHandler() + for _, h := range e.hypergraph.Commit() { + e.logger.Info( + "current hypergraph commit", + zap.String("root_commitment", hex.EncodeToString(h)), + ) + } protobufs.RegisterHypergraphComparisonServiceServer(syncServer, hyperSync) go func() { diff --git a/node/hypergraph/application/hypergraph.go b/node/hypergraph/application/hypergraph.go index 151ae31..ce54dcf 100644 --- a/node/hypergraph/application/hypergraph.go +++ b/node/hypergraph/application/hypergraph.go @@ -473,30 +473,18 @@ func (hg *Hypergraph) Commit() [][]byte { commits := [][]byte{} for _, vertexAdds := range hg.vertexAdds { root := vertexAdds.tree.Commit(false) - if bytes.Equal(root, []byte{}) { - root = vertexAdds.tree.Commit(true) - } commits = append(commits, root) } for _, vertexRemoves := range hg.vertexRemoves { root := vertexRemoves.tree.Commit(false) - if bytes.Equal(root, []byte{}) { - root = vertexRemoves.tree.Commit(true) - } commits = append(commits, root) } for _, hyperedgeAdds := range hg.hyperedgeAdds { root := hyperedgeAdds.tree.Commit(false) - if bytes.Equal(root, []byte{}) { - root = hyperedgeAdds.tree.Commit(true) - } commits = append(commits, root) } for _, hyperedgeRemoves := range hg.hyperedgeRemoves { root := hyperedgeRemoves.tree.Commit(false) - if bytes.Equal(root, []byte{}) { - root = hyperedgeRemoves.tree.Commit(true) - } commits = append(commits, root) } return commits