From 3ab8ec880bf9db256b469cf33996c01df8e16511 Mon Sep 17 00:00:00 2001 From: aodhgan Date: Mon, 13 Oct 2025 12:57:23 -0700 Subject: [PATCH] check for DeadlineExceeded --- internal/ethapi/api.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 2f24a6c720..22e82bea34 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1694,14 +1694,19 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex for { select { case <-receiptCtx.Done(): - // Upstream cancellation -> bubble it; otherwise emit the timeout error + // If server-side wait window elapsed, return the structured timeout. + if errors.Is(receiptCtx.Err(), context.DeadlineExceeded) { + return nil, &txSyncTimeoutError{ + msg: fmt.Sprintf("The transaction was added to the transaction pool but wasn't processed in %v.", timeout), + hash: hash, + } + } + // Otherwise, bubble the caller's context error (canceled or deadline). if err := ctx.Err(); err != nil { return nil, err } - return nil, &txSyncTimeoutError{ - msg: fmt.Sprintf("The transaction was added to the transaction pool but wasn't processed in %v.", timeout), - hash: hash, - } + // Fallback: return the derived context's error. + return nil, receiptCtx.Err() case err, ok := <-subErrCh: if !ok || err == nil {