Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: v1.0.1 #10

Merged
merged 5 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions node/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/big"
"net"
"net/http"
"strings"
"sync/atomic"
"time"

Expand All @@ -26,7 +27,7 @@ var (
PayBidTxGasUsed = uint64(25000)

dialer = &net.Dialer{
Timeout: time.Second,
Timeout: 5 * time.Second,
KeepAlive: 60 * time.Second,
}

Expand Down Expand Up @@ -117,7 +118,17 @@ 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 {
Expand Down
6 changes: 5 additions & 1 deletion service/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func (s *MevSentry) SendBid(ctx context.Context, args types.BidArgs) (bidHash co
log.Errorw("failed to parse bid signature", "err", err)
err = types.NewInvalidBidError(fmt.Sprintf("invalid signature:%v", err))
return
} else if _, ok = s.builders[builder]; !ok {
log.Errorw("builder not registered", "address", builder)
err = types.NewInvalidBidError("builder not registered")
return
}

payBidTx, err := validator.GeneratePayBidTx(ctx, builder, args.RawBid.BuilderFee)
Expand Down Expand Up @@ -208,7 +212,7 @@ func (s *MevSentry) ReportIssue(ctx context.Context, issue types.BidIssue) (err

builder, ok = s.builders[issue.Builder]
if !ok {
log.Errorw("builder not found", "address", issue.Builder)
log.Errorw("builder url not found", "address", issue.Builder, "issue", issue)
err = errors.New("builder not found")
return
}
Expand Down
Loading