Skip to content

Commit

Permalink
Remove error from Router AppGossip (#2238)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
  • Loading branch information
joshua-kim committed Oct 31, 2023
1 parent 5b96789 commit 76d756f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions network/p2p/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,15 @@ 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),
zap.Uint64("handlerID", r.handlerID),
zap.Binary("message", msg),
)
}
return nil
}

func (r *responder) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, request []byte) error {
Expand Down
4 changes: 1 addition & 3 deletions network/p2p/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76d756f

Please sign in to comment.