From a34dbd8435792223b04cd839518be9218263c450 Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Tue, 14 Jul 2026 20:00:00 +0800 Subject: [PATCH] internal/ethapi: cap default tx sync timeout at RPC max SendRawTransactionSync capped an explicitly requested timeout but not the configured default. Clamp defaultTimeout to the max so a misconfigured default cannot wait longer than RPCTxSyncMaxTimeout. --- internal/ethapi/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 2eb4dee3c0..d5cabaea49 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1790,6 +1790,9 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex defaultTimeout = api.b.RPCTxSyncDefaultTimeout() timeout = defaultTimeout ) + if timeout > maxTimeout { + timeout = maxTimeout + } if timeoutMs != nil && *timeoutMs > 0 { req := time.Duration(*timeoutMs) * time.Millisecond if req > maxTimeout {