github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/tracer/gossipSubNoopTracer.go (about)

     1  package tracer
     2  
     3  import (
     4  	pubsub "github.com/libp2p/go-libp2p-pubsub"
     5  	"github.com/libp2p/go-libp2p/core/peer"
     6  	"github.com/libp2p/go-libp2p/core/protocol"
     7  )
     8  
     9  // GossipSubNoopTracer is a no-op tracer that implements the RawTracer interface
    10  // for the Flow network.
    11  type GossipSubNoopTracer struct {
    12  }
    13  
    14  var _ pubsub.RawTracer = (*GossipSubNoopTracer)(nil)
    15  
    16  func (t *GossipSubNoopTracer) AddPeer(p peer.ID, proto protocol.ID) {
    17  	// no-op
    18  }
    19  
    20  func (t *GossipSubNoopTracer) RemovePeer(p peer.ID) {
    21  	// no-op
    22  }
    23  
    24  func (t *GossipSubNoopTracer) Join(topic string) {
    25  	// no-op
    26  }
    27  
    28  func (t *GossipSubNoopTracer) Leave(topic string) {
    29  	// no-op
    30  }
    31  
    32  func (t *GossipSubNoopTracer) Graft(p peer.ID, topic string) {
    33  	// no-op
    34  }
    35  
    36  func (t *GossipSubNoopTracer) Prune(p peer.ID, topic string) {
    37  	// no-op
    38  }
    39  
    40  func (t *GossipSubNoopTracer) ValidateMessage(msg *pubsub.Message) {
    41  	// no-op
    42  }
    43  
    44  func (t *GossipSubNoopTracer) DeliverMessage(msg *pubsub.Message) {
    45  	// no-op
    46  }
    47  
    48  func (t *GossipSubNoopTracer) RejectMessage(msg *pubsub.Message, reason string) {
    49  	// no-op
    50  }
    51  
    52  func (t *GossipSubNoopTracer) DuplicateMessage(msg *pubsub.Message) {
    53  	// no-op
    54  }
    55  
    56  func (t *GossipSubNoopTracer) ThrottlePeer(p peer.ID) {
    57  	// no-op
    58  }
    59  
    60  func (t *GossipSubNoopTracer) RecvRPC(rpc *pubsub.RPC) {
    61  	// no-op
    62  }
    63  
    64  func (t *GossipSubNoopTracer) SendRPC(rpc *pubsub.RPC, p peer.ID) {
    65  	// no-op
    66  }
    67  
    68  func (t *GossipSubNoopTracer) DropRPC(rpc *pubsub.RPC, p peer.ID) {
    69  	// no-op
    70  }
    71  
    72  func (t *GossipSubNoopTracer) UndeliverableMessage(msg *pubsub.Message) {
    73  	// no-op
    74  }
    75  
    76  func NewGossipSubNoopTracer() *GossipSubNoopTracer {
    77  	return &GossipSubNoopTracer{}
    78  }