From 0f1170e7692d15f04334137536abd1e5e941fd2e Mon Sep 17 00:00:00 2001 From: Tristan Wilson Date: Wed, 2 Aug 2023 19:27:29 -0700 Subject: [PATCH] Revert "Fix batchCallBuffer timeout handling" This reverts commit 5061259f99600165ac0f45655c93bf1f6afea8f9. Timeout handling for batches was improved upstream in this PR https://github.com/ethereum/go-ethereum/pull/26681 which will be merged in in the next commit. Reverting this commit to make the merge cleaner. --- rpc/handler.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/rpc/handler.go b/rpc/handler.go index 965344d8b..3e31f3a32 100644 --- a/rpc/handler.go +++ b/rpc/handler.go @@ -158,14 +158,7 @@ func (b *batchCallBuffer) timeout(ctx context.Context, conn jsonWriter) { for _, msg := range b.calls { if !msg.isNotification() { resp := msg.errorResponse(&internalServerError{errcodeTimeout, errMsgTimeout}) - serialized, err := json.Marshal(resp) - if err != nil { - conn.writeJSON(ctx, errorMessage(&parseError{"error serializing timeout error: " + err.Error()}), true) - b.wrote = true - return - } - - b.resp = append(b.resp, serialized) + b.resp = append(b.resp, resp) } } b.doWrite(ctx, conn, true) @@ -237,7 +230,7 @@ func (h *handler) handleBatch(msgs []*jsonrpcMessage) { resp := h.handleCallMsg(cp, msg) err := callBuffer.pushResponse(resp) if err != nil { - h.conn.writeJSON(cp.ctx, errorMessage(err), true) + h.conn.writeJSON(cp.ctx, errorMessage(err)) return } }