Skip to content
Draft
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: 10 additions & 5 deletions pkg/txm/clientwrappers/dualbroadcast/meta_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (

const (
defaultAuctionRequestTimeout = time.Second * 5
NoSolverOps = "no solver operations received"
NoSolverOpsAfterSimulation = "no valid solver operations after simulation"
metaABI = `[
NoSolverOps = "no solver operations received"
NoSolverOpsAfterSimulation = "no valid solver operations after simulation"
metaABI = `[
{
"type": "function",
"name": "metacall",
Expand Down Expand Up @@ -317,6 +317,7 @@ type Metacalldata struct {

func (a *MetaClient) SendRequest(parentCtx context.Context, tx *types.Transaction, attempt *types.Attempt, dualBroadcastParams string, fwdrDestAddress common.Address) (*MetacalldataResponse, error) {
ctx, cancel := context.WithTimeout(parentCtx, a.auctionRequestTimeout)
a.lggr.Info("Auction Request Context Started for tx id", tx.ID)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log uses unstructured Info with a free-form message and a bare tx.ID argument. Elsewhere in this file tx identifiers are logged as structured fields via Infow(..., "txID", tx.ID), which is easier to query/aggregate. Consider switching this to Infow and (since this is about timeouts) include the timeout/deadline as a structured field as well.

Suggested change
a.lggr.Info("Auction Request Context Started for tx id", tx.ID)
deadline, _ := ctx.Deadline()
a.lggr.Infow("Auction request context started", "txID", tx.ID, "timeout", a.auctionRequestTimeout, "deadline", deadline)

Copilot uses AI. Check for mistakes.
defer cancel()

m := []byte{97, 116, 108, 97, 115, 95, 111, 101, 118, 65, 117, 99, 116, 105, 111, 110}
Expand Down Expand Up @@ -365,13 +366,17 @@ func (a *MetaClient) SendRequest(parentCtx context.Context, tx *types.Transactio

// Start timing for endpoint latency measurement
startTime := time.Now()
a.lggr.Infow("Auction Request Start", "txID", tx.ID)
resp, err := http.DefaultClient.Do(req)
latency := time.Since(startTime)

if ctx.Err() != nil {
a.lggr.Infow("Auction Request Context Deadline Exceeded", "txID", tx.ID)
}
a.lggr.Infow("Auction Request Latency", "txID", tx.ID, "failed", err != nil, "latency", latency)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latency log records only a boolean failed flag, but drops the actual err value when the request fails. Without logging the error (e.g., as an err field) this event is much less actionable for debugging timeouts/transport failures.

Suggested change
a.lggr.Infow("Auction Request Latency", "txID", tx.ID, "failed", err != nil, "latency", latency)
a.lggr.Infow("Auction Request Latency", "txID", tx.ID, "failed", err != nil, "latency", latency, "err", err)

Copilot uses AI. Check for mistakes.
// Record latency
a.metrics.RecordLatency(ctx, latency)
if err != nil {
return nil, fmt.Errorf("failed to send POST request: %w", err)
return nil, fmt.Errorf("failed to send POST request with latency %s: %w", latency, err)
}
defer resp.Body.Close()

Expand Down
Loading