Skip to content

Commit 83d865f

Browse files
authored
chore: log gsoc source (#5021)
1 parent f4dee9c commit 83d865f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

pkg/pullsync/pullsync.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ func (s *Syncer) Sync(ctx context.Context, peer swarm.Address, bin uint8, start
360360
if cac.Valid(chunk) {
361361
go s.unwrap(chunk)
362362
} else if chunk, err := soc.FromChunk(chunk); err == nil {
363+
addr, err := chunk.Address()
364+
if err != nil {
365+
chunkErr = errors.Join(chunkErr, err)
366+
continue
367+
}
368+
s.logger.Debug("sync gsoc", "peer_address", peer, "chunk_address", addr, "wrapped_chunk_address", chunk.WrappedChunk().Address())
363369
s.gsocHandler(chunk)
364370
} else {
365371
s.logger.Debug("invalid cac/soc chunk", "error", swarm.ErrInvalidChunk, "peer_address", peer, "chunk", chunk)

pkg/pushsync/pushsync.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import (
2424
"github.com/ethersphere/bee/v2/pkg/pushsync/pb"
2525
"github.com/ethersphere/bee/v2/pkg/skippeers"
2626
"github.com/ethersphere/bee/v2/pkg/soc"
27-
storage "github.com/ethersphere/bee/v2/pkg/storage"
27+
"github.com/ethersphere/bee/v2/pkg/storage"
2828
"github.com/ethersphere/bee/v2/pkg/swarm"
2929
"github.com/ethersphere/bee/v2/pkg/topology"
3030
"github.com/ethersphere/bee/v2/pkg/tracing"
31-
opentracing "github.com/opentracing/opentracing-go"
31+
"github.com/opentracing/opentracing-go"
3232
"github.com/opentracing/opentracing-go/ext"
3333
olog "github.com/opentracing/opentracing-go/log"
3434
)
@@ -233,6 +233,11 @@ func (ps *PushSync) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream)
233233
if cac.Valid(chunk) {
234234
go ps.unwrap(chunk)
235235
} else if chunk, err := soc.FromChunk(chunk); err == nil {
236+
addr, err := chunk.Address()
237+
if err != nil {
238+
return err
239+
}
240+
ps.logger.Debug("handle gsoc", "peer_address", p.Address, "chunk_address", addr, "wrapped_chunk_address", chunk.WrappedChunk().Address())
236241
ps.gsocHandler(chunk)
237242
} else {
238243
return swarm.ErrInvalidChunk

0 commit comments

Comments
 (0)