From f0e69f00b0264ac4a7c1923c64df466af8ac1eff Mon Sep 17 00:00:00 2001 From: irrun Date: Wed, 29 May 2024 15:45:03 +0800 Subject: [PATCH] feat: hide validator ip --- node/validator.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/node/validator.go b/node/validator.go index 1078f83..270d122 100644 --- a/node/validator.go +++ b/node/validator.go @@ -7,6 +7,7 @@ import ( "math/big" "net" "net/http" + "strings" "sync/atomic" "time" @@ -117,7 +118,18 @@ type validator struct { } func (n *validator) SendBid(ctx context.Context, args types.BidArgs) (common.Hash, error) { - return n.client.SendBid(ctx, args) + hash, err := n.client.SendBid(ctx, args) + if err != nil { + metrics.ChainError.Inc() + log.Errorw("failed to send bid", "err", err) + + if strings.Contains(err.Error(), "timeout") { + err = errors.New("timeout when send bid to validator") + } + + } + + return hash, err } func (n *validator) MevRunning() bool {