Skip to content

Commit

Permalink
[goreleaser] more span
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Dec 29, 2023
1 parent d08c2c6 commit e96c8f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/rfq/relayer/service/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (q *QuoteRequestHandler) handleSeen(ctx context.Context, _ trace.Span, requ
// never relayed.
// Reorgs are rare enough that its questionable wether this is ever worth building or if we can just
// leave these in the queue.
func (q *QuoteRequestHandler) handleCommitPending(ctx context.Context, _ trace.Span, request reldb.QuoteRequest) (err error) {
func (q *QuoteRequestHandler) handleCommitPending(ctx context.Context, span trace.Span, request reldb.QuoteRequest) (err error) {
earliestConfirmBlock := request.BlockNumber + q.Origin.Confirmations
if earliestConfirmBlock < q.Origin.LatestBlock() {
// can't complete yet, do nothing
Expand All @@ -136,6 +136,11 @@ func (q *QuoteRequestHandler) handleCommitPending(ctx context.Context, _ trace.S
return fmt.Errorf("could not get bridge status: %w", err)
}

span.AddEvent("pending", trace.WithAttributes(
attribute.Int("latest_block", int(q.Origin.LatestBlock())),
attribute.Int("earliest_confirm_block", int(earliestConfirmBlock)),
attribute.String("chain_bridge_status", fastbridge.BridgeStatus(bs).String())))

// sanity check to make sure it's still requested.
if bs == fastbridge.REQUESTED.Int() {
err = q.db.UpdateQuoteRequestStatus(ctx, request.TransactionID, reldb.CommittedConfirmed)
Expand Down

0 comments on commit e96c8f8

Please sign in to comment.