From 76d756ff6b6b919f90b80fe61d10643a56bf6a1b Mon Sep 17 00:00:00 2001 From: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:43:13 -0400 Subject: [PATCH] Remove error from Router AppGossip (#2238) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> --- network/p2p/handler.go | 6 ++---- network/p2p/router.go | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/network/p2p/handler.go b/network/p2p/handler.go index 9212864e5436..790893142087 100644 --- a/network/p2p/handler.go +++ b/network/p2p/handler.go @@ -111,9 +111,8 @@ func (r *responder) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID return r.sender.SendAppResponse(ctx, nodeID, requestID, appResponse) } -func (r *responder) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error { - err := r.handler.AppGossip(ctx, nodeID, msg) - if err != nil { +func (r *responder) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) { + if err := r.handler.AppGossip(ctx, nodeID, msg); err != nil { r.log.Debug("failed to handle message", zap.Stringer("messageOp", message.AppGossipOp), zap.Stringer("nodeID", nodeID), @@ -121,7 +120,6 @@ func (r *responder) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte zap.Binary("message", msg), ) } - return nil } func (r *responder) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, request []byte) error { diff --git a/network/p2p/router.go b/network/p2p/router.go index bd1f334cda7c..1da66a7d2d4e 100644 --- a/network/p2p/router.go +++ b/network/p2p/router.go @@ -256,9 +256,7 @@ func (r *Router) AppGossip(ctx context.Context, nodeID ids.NodeID, gossip []byte return nil } - if err := handler.AppGossip(ctx, nodeID, parsedMsg); err != nil { - return err - } + handler.AppGossip(ctx, nodeID, parsedMsg) handler.metrics.appGossipTime.Observe(float64(time.Since(start))) return nil