Skip to content

Commit

Permalink
fix: err message
Browse files Browse the repository at this point in the history
  • Loading branch information
irrun committed Mar 7, 2024
1 parent 727d5d8 commit 05530d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configs/config-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PrivateURL = "http://127.0.0.1:8546"
PublicHostName = "127.0.0.1"

[[Builders]]
Address = "0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B"
Address = "0x837060bd423eFcDd5B7b6B92aB3CFc74B9CD0df4"
URL = "http://localhost:8555"

[FullNode]
Expand Down
13 changes: 8 additions & 5 deletions service/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package service
import (
"context"
"errors"
"fmt"
"math/big"
"strings"
"time"
Expand Down Expand Up @@ -84,7 +85,7 @@ func (s *MevSentry) SendBid(ctx context.Context, args types.BidArgs) (common.Has
builder, err := args.EcrecoverSender()
if err != nil {
log.Errorw("failed to parse bid signature", "err", err)
return common.Hash{}, err
return common.Hash{}, types.NewInvalidBidError(fmt.Sprintf("invalid signature:%v", err))
}

if args.RawBid.BuilderFee != nil && args.RawBid.BuilderFee.Cmp(big.NewInt(0)) > 0 {
Expand Down Expand Up @@ -160,7 +161,7 @@ func (s *MevSentry) Running(ctx context.Context) (bool, error) {
return validator.MevRunning(), nil
}

func (s *MevSentry) ReportIssue(ctx context.Context, args types.BidIssue) error {
func (s *MevSentry) ReportIssue(ctx context.Context, issue types.BidIssue) error {
method := "mev_reportIssue"
start := time.Now()
defer recordLatency(method, start)
Expand All @@ -169,13 +170,15 @@ func (s *MevSentry) ReportIssue(ctx context.Context, args types.BidIssue) error
var builder node.Builder
var ok bool

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

return builder.ReportIssue(ctx, args)
fmt.Sprintf("issue: %+v", issue)

Check failure on line 179 in service/sentry.go

View workflow job for this annotation

GitHub Actions / golang-lint (1.21.x, ubuntu-latest)

unusedresult: result of fmt.Sprintf call not used (govet)

return builder.ReportIssue(ctx, issue)
}

func recordLatency(method string, start time.Time) {
Expand Down

0 comments on commit 05530d5

Please sign in to comment.