[#1613] morph: Add tracing for morph queries to neo-go

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2025-02-05 16:37:11 +03:00
parent 4de5fca547
commit 9b113c3156
Signed by: achuprov
GPG key ID: 2D916FFD803B0EDD
120 changed files with 623 additions and 562 deletions

View file

@ -2,6 +2,7 @@ package tree
import (
"bytes"
"context"
"crypto/sha256"
"fmt"
"sync"
@ -32,13 +33,13 @@ type containerCacheItem struct {
const defaultContainerCacheSize = 10
// getContainerNodes returns nodes in the container and a position of local key in the list.
func (s *Service) getContainerNodes(cid cidSDK.ID) ([]netmapSDK.NodeInfo, int, error) {
nm, err := s.nmSource.GetNetMap(0)
func (s *Service) getContainerNodes(ctx context.Context, cid cidSDK.ID) ([]netmapSDK.NodeInfo, int, error) {
nm, err := s.nmSource.GetNetMap(ctx, 0)
if err != nil {
return nil, -1, fmt.Errorf("can't get netmap: %w", err)
}
cnr, err := s.cnrSource.Get(cid)
cnr, err := s.cnrSource.Get(ctx, cid)
if err != nil {
return nil, -1, fmt.Errorf("can't get container: %w", err)
}