github.com/ethereum-optimism/optimism@v1.7.2/op-node/node/comms.go (about) 1 package node 2 3 import ( 4 "context" 5 6 "github.com/libp2p/go-libp2p/core/peer" 7 8 "github.com/ethereum-optimism/optimism/op-service/eth" 9 ) 10 11 // Tracer configures the OpNode to share events 12 type Tracer interface { 13 OnNewL1Head(ctx context.Context, sig eth.L1BlockRef) 14 OnUnsafeL2Payload(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) 15 OnPublishL2Payload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) 16 } 17 18 type noOpTracer struct{} 19 20 func (n noOpTracer) OnNewL1Head(ctx context.Context, sig eth.L1BlockRef) {} 21 22 func (n noOpTracer) OnUnsafeL2Payload(ctx context.Context, from peer.ID, payload *eth.ExecutionPayloadEnvelope) { 23 } 24 25 func (n noOpTracer) OnPublishL2Payload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) {} 26 27 var _ Tracer = (*noOpTracer)(nil)